问题
Situation:
We created an assembly with our own ASP.NET control.
That control registers some resources (images, JavaScript files, etc);
There is a web-application which uses our control.
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.
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