Closed tessarolli closed 3 years ago
Found the fix
For future reference, this project line
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="5.0.9" PrivateAssets="all" />
should be
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="5.0.9" />
Thanks
Describe the bug
The app is working fine on all development machines, on debug mode. We are publishing it to our Debian Linux Server, and upon starting the software, it fails to load Microsoft.AspNetCore.Components.WebAssembly.Server
Note: If I comment out the code line app.UseBlazorFrameworkFiles(); on Startup.cs, the App starts and run normally (without the blazor support, off course!, but all other functionalities work as expected)
What Am I Doing Wrong that it's not including the referred DLL on publish folder?????
The Exception:
Aug 27 11:20:03 novoservidor ThetaApp.WebAPI[7826]: crit: Microsoft.AspNetCore.Hosting.Diagnostics[6] Aug 27 11:20:03 novoservidor ThetaApp.WebAPI[7826]: Application startup exception Aug 27 11:20:03 novoservidor ThetaApp.WebAPI[7826]: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.AspNetCore.Components.WebAssembly.Server, Version=5.0.9.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified. Aug 27 11:20:03 novoservidor ThetaApp.WebAPI[7826]: Aug 27 11:20:03 novoservidor ThetaApp.WebAPI[7826]: File name: 'Microsoft.AspNetCore.Components.WebAssembly.Server, Version=5.0.9.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' Aug 27 11:20:03 novoservidor ThetaApp.WebAPI[7826]: at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions) Aug 27 11:20:03 novoservidor ThetaApp.WebAPI[7826]: at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) Aug 27 11:20:03 novoservidor ThetaApp.WebAPI[7826]: at Microsoft.AspNetCore.Hosting.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder) Aug 27 11:20:03 novoservidor ThetaApp.WebAPI[7826]: at Microsoft.AspNetCore.Hosting.ConfigureBuilder.<>c__DisplayClass4_0.<Build>b__0(IApplicationBuilder builder) Aug 27 11:20:03 novoservidor ThetaApp.WebAPI[7826]: at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.<>c__DisplayClass15_0.<UseStartup>b__1(IApplicationBuilder app) Aug 27 11:20:03 novoservidor ThetaApp.WebAPI[7826]: at Microsoft.AspNetCore.Mvc.Filters.MiddlewareFilterBuilderStartupFilter.<>c__DisplayClass0_0.<Configure>g__MiddlewareFilterBuilder|0(IApplicationBuilder builder) Aug 27 11:20:03 novoservidor ThetaApp.WebAPI[7826]: at Microsoft.AspNetCore.HostFilteringStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder app) Aug 27 11:20:03 novoservidor ThetaApp.WebAPI[7826]: at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken) Aug 27 11:20:03 novoservidor ThetaApp.WebAPI[7826]: Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.AspNetCore.Components.WebAssembly.Server, Version=5.0.9.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified. Aug 27 11:20:03 novoservidor ThetaApp.WebAPI[7826]: File name: 'Microsoft.AspNetCore.Components.WebAssembly.Server, Version=5.0.9.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' Aug 27 11:20:03 novoservidor ThetaApp.WebAPI[7826]: at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions) Aug 27 11:20:03 novoservidor ThetaApp.WebAPI[7826]: at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) Aug 27 11:20:03 novoservidor ThetaApp.WebAPI[7826]: at Microsoft.AspNetCore.Hosting.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder) Aug 27 11:20:03 novoservidor ThetaApp.WebAPI[7826]: at Microsoft.AspNetCore.Hosting.ConfigureBuilder.<>c__DisplayClass4_0.<Build>b__0(IApplicationBuilder builder) Aug 27 11:20:03 novoservidor ThetaApp.WebAPI[7826]: at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.<>c__DisplayClass15_0.<UseStartup>b__1(IApplicationBuilder app) Aug 27 11:20:03 novoservidor ThetaApp.WebAPI[7826]: at Microsoft.AspNetCore.Mvc.Filters.MiddlewareFilterBuilderStartupFilter.<>c__DisplayClass0_0.<Configure>g__MiddlewareFilterBuilder|0(IApplicationBuilder builder) Aug 27 11:20:03 novoservidor ThetaApp.WebAPI[7826]: at Microsoft.AspNetCore.HostFilteringStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder app) Aug 27 11:20:03 novoservidor ThetaApp.WebAPI[7826]: at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken) Aug 27 11:20:03 novoservidor ThetaApp.WebAPI[7826]: at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken) Aug 27 11:20:03 novoservidor ThetaApp.WebAPI[7826]: at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token) Aug 27 11:20:03 novoservidor ThetaApp.WebAPI[7826]: at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host) Aug 27 11:20:03 novoservidor ThetaApp.WebAPI[7826]: at TessarolliSolutions.ThetaApp.WebAPI.Program.Main(String[] args) in C:\TessarolliSolutions\ThetaApp.WebAPI\Program.cs:line 134
I have tried to manually copying the specified DLL to runtime folder, with no success.
Here is the csproj for the client (on hosted mode)
here is the csproj of the server project
Further technical details
DOT NET CORE, Running on Kestrel, with Apache reverse-proxy on Linux.
dotnet
--info`Runtime Environment: OS Name: debian OS Version: 10 OS Platform: Linux RID: debian.10-x64 Base Path: /usr/share/dotnet/sdk/5.0.400/
Host (useful for support): Version: 5.0.9 Commit: 208e377a53
.NET SDKs installed: 3.1.407 [/usr/share/dotnet/sdk] 5.0.400 [/usr/share/dotnet/sdk]
.NET runtimes installed: Microsoft.AspNetCore.App 3.1.13 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.9 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 3.1.13 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.9 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-download root@novoservidor:/dotnetserver/ThetaApp.WebAPI# dotnet --info .NET SDK (reflecting any global.json): Version: 5.0.400 Commit: d61950f9bf
Runtime Environment: OS Name: debian OS Version: 10 OS Platform: Linux RID: debian.10-x64 Base Path: /usr/share/dotnet/sdk/5.0.400/
Host (useful for support): Version: 5.0.9 Commit: 208e377a53
.NET SDKs installed: 3.1.407 [/usr/share/dotnet/sdk] 5.0.400 [/usr/share/dotnet/sdk]
.NET runtimes installed: Microsoft.AspNetCore.App 3.1.13 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.9 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 3.1.13 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.9 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-download