asp.net ashx request 404

一笑奈何 提交于 2019-12-05 10:45:02

In my case I had the ashx file marked as a None content type instead of as Content, i.e. the Properties -> Build Action for it should have been Content, which mean that the ashx file wasn't included when Publishing the site.

If you're using Generic Handlers in ASP.NET, there are a few things to check on.

1.) Make sure you have set the "32 bit application" flag in your application pool to 32 bit if it really is 32 bit. The default is "False".

2.) Turn the application pool from Integrated to Classic

3.) Change the .NET version in your application pool appropriately. In your case, use v2, since 3.5 uses version 2. .NET 4.0 uses .NET 4.0.

4.) Make sure ASP.NET is registered. Run everything in the code blocks.

C:\>cd C:\Windows\Microsoft.NET\Framework64\{version} C:\Windows\Microsoft.NET\Framework64{version}>aspnet_regiis.exe -i

5.) Choose the "ISAPI & CGI Restrictions" after right clicking the server name (not the site name) in IIS Manager, and right click the correct "ASP.NET {version}" line and chose "Allow".

6.) Make sure you have your Handler Mappings (for *.ashx) turned on (aka "Enabled") at the server level, or site level or explicitly in the web.config.

I think the problem is in the url. ~/ means your root directory .

 Use ResolveClientUrl("yourPathHere") or  ResolveUrl("yourPathHere").

To get details about this error check the image's source and copy and paste it in the address bar. A yellow page consisting of the details will popup.

I think the only problem is the url.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!