Ich möchte Kafka, Zookeeper und meine 2 Dienste in verschiedenen Containern betreiben. Ich muss lernen, wie Message Broker funktioniert. Aber ich habe in dieser Situation geblieben. Beim Ausführen von Docker -Compose -D erhalte ich diesen Fehler: < /p>
[url=viewtopic.php?t=14917]Ich möchte[/url] Kafka, Zookeeper und meine 2 Dienste in verschiedenen Containern betreiben. Ich muss lernen, wie Message Broker funktioniert. Aber ich habe in dieser Situation geblieben. Beim Ausführen von Docker -Compose -D erhalte ich diesen Fehler: < /p> [code] > [reportservice publish 1/1] RUN dotnet publish "./ReportService.csproj" -c Release -o /app/publish /p:UseAppHost=false: 1.013 Determining projects to restore... 1.350 All projects are up-to-date for restore. 2.130 DirectoryService -> /src/DirectoryService/bin/Release/net9.0/DirectoryService.dll 4.383 /src/ReportService/Migrations/20250412141416_initial.cs(9,26): warning CS8981: The type name 'initial' only contains lower-cased ascii characters. Such names may become reserved for the language. [/src/ReportService/ReportService.csproj] 4.383 /src/ReportService/Migrations/20250412141416_initial.Designer.cs(16,19): warning CS8981: The type name 'initial' only contains lower-cased ascii characters. Such names may become reserved for the language. [/src/ReportService/ReportService.csproj] 4.383 /src/ReportService/Models/Report.cs(10,23): warning CS8618: Non-nullable property 'Location' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable. [/src/ReportService/ReportService.csproj] 4.383 /src/ReportService/Services/ReportService.cs(28,36): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. [/src/ReportService/ReportService.csproj] 4.590 ReportService -> /src/ReportService/bin/Release/net9.0/ReportService.dll 4.802 /usr/share/dotnet/sdk/9.0.203/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.ConflictResolution.targets(112,5): error NETSDK1152: Found multiple publish output files with the same relative path: /src/DirectoryService/appsettings.Development.json, /src/ReportService/appsettings.Development.json, /src/DirectoryService/appsettings.json, /src/ReportService/appsettings.json. [/src/ReportService/ReportService.csproj] ------ failed to solve: process "/bin/sh -c dotnet publish \"./ReportService.csproj\" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false" did not complete successfully: exit code: 1 < /code> Hier ist meine Docker-Compose-Datei: < /p> version: '3.8'
networks: app-network: driver: bridge < /code> Mein Dockerfiles für jedes Projekt < /p> Projekt 1: < /h1> FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base USER $APP_UID WORKDIR /app EXPOSE 8080 EXPOSE 8081
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build ARG BUILD_CONFIGURATION=Release WORKDIR /src COPY ["ReportService/ReportService.csproj", "ReportService/"] RUN dotnet restore "./ReportService/ReportService.csproj" COPY . . WORKDIR "/src/ReportService" RUN dotnet build "./ReportService.csproj" -c $BUILD_CONFIGURATION -o /app/build
FROM build AS publish ARG BUILD_CONFIGURATION=Release RUN dotnet publish "./ReportService.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
FROM base AS final WORKDIR /app COPY ReportService/appsettings.json /app/ COPY ReportService/appsettings.Development.json /app/ COPY --from=publish /app/publish . ENTRYPOINT ["dotnet", "ReportService.dll"] < /code> Projekt 2 < /h1> FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base USER $APP_UID WORKDIR /app EXPOSE 8080 EXPOSE 8081
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build ARG BUILD_CONFIGURATION=Release WORKDIR /src COPY ["DirectoryService/DirectoryService.csproj", "DirectoryService/"] RUN dotnet restore "./DirectoryService/DirectoryService.csproj" COPY . . WORKDIR "/src/DirectoryService" RUN dotnet build "./DirectoryService.csproj" -c $BUILD_CONFIGURATION -o /app/build
FROM build AS publish ARG BUILD_CONFIGURATION=Release RUN dotnet publish "./DirectoryService.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
FROM base AS final WORKDIR /app COPY DirectoryService/appsettings.json /app/ COPY DirectoryService/appsettings.Development.json /app/ COPY --from=publish /app/publish . ENTRYPOINT ["dotnet", "DirectoryService.dll"] [/code] Wie kann ich das beheben und weiter arbeiten?
Ich versuche, ein ASP.NET -Kern -Web -API -Projekt in meinem Linux -System (Ubuntu 22.04) zu erstellen und mit dem Befehl dotnet restore oder dotnet New ein Problem zu stellen: Der Prozess bleibt...
Also habe ich dieses Setup in meinem Projekt, mit dem meine Datei für meine Launchsettings.json so aussieht:
profiles : {
LeadDog.Web - Local : {
commandName : Project ,
dotnetRunMessages : true...
Ich habe ein untergeordnetes Projekt, Projekt C, das eine Abhängigkeit vom übergeordneten Maven's Bill of Materials (BOM)-Projekt, Projekt P, aufweist. Das übergeordnete Projekt, Projekt P, enthält...
Ich automatisiere die Datei Setup Generation (.msi) von A WinForms App mit einem c# Konsolen -Tool , das dotnet veröffentlichen über Code. Info .
Die Veröffentlichung funktioniert die meiste Zeit,...