HTTP 500.19-Internal Server Error. without any config Error - asp.net

I am trying to host a asp.net mvc web application on iis but having this error
Now the problem is that it does not have any error in the Config Error: section. I have given the permission to the folder for IIS_IUSERS but still no success. I have almost every solution I come accross on internet, but nothing is solving my problem. My config file is this
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\CECDashboard.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false">
<environmentVariables />
</aspNetCore>
</system.webServer>
</configuration>
I have also tried changing DefaultAppPool .NET CLR from v4.0.30319 to v2.0.50727 but still no success.
I have also tried pass-through authentication and specific user but both with the same results (no success)
Please suggest me something. I will be very thankful.

It seems that this is not an Asp.Net Core application, just Asp.net framework MVC application.
Asp.Net application requires certain windows feature to run it. please enable the Asp.Netfeature in the windows features.
If the web application is indeed a DotNet Core MVC application, please consider installing Asp.net Core Hosting Bundle, which includes the DotNet Core Runtime and IIS support.
https://dotnet.microsoft.com/download/dotnet-core/current/runtime
Feel free to let me know if the problem still exists.

Related

ASP.NET Core RESTfull API hosting - 500 internal server error

According to this topic I'm trying to publish and host my .NET Core application. I am getting 500 Internal Server Error when I try to retrieve data using GET request from my API (example.com/pets/users). example.com/pets is an URL where my API is published.
My webconfig looks like this:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\Pets.Api.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</configuration>
which I believe is pretty ok.
stdout log says this:
warn:
Microsoft.Extensions.DependencyInjection.DataProtectionServices[59]
Neither user profile nor HKLM registry available. Using an ephemeral key repository. Protected data will be unavailable when
application exits.
warn:
Microsoft.AspNetCore.DataProtection.Repositories.EphemeralXmlRepository[50]
Using an in-memory repository. Keys will not be persisted to storage.
Hosting environment: Production
Content root path: D:\HostingSpaces\xardaslord\example.com\wwwroot\pets
Now listening on: http://localhost:13556
Application started. Press Ctrl+C to shut down.
What exactly can be wrong? I cheked my remotely DB connection and it is correct.
I would really appreciate if someone could help me here.
A workaround for the above warn errors: edit your IIS App Pool to enable User Profile Loading. App pool > Advanced Settings > Load User Profile: True
I fixed the problem. The problem was that I published that API on the new created virtual directory on the server. When I published API on the subdomain everything works fine.

Azure Application Insights and Web Site projects

Is it possible to add Application Insights to a Web Site project type?
In Visual Studio, the following context menu is available for Web Application projects but is missing for Web Site projects.
You should be able to instrument a Web Site project with Application Insights manually. Here are the instructions.
Just want to share what I ended up with doing. First of all, it seems to work like a charm.
The Application Insight is implemented as an ASP.NET Module, so in order to hook it up for Web Site project you need to do the following:
Add Microsoft.ApplicationInsights.Web NuGet package
Register AI module in web.config
<modules runAllManagedModulesForAllRequests="true">
<remove name="ApplicationInsightsWebTracking" />
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" preCondition="managedHandler" />
</modules>
Make sure you have ApplicationInsights.config in Web Site base directory (along with web.config) - it defines which telemetry you going to be collecting

HTTP Handler doesn't hitted, while it run over cloud, when request needs to be redirected to another Server from IIS?

My Asp.net application is hosted over Azure Cloud,
In that application I do have a Java Chat control, which has its server on Linux,
now I have created a HTTPHandler to redirect that chat request to the Linux server, but some how it doesn't work over the Cloud environment (though it works very well on web environment)
it shows the below error
Microsoft Visual Studio
Windows Azure Tools for Microsoft Visual Studio
There was an error attaching the debugger to the IIS worker process for URL 'http://127.255.0.0:82/' for role instance 'deployment16(315).Cloud.AnotherHttpHandler_IN_0'. Unable to start debugging on the web server. See help for common configuration errors. Running the web page outside of the debugger may provide further information.
Make sure the server is operating correctly. Verify there are no syntax errors in web.config by doing a Debug.Start Without Debugging. You may also want to refer to the ASP.NET and ATL Server debugging topic in the online documentation.
I have even put the Handler under System.webServer as well in the web.config file, see below code
<system.web>
<httpHandlers>
<add verb="*" path="http-bind/*"
type="HelloWorldHandler"/>
</httpHandlers>
</system.web>
<system.webServer>
<handlers>
<add verb="*" path="http-bind/*" name="HelloWorldHandler" type="HelloWorldHandler"/>
</handlers>
<modules runAllManagedModulesForAllRequests="true" />
</system.webServer>
I don't know what restricts it over the cloud environment.
Please take a look at this question to see how to configure httpHandlers for running in Azure.
Most importantly - remove the httpHandlers section under the system.web and leave only handlers under system.webServer. Then add also the resourceType="Unspecified" attribute to the handler declaration. This should solve your issue.
I too had same problem.
I fixed it in following way .
The Problem was my machine is 32 bit and the azure server is 64 bit.
In Order to solve the problem i only changed Enable 32 bit option in
the advance setting of application pool. And the Original code worked
out fine.
i got this help from this Link

Combres.axd returns 404 in WebForms app

I have 2 ASP.NET apps, 1 WebForms and 1 MVC. Combres worked beautifully for both while working locally on IIS Express. After deploying both apps to the test server (IIS 7, both apps are in the same web site in IIS) the combres.axd link referenced in the pages of the WebForms app is returning a 404, while the MVC app works fine.
I hooked up the the WebForms app to my local IIS as well and it again worked fine.
I looked at the modules and handlers between my local IIS, the MVC app and the WebForms app and the routing registrations appear to be the same.
If I set defaultDebugEnabled="true" then it generates a script tag for each script in the resource set and works fine.
Any ideas how to debug the 404 from combres.axd?
Tracked it down to the modules config in web.config:
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
I am working with a legacy WebForms app that was created around .NET 3.0/3.5, so I did not have the runAllManagedModulesForAllRequests attribute set. I see in the latest Visual Studio 2010 ASP.NET WebForms template, this is now the default.
I also found a post that suggests a less brute force method to get the UrlRoutingModule to catch the combres.axd route.
<system.webServer>
<modules>
<remove name="UrlRoutingModule-4.0" />
<add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" />
</modules>
</system.webServer>
One of the comments mentioned this update, I haven't tested it yet though:
http://support.microsoft.com/kb/980368

Error: The WebResource.axd handler must be registered in the configuration to process this request

I have created a simple application with 1 textbox, 1 button and a validator control. When I deploy it to the Windows server 2008, I get the following error.
The WebResource.axd handler must be registered in the configuration to process this request.
I have added the following handler but it still gives the same exception. If I remove the validator control, then it works fine.
<system.webServer>
<handlers>
<add name="Foo" path="WebResource.axd" verb="GET"
type="System.Web.Handlers.AssemblyResourceLoader" />
</handlers>
</system.webServer>
I have searched online but haven't found any solution. has anyone been able to resolve this issue.
thanks
I had this problem and that reason was incompatibility between Coldfusion and some configurations of ASP.NET applications when IIS App pool is in integrated mode. Coldfusion must be disable .

Resources