Hosting MVC 4 application on IIS error 500 due to class library reference - asp.net-mvc-4

When i deploy my mvc 4 application to IIS locally it works. However when i deploy my mvc 4 app on another server it throws 500.
Now the issue here is that my MVC 4 application is using a class library as a database layer which is stopping it from running when its deployed on a remote server. I Tested this by deploying a default mvc 4 application on the server without a class library it launched fine.
But when i reference a class library(empty class library) and redeployed it stopped working (error 500).
The local copy is true on my class library. not sure why IIS doesn't like it.
Am i missing some obvious here?

Related

IIS + ASP.NET Core 6 + Hosting Pack resulting in default document/directory listing error

I'm attempting to get IIS to serve our ASP.NET 6 web application, but every time it complains of needing a default document. If I run the exe (kestrel) one it will serve it, but we want it to be hosted by IIS with the other components of the site.
I installed the 6.0.10 runtime w/ hosting package and these are the results when listing runtimes:
When looking at the site modules, I think it should have what is needed (think the AspNetCoreModuleV2 one handles the compiled routing scenario?):
Have rebooted the server and the app pool specifically, set to No Managed Code, and whenever I attempt to load the page at the localhost level, I get:
The views are compiled so I don't think I even need IIS to open views locally in any capacity.
Everything you've posted ticks off the major deployment steps for hosting a .NET 6 project on IIS:
Installed the .NET Core 6.0 Runtime Windows Hosting Bundle
Set up the IIS app pool with "No Managed Code"
Rebooted the server: "Have you turned it off and on again?"
After our exchange in the comments, the only thing that appeared to be missing is to use the .NET publish command; not the build command.
When deploying to IIS, you'll want to run the dotnet publish command and then deploy those artifacts to your IIS server. From the docs:
The dotnet publish command's output is ready for deployment to a hosting system (for example, a server, PC, Mac, laptop) for execution. It's the only officially supported way to prepare the application for deployment. Depending on the type of deployment that the project specifies, the hosting system may or may not have the .NET shared runtime installed on it.
You also may want to review: Publish .NET apps with the .NET CLI.

The SSL connection could not be established net core on IIS, but works sperately as exe

I created an asp.net core web api in .Net Core 3.1. It Works successfully when I debugging it using visual studio, o running it in server using exe file. But when I put web api on IIS then service gives following error: One or more errors occurred. (The SSL connection could not be established, see inner exception.) What can be reason? how find reason? how to solve?

Application Pool Crashes IIS 10 ASP.Net Core 3.2 Blazor App EF Core

I have an Asp.Net Core 3.2 Blazor Webassembly application that has been published to a server running Windows Server 2016 with IIS 10.
After publishing to the server I can browse the login page to the site, However, when I attempt to login which calls a service and signs in with Entity Framework Core 3.1.5.
However when I attempt to call a linq query on the DbContext it seems to fail (This is deduced from log files).
Interestingly, if I remote into the server whilst running a login I get a JIT popup with the following error;
In the Windows System Log can see the following error;
A process serving application pool 'myapppool(domain)(4.0)(pool)' suffered a fatal communication error with the Windows Process Activation Service. The process id was '10188'. The data field contains the error number.
It seems to sometime crashes the apppool as well so if I then refresh the page i get 502 error on the site?
Below is a screen shot of the application pool advanced settings;
The server is running Windows 2016 with Plesk Obsidian installed on it (I'm not sure if this can interfere in any way??)
Does anyone know whats going on here please?
I don’t know what’s going on since I can not reproduce your issue. Here is a workaround.
Please ensure that IIS Application pool’s Advanced Settings has set ”Enable 32-Bit Application” to true.
Check below link for troubleshooting the issue.
How to diagnose IIS fatal communication error problem

Could not load file or assembly 'EntityFramework, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies

I am getting this error in a WCF web service when the program attempts to use a method that employs the entity framework. However, we know that the server has the entity framework (correct version) installed because it is hosting another WCF web service and an intranet site that use it successfully.
I've tried to set copy local to true, however this simply compiles the Entity Framework dll into the debug/release folder of the project that uses it, not the web service project that gets deployed (the project that gets deployed contains a references the project that uses the entity framework).
Has anyone run into this kind of issue before and know a work-around either with or without using copy local?
The solution to this problem was to simply place the EntityFramework.dll and .xml file generated in the bin of the project that uses the Entity Framework and place that in the bin of the service project that was being deployed.
Check to see that the Application Pool for the IIS Site in question is set to use to correct .NET Framework version. In the case of EF 4.1, the Application Pool should be running on .NET Framework version 4 or higher.
To identify the version of .NET being used by the site, first find out the Application pool in use (in IIS, click on Basic Settings for the site), then identify the appropriate pool under the Application Pools node. The .NET Framework version should be listed.
Check whether bit versions are compatible between entity framework and server. If the server is 64 bit and you are using 32 bit entity framework dll you can get this error. Then change app pool setting to enable 32 bit applications.

Retrieving the COM class factory for component with CLSID {XXXX} failed due to the following error: 80040154

I am running 32 bit Windows 7 Operation System which has IIS 7.5 installed.
In Visual Studio 2010, I open my solution having the web site project hosting WCF service. I have created an application in the IIS which points to the website project. The web site's bin folder has many assemblies which I need to refer. But those assemblies also have built using .NET 4 on the same computer.
I can browse the WCF service using both HTTP & HTTPS.
However, when i access the service from the test windows application (using the proxy class of the WCF contract), I get the error in question. Everything was working without problem earlier.
Anyone can help to fix the issue?. How to investigate this issue?
Error 0x80040154 means "Class Not Registered", which usually means you're depending on a COM component that hasn't been installed properly on the machine.
Is any of those Assemblies you reference a COM Interop Assembly? If so, find out what it uses and then install the appropriate COM component.