Hello,
I’ve started developing a website using .Netframework 4.8.1 and .NET Core 9.00 but problem with using both frameworks when adding MySQLConnector libraries from Nuget Package manager, the application doesn’t run, complaining about missing dependent DLL like System.Memory but this works fine if I only select .NET core 9.0 so not sure what I’m doing wrong.
I’ve deployed an application to IIS in a VPS server and with framework 4.8.1 it works fine but obviously missing DLL message is not letting me connect to the database.
If I select .Net core 9.0 to develop application then MySQLConnector is working fine but deployment got some issues, on deployment I’ve followed all the instructions and videos and install all the required SDKs required for .Netcore deployment but this way the website opens up but doesn’t show the starting login page.
Looking at the server logs and log files getting different messages like this.
Last night, I was getting these error messages.
A fatal error was encountered. The library ‘hostpolicy.dll’ required to execute the application was not found in ‘C:\inetpub\wwwroot\wisej\’.
Failed to run as a self-contained app.
– The application was run as a self-contained app because ‘C:\inetpub\wwwroot\wisej\WisejWebApplication6.runtimeconfig.json’ was not found.
– If this should be a framework-dependent app, add the ‘C:\inetpub\wwwroot\wisej\WisejWebApplication6.runtimeconfig.json’ file and specify the appropriate framework.
A fatal error was encountered. The library ‘hostpolicy.dll’ required to execute the application was not found in ‘C:\inetpub\wwwroot\wisej\’.
Failed to run as a self-contained app.
– The application was run as a self-contained app because ‘C:\inetpub\wwwroot\wisej\WisejWebApplication6.runtimeconfig.json’ was not found.
– If this should be a framework-dependent app, add the ‘C:\inetpub\wwwroot\wisej\WisejWebApplication6.runtimeconfig.json’ file and specify the appropriate framework.
This morning I’m getting these, so not sure what I’m doing wrong.
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Production
info: Microsoft.Hosting.Lifetime[0]
Content root path: C:\inetpub\wwwroot\wisej
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/1.1 GET http://wisejtesting.com/ – – –
info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[6]
The file /Default.html was not modified
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished HTTP/1.1 GET http://wisejtesting.com/Default.html – 304 – text/html 551.1396ms
info: Microsoft.Hosting.Lifetime[0]
Application is shutting down…
Thanks for your quick reply.
I did select .Net framework 4.8.1 and .NetCore9.0 originally for my project but using two frameworks for one application is causing the failure with mismatching the DLL version numbers but if I select only one framework like .NetCore9.00 then the project is working so that’s my first hurdle that I faced.
Now I decided that if the .NetCore9.0 working I can only select this framework for my project for which I’ve attached a sample project.
As you can see I didn’t select the self-contained deployment mode, tbh I don’t know much about these things so I just went what the publishing wizard default values are, in my case framework-dependent is selected but can you please look at the picture I’ve attached to see if I’m selecting the right values.
I’ve also attached the web.config of my project which I’ve changed by following the deployment instructions from Wisej video tutorial.
Lastly I’ve attached the image of website after deployment that it’s not showing any deployment error but the initial form of website is not showing up.
MySQLConnector is not a wisej nuget. When you add a nuget package it’s all standard .NET and if something is missing or wrongly referenced it has nothing to do with wisej.
Same for deployment. It’s all standard stuff. In your error log it shows an error about self contained executable. It means you selected the deployment to be self contained. Don’y use that option unless you really know what you are doing. See publishing options on Microsoft help for more information.
It’s also unclear what you are trying to deploy to. Net core or net framework? Which instructions did you follow? Net 48 cannot be published using the VS publishing tool and the sdk project format. The publishing tool is part of VS not Wisej and Microsoft removed the net48 publishing.
Also if you attach a sample project maybe someone else may be able to spot what’s wrong
Please login first to submit.
