0

I'm hoping someone in the know might be able to point me in the right direction with this please.

I have a blazor web app which runs fine in Visual Studio. I publish it to FILE (SELF CONTAINED win-x86) and add it to IIS on the local machine. It works as expected.

I then upload it to a shared hosting platform - again on IIS - that I'm very familar with and it refuses to run. It generates "HTTP Error 500.30 - ASP.NET Core app failed to start".

So just out of interest I upload to a different hosting company (again a service familiar to me) - it generates exactly the same response.

("So I also create an out-of-the-box blazor app and upload - same issue" UPDATE - after much checking, this is not true - an out of the box blazor app DOES work)

So I enable stdout and aspnetcore-debug logging in the WEB.CONFIG and both servers report the same issue, which I have no idea how to fix. It seems that for some reason, some assemblies are not being loaded, despite being in the uploaded files. It starts with assemblies referenced in the program.cs file in order of being used. If I comment out the first assembly (Serilog config related), it just fails on the next one (eg Radzen.Blazor but it could be anything).

So what am I missing? Why are assemblies not being found on the remote IIS server, that work perfectly well on the local IIS server?

example error from stdout log:

Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'PACKAGE_NAME_HERE, Version=WHATEVER, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
File name: 'Radzen.Blazor, Version=5.9.8.0, Culture=neutral, PublicKeyToken=null'
   at MyProject.com.Extensions.AddThirdPartyComponentsToServerExtension.AddThirdPartyComponentsToServer(IServiceCollection services)
   at Program.<Main>$(String[] args) in D:\Repos\MyProject\Program.cs:line 42

Thanks for any help/pointers

2
  • which .net version you are using while running locally and at the time of deployment what is your target runtime? could you share your web.config file? have you installed the runtime and hosting bundle on the remote machine? the error message you shared which indicate project is unable to find the dll so could you check Radzen.Blazor.dll is present in the output folder. have you tested with just normal application without using this Radzen.Blazor package. and also enable 32 bit to true in iis app pool Commented Feb 13 at 3:29
  • Thanks for taking the time to try - it's none of the above. It's a self contained deployment, so version the version on the remote machine is not a factor. If It was the bitwise issue (cant run 32 bit), then the error would be different (503.31). Neither is it the Radzen package - its the same for all packages. If I coment out Radzen, the next package being used will fail. This is about packages not being found, despite the packages being there - really weird - even more so since it's the same behavior across 2 different servers. Commented Feb 13 at 9:05

1 Answer 1

0

So I managed to find a workaround for this, but I still don't understand why it's happening. All assemblies are in the correct location (same location as the project assembly) but it refuses to find them.

By adding a manual 'Load Assembly' to program.cs - interestingly for just any one of the "missing" assemblies, it then finds them all. So in my case I manually load Serilog Configuration and the rest are found too.

Hope it helps someone else

//note the trailing period at the end of the path "\."
var pathToFiles = @"C:\path\to\hosted\files\.";
Assembly.LoadFrom(@$"{pathToFiles}Serilog.Settings.Configuration.dll");
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.