MonoDevelop: Failed to load http handler - asp.net

I am running MonoDevelop on OS X to develop an ASP.NET web application using Nancy. I downloaded the nancy.dll file and referenced it from my web project.
Inside the web.config I added the line:
<httpHandlers>
<add verb="*" type="Nancy.Hosting.Aspnet.NancyHttpRequestHandler" path="*" />
</httpHandlers>
to the system.web section, as described in the documentation of Nancy. However, if I try to run my application, my browser comes up and I see an ASP.NET error message created by Mono that tells me that it
Failed to load httpHandler type `Nancy.Hosting.Aspnet.NancyHttpRequestHandler'
Any idea of what I am doing wrong? Why is Mono not able to find the DLL, although it is there?

I got it ... I had missed to also download and install the Nancy.Hosting.Aspnet package.
Once I did this and referenced the dll, everything works fine :-)

Related

Simple ASP.NET Razor page on local IIS 8.5 - 500.19 0x8007000d error

I've built sample Razor webpage that works perfectly fine and I decided to deploy it on local IIS enabled on Windows 8.1. (IIS 8.5).
I used the publish feature through the file system that copied relevant files to Inetpub subfolder.
When I try to access the webpage I get this error:
The requested page cannot be accessed because the related configuration data for the page is invalid.
Error Code: 0x8007000d
Config Error:
Config File: (correct path)
The webconfig is suspiciously short but given simplicity of the page - perhaps long enough?
<?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=".\myapp.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</configuration>
I made pretty thorough search of similar issues here and other google-returned materials and overall nothing helped.
I'm pretty sure all relevant components that I could install for IIS I have installed already.
All configuration files are correctly formed.
The security is fine - I can play with webconfig content and get different error a bit which indicate IIS can access the config file.
The only thing that surprises me is that sometimes when I access various config icons on IIS for the page I get error like this:
i.e. for .NET Profile:
There was error while performing this operation.
Details: (nothing written here)
Filename: \?\C:\inetpub\wwwroot\mypagefolder\web.config
Error: (nothing written here)
Is my web.config missing some sections?
EDIT: I also dropped the published application on some other IIS server that is used for other applications and the result is the same which make me inclined to believe s.t. is either wrong with the application publish process or s.t. is very weird
Looking at your web.config, it is found that you are trying to deploying ASP.NET Core website. It requires
.NET Core Hosting Bundle installed on the hosting server
Application Pool .NET CLR version set to "No Managed Code"
Ensure that the Application Pool Identity user has read permissions on the published folder.
For details check:
https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-2.0
First thing I suggest is to check is the .NET CLR version of your application pool and also check the AppPool Identity has read permissions on the published folder
I had the same issue in Windows 2012 Server. Although I had the SDK 2.1 installed, it only worked when I installed Runtime & Hosting Bundle.
https://www.microsoft.com/net/download/dotnet-core/2.1
It's important to mention that, in order to see this option, I had to click on "Can't find the file you want? Find more in .NET Core 2.1 downloads.".
By default this page is not shown.

ASP.NET: HTTP Error 500.19 – Internal Server Error 0x8007000d

I am replicating web application deployment and found several issues related to HTTP Error 500.19. My machine is running Windows 7 while the working development is using Windows 8. We're developing our Web Application using Visual Studio 2010.
First, I got error code 0x80070021, similar as posted here.
I update my web.config according to the accepted answer and then I got following error code (which is similar as posted here).
HTTP Error 500.19 - Internal Server Error
Error Code 0x8007000d
Config Source -1: 0:
I have read the symptoms definition in Microsoft support page and cause of the error is:
This problem occurs because the ApplicationHost.config file or the Web.config file contains a malformed XML element.
and the solution is
Delete the malformed XML element from the ApplicationHost.config file or from the Web.config file.
However, the web.config that I used is working perfectly in the original development environment.
Here is what I have checked and tried so far:
Install ASP.NET by calling aspnet_regiis -i
Set my application to use different application pool (ASP.NET v4.0, .NET v4, etc)
ApplicationHost.config file is still using default from Windows 7.
This is part of my Web.Config
<system.webServer>
<section name="handlers" overrideModeDefault="Allow" />
<section name="modules" allowDefinition="MachineToApplication" overrideModeDefault="Allow" />
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true">
</modules>
<handlers>
<remove name="UrlRoutingHandler" />
<add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</handlers>
<urlCompression doStaticCompression="true" doDynamicCompression="false"></urlCompression>
<directoryBrowse enabled="true" />
<defaultDocument>
<files>
<add value="Logon.aspx" />
</files>
</defaultDocument>
</system.webServer>
I have read similar/duplicates/closed posts (around 13) posts in stackoverflow, tried all except the answer related to Ajax (is it related) and still have no clue on what the error is.
Does anyone one how to fix this error? (And if possible, a comprehensive lists of things need to be checked so we can reduce similar posts like this.) I am ready to provide more details.
Error 0x8007000d means URL rewriting module (referenced in web.config) is missing or proper version is not installed.
Just install URL rewriting module via web platform installer.
I recommend to check all dependencies from web.config and install them.
When trying to set up a .NET Core 1.0 website I got this error, and tried everything else I could find with no luck, including checking the web.config file, IIS_IUSRS permissions, IIS URL rewrite module, etc. In the end, I installed DotNetCore.1.0.0-WindowsHosting.exe from this page: https://www.microsoft.com/net/download and it started working right away.
Specific link to download: https://go.microsoft.com/fwlink/?LinkId=817246
Yes, for .net core apps, install dotnet hosting. This worked for me.
And here it is for .net6
And now if you need .net7
Install URL rewriting:
UPDATE - this is now available here (and works with IIS 7-10):
https://www.iis.net/downloads/microsoft/url-rewrite
Ensure you have the following set to 'Allowed' for your IIS server:
In my case, because I had reinstalled iis, I needed to register iis with dot net 4 using this command:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i
In my case (.Net Core Web API) for this issue HTTP Error 500.19 – Internal Server Error 0x8007000d
First download dotnet-hosting-3.0.0-preview5-19227-01-win (.Net Core 3) or dotnetcore 2 hasting windows
https://download.visualstudio.microsoft.com/download/pr/5bed16f2-fd1a-4027-bee3-3d6a1b5844cc/dd22ca2820fadb57fd5378e1763d27cd/dotnet-hosting-3.1.4-win.exe
Any .net core 3.1 application either angular or mvc application would need this.
Second install it as Administrator
Open cmd as administrator, type iisreset, press enter
So refresh your localhost app
Best regard
M.M.Tofighi from Iran
A repair of the DotNetCore hosting bundle did the trick for me. :/
Installing ASP.NET Core Runtime Hosting Bundle solved the issue for me. Source: 500.19 Internal Server Error (0x8007000d)
Kind of late to the party here, but I have just been struggling with the exact same issue (symptoms) and cursing the lack of error detail reporting.
It worked fine on IIS 8+ machines but Win 7 got these INSTANT HTTP 500.19 errors.
For me it was as silly as having an unsupported configuration element in the config file:
<applicationInitialization doAppInitAfterRestart="true">
<add initializationPage="/" />
</applicationInitialization>
So while running old web.config files worked fine, I just diffed them and started chopping away at new blocks until I got the page to start loading. Had I seen this as an answer I would have gone this route immediately as I knew none of the popular solutions were relevant. So there you go :)
I turn on .Net Framework 3.5 and 4.5 Advance Service in Control Panel->Programs and Features->Turn Windows features on or off.it work for me.
Problem solved. Here are the steps that I tried:
Enable the 32-bit application in IIS -> Application pool -> Advanced settings
Copy System.EnterpriseServices.dll and System.EnterpriseServices.Wrapper.dll from C:\Windows\Microsoft.NET\Framework\v2.0.50727 to the application bin folder
Do comments/uncomments to sections on the web.config and found that problem related to the referenced DLL.
The config that I commented the previous one that I added:
<section name="handlers" overrideModeDefault="Allow" />
<section name="modules" allowDefinition="MachineToApplication" overrideModeDefault="Allow"/>
Add the required FasterFlect.DLL used by Combres.DLL v2.1.0.0 to the application bin folder (shall download the full zip from Combres codeplex, because the required fasterflect DLL V2.0.3732.24338 cannot be found in fasterflect codeplex) and other DLLs. For convinience, use the full Combres.DLL (1,3MB)
Check that the DLL versions and public key tokens are configured correctly in web.config using tool, e.g. .NET Reflector
I understand that this error can occur because of many different reasons. In my case it was because I uninstalled WSUS service from Server Roles and the whole IIS went down. After doing a bit of research I found that uninstalling WSUS removes a few dlls which are used to do http compression. Since those dlls were missing and the IIS was still looking for them I did a reset using the following command in CMD:
appcmd set config -section:system.webServer/httpCompression /-[name='xpress']
Bingo! The problem is sorted now. Dont forget to run it as an administrator. You might also need to do "iisreset" as well. Just in case.
Hope it helps others.
Cheers
I had this problem with a brand new web service. Solved it by adding read-only access for Everyone on Properties->Security for the folder that the service was in.
I had the exact same error. It turned out that it was something was caused by something completely, though. It was missing write permissions in a cache folder. But IIS reported error 0x8007000d which is wildly confusing.
I have the same problem when I was trying to publish asp.net core 5.0 web app on my local IIS and the solution was to add the following inside System.webserver tag in my web.config file
<applicationInitialization doAppInitAfterRestart="true">
<add initializationPage="/" />
</applicationInitialization>
Reinstalling ASP.NET Core Runtime - Windows Hosting Bundle Installer made the trick for me... I belive the "ASP.NET Core Module" was missing.
For me I had a web.config file in one my root folders, this config file was for the live server so removing it allowed the site to run on the dev server.
So check for any web.config files in folders too.
In my case, i have installed dotnet hosting but error change to HTTP Error 503. The service is unavailable, but after install windows update KB2999226 and dotnet sdk, its work!
follow the procedure chronologically or it might fail due to missing or errors in redirecting.
install Runtime bundle e.g.. dotnet-sdk-7.0....
2.turn asp services on and internet services"Turn Windows features on or off" to enable IIS
3.install web hosting bundle iis 7.0 e.g dotnet-hosting-7.0.2...
this worked for me
For me, it was all about setting up my web server to use the latest-and-greatest tech to support my ASP.NET 5 application!
The following URL gave me all the tips I needed:
https://docs.asp.net/en/1.0.0-rc1/publishing/iis-with-msdeploy.html
Hope this helps :)

Troubleshooting Silverlight 5 and Ria services [Web-Services-AuthenticationService.svc does not exist]

I have two different versions of a Silverlight 5 project using Ria services. Both work locally. The older version (A) works when deployed to ISS7. The new version (B) does not. There is user/password authentication that fails for version B with the error:
Load operation failed for query 'Login'. the remote server returned an error: NotFound.
Referencing various SO and MSDN posts over the past week, I have tried many troubleshooting techniques. Adding error logging as suggested here to the web.config results in the following being logged:
The service '/ClientBin/MyApp-Web-Services-AuthenticationService.svc' does not exist.
Researching that led to finding this forum post which suggests creating a dummy .svc file with the name/path it is looking for. The result:
The service '/ClientBin/DBCRM-Web-Services-AuthenticationService.svc' cannot be activated due to an exception during compilation. The exception message is: The ending bracket '>' for the 'ServiceHost' directive is missing in the '.svc' file..
The details of the above error aren't largely important as it was a blank .svc file I supplied. It merely served to confirm that fact that the project was indeed dependent on it
Here's the kicker... the working version DOES NOT contain this file either, yet it does not throw an exception.
Searching for any reference to needing the service surprisingly turned up a result in both solutions. Both MyApp.Web.g.csfiles are identical (ran a CSDiff) and both contain the line:
public AuthenticationContext() :
this(new WebDomainClient<IAuthenticationServiceContract>(new Uri("DBCRM-Web-Services-AuthenticationService.svc", UriKind.Relative)))
{
}
Both have the same package/deploy settings. I am deploying to a file system, then copying the files over to IIS on my host server.
Questions:
Where is a setting that makes this .svc file a requirement? It's clearly not needed in version A, but is in version B. Again, file MyApp.Web.g.csis the only reference to it, and it exists in both versions.
MyApp.Web.g.cs is a generated file. What service in Visual Studio 2010 creates this file? Also, can I modify it to not include the call to the .svc file in question?
I'm going to start merging the two solutions together to see at which point the .svc file becomes neccessary. Any ideas in the meantime would be greatly appreciated!
WCF Ria Services registers an HttpModule in order to manage the wcf ria services calls. When the request arrive to the server that module read the url and understand which service to instantiate and which method to call. So it's absolutely normal that you don't find any .svc file
Don't mess with the .g.cs your problem isn't here.
Take a look at your web.config file, you should find rows like this
<system.web>
<httpModules>
<add name="DomainServiceModule" type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</httpModules>
...
</system.web>
and this
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<add name="DomainServiceModule" preCondition="managedHandler" type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</modules>
...
</system.webServer>
Besides making sure that the "DomainServiceModule" entries are present in Web.Config as stated above, another thing is that RIA requires ASP .NET compatibility mode to be enabled. Here is a link to Microsoft's deployment guide for RIA:
http://msdn.microsoft.com/en-us/library/ff426912(v=vs.91).aspx
In the third paragraph of the "Configure the Web Server" section, it states that you need the following in your Web.Config file:
<system.serviceModel>
...
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
...
</system.serviceModel>
When this is missing, you get the behavior described in your question.
Before you do any of this make sure the regular bin folder is actually deployed containing your actual code.
I was deploying with MSDEPLOY to a new server and it did not deploy bin folder. You're not going to get anywhere without that!

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

DLL Compilation Error (ASP.NET)

We have a webserver with two versions of the AjaxControlKit on it. Im getting the following error when hitting certain pages on a specific web application.
The type
'AjaxControlToolkit.CalendarExtender'
exists in both
'c:\Windows\assembly\GAC_MSIL\AjaxControlToolkit\3.0.30930.28736__28f01b0e84b6d53e\AjaxControlToolkit.dll'
and
'c:\Windows\assembly\GAC_MSIL\AjaxControlToolkit\3.0.30512.20315__28f01b0e84b6d53e\AjaxControlToolkit.dll'
The web project Im running has a reference to the x.30930 dll, and it also has
<add assembly="AjaxControlToolkit, Version=3.0.30930.28736, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"/>
Specified in the web.config.
For the life of me I cant find out why it wants to try running x.30512.
Any suggestions?
Aaargh there was a reference to it in the 'global' web.config (in the c:\windows\microsoft.net\ folder

Resources