WebResource.axd - works on one computer; gives 404 on another

不打扰是莪最后的温柔 提交于 2019-12-23 05:13:21

问题


Situation:

  1. We created an assembly with our own ASP.NET control.

  2. That control registers some resources (images, JavaScript files, etc);

  3. There is a web-application which uses our control.

  4. The control is loaded well and get access to internal resources. In result HTML code all calls to resources look like "/WebResource.axd?d=...". So far, so good.

  5. We have two computers: first - Win7 32 used for development, second Win7 64 - for testing.

The problem:

  • The assembly generated on Dev machine works well on it but give 404 error for all requests to WebResource.axd when running on Testing computer.
  • If we just copy the sources to Testing computer and build our assembly there - it works well on both computers.

We use .NET 4.0. All latest updates are installed on both computers. Web application which uses our control runs right from VS 2010 (under ASP.NET Development Server).

Any suggestion?


回答1:


We've found the problem. Our testing computer had wrong date/time set (10 days before the real date). So our assembly (built on development system) was considered by it as a "DLL from the future". And it seems ASP.NET can stand the assembly "from future" but it does not like "future" resources placed into that assembly. Once we corrected date setting on the testing system - everything started to work well. Hope this case will help somebody else.




回答2:


The assembly with your asp.net control may not be included in your web application deployment.

Look for the reference to your assembly in the web application, right click it and select properties. Look for the copy local box, and set it to true. recompile the application and redeploy it to the other machine.



来源:https://stackoverflow.com/questions/7178781/webresource-axd-works-on-one-computer-gives-404-on-another

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