C
C#2y ago
TrixxTraxx

❔ Project breaks after migrating to docker

I migrated my Project to docker and it starts but then throws this exception and I cant find a Solution anywhere:
Unhandled exception. System.IO.DirectoryNotFoundException: /.nuget/packages/mudblazor/6.2.3/staticwebassets/
2023-05-14T12:14:59.843191516Z at Microsoft.Extensions.FileProviders.PhysicalFileProvider..ctor(String root, ExclusionFilters filters)
2023-05-14T12:14:59.843196606Z at Microsoft.AspNetCore.Hosting.StaticWebAssets.StaticWebAssetsLoader.<>c.<UseStaticWebAssetsCore>b__1_0(String contentRoot)
2023-05-14T12:14:59.843200323Z at Microsoft.AspNetCore.StaticWebAssets.ManifestStaticWebAssetFileProvider..ctor(StaticWebAssetManifest manifest, Func`2 fileProviderFactory)
2023-05-14T12:14:59.843203499Z at Microsoft.AspNetCore.Hosting.StaticWebAssets.StaticWebAssetsLoader.UseStaticWebAssetsCore(IWebHostEnvironment environment, Stream manifest)
2023-05-14T12:14:59.843206625Z at Microsoft.AspNetCore.Hosting.StaticWebAssets.StaticWebAssetsLoader.UseStaticWebAssets(IWebHostEnvironment environment, IConfiguration configuration)
2023-05-14T12:14:59.843209740Z at Microsoft.AspNetCore.Hosting.BootstrapHostBuilder.RunDefaultCallbacks()
2023-05-14T12:14:59.843212776Z at Microsoft.AspNetCore.Builder.WebApplicationBuilder..ctor(WebApplicationOptions options, Action`1 configureDefaults)
2023-05-14T12:14:59.843216002Z at Microsoft.AspNetCore.Builder.WebApplication.CreateBuilder(String[] args)
2023-05-14T12:14:59.843219008Z at Program.Main(String[] args) in /home/trixxtraxx/RiderProjects/GMS/GMS/Program.cs:line 20
Unhandled exception. System.IO.DirectoryNotFoundException: /.nuget/packages/mudblazor/6.2.3/staticwebassets/
2023-05-14T12:14:59.843191516Z at Microsoft.Extensions.FileProviders.PhysicalFileProvider..ctor(String root, ExclusionFilters filters)
2023-05-14T12:14:59.843196606Z at Microsoft.AspNetCore.Hosting.StaticWebAssets.StaticWebAssetsLoader.<>c.<UseStaticWebAssetsCore>b__1_0(String contentRoot)
2023-05-14T12:14:59.843200323Z at Microsoft.AspNetCore.StaticWebAssets.ManifestStaticWebAssetFileProvider..ctor(StaticWebAssetManifest manifest, Func`2 fileProviderFactory)
2023-05-14T12:14:59.843203499Z at Microsoft.AspNetCore.Hosting.StaticWebAssets.StaticWebAssetsLoader.UseStaticWebAssetsCore(IWebHostEnvironment environment, Stream manifest)
2023-05-14T12:14:59.843206625Z at Microsoft.AspNetCore.Hosting.StaticWebAssets.StaticWebAssetsLoader.UseStaticWebAssets(IWebHostEnvironment environment, IConfiguration configuration)
2023-05-14T12:14:59.843209740Z at Microsoft.AspNetCore.Hosting.BootstrapHostBuilder.RunDefaultCallbacks()
2023-05-14T12:14:59.843212776Z at Microsoft.AspNetCore.Builder.WebApplicationBuilder..ctor(WebApplicationOptions options, Action`1 configureDefaults)
2023-05-14T12:14:59.843216002Z at Microsoft.AspNetCore.Builder.WebApplication.CreateBuilder(String[] args)
2023-05-14T12:14:59.843219008Z at Program.Main(String[] args) in /home/trixxtraxx/RiderProjects/GMS/GMS/Program.cs:line 20
31 Replies
TrixxTraxx
TrixxTraxxOP2y ago
here is my dockerfile:
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
WORKDIR /src
COPY ["GMS/GMS.csproj", "GMS/"]
RUN dotnet restore "GMS/GMS.csproj"
COPY . .
WORKDIR "/src/GMS"
RUN dotnet build "GMS.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "GMS.csproj" -c Release -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "GMS.dll"]
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
WORKDIR /src
COPY ["GMS/GMS.csproj", "GMS/"]
RUN dotnet restore "GMS/GMS.csproj"
COPY . .
WORKDIR "/src/GMS"
RUN dotnet build "GMS.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "GMS.csproj" -c Release -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "GMS.dll"]
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
TrixxTraxx
TrixxTraxxOP2y ago
very hard...
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
TrixxTraxx
TrixxTraxxOP2y ago
I can try making a new project, adding mudblazor and see if its related
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
TrixxTraxx
TrixxTraxxOP2y ago
its not a public repository right now, but I can send you the files or add you temporarly if you want to
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
TrixxTraxx
TrixxTraxxOP2y ago
it does happen in a completely empty project asw, I can upload it to github really quick
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
TrixxTraxx
TrixxTraxxOP2y ago
same thing it crashes on var builder = WebApplication.CreateBuilder(args);
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
TrixxTraxx
TrixxTraxxOP2y ago
I have uploaded the code if you wanna take a look for yourself https://github.com/TrixxTraxx/TestMudBlazorDocker
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
TrixxTraxx
TrixxTraxxOP2y ago
ops, now
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
TrixxTraxx
TrixxTraxxOP2y ago
it should be Server
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
TrixxTraxx
TrixxTraxxOP2y ago
I cant even find a sample with docker...
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
TrixxTraxx
TrixxTraxxOP2y ago
well, that has nothing to do with docker....
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
TrixxTraxx
TrixxTraxxOP2y ago
when I run it in Rider it doesnt work...
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
TrixxTraxx
TrixxTraxxOP2y ago
so its a rider issue?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
TrixxTraxx
TrixxTraxxOP2y ago
yep, you are right
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
TrixxTraxx
TrixxTraxxOP2y ago
I got it to run building it with Rider and then running it with the command line just
docker run gms:latest
docker run gms:latest
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server