简体   繁体   English

IIS express提供一个.asmx服务,但总是在另一个上返回404

[英]IIS express serves one .asmx service, but always returns 404 on another

I upgraded an old solution to Visual Studio 2015, and ran into trouble with one of the .asmx web services. 我将旧的解决方案升级到Visual Studio 2015,并遇到了一个.asmx Web服务的问题。 I have a number of them in this solution, and IIS express loads and runs them all correctly, except one. 我在这个解决方案中有很多它们,IIS表示加载并正确运行它们,除了一个。 This one service always returns a 404 if I try to load the .asmx URL in IIS express. 如果我尝试在IIS express中加载.asmx URL,则此服务始终返回404。 It runs correctly in full-blown IIS. 它在完整的IIS中正确运行。

None of the problems I've found online solve my situation. 我在网上发现的问题都没有解决我的情况。 Here are the details: 以下是详细信息:

  1. The web.config files of the working and non-working web services are identical. 工作和非工作Web服务的web.config文件是相同的。
  2. The IIS express/.csproj configuration is identical, except for the port and project names, and a few different assembly references. 除了端口和项目名称以及一些不同的程序集引用之外,IIS express / .csproj配置是相同的。
  3. The projects are virtually identical as well, with only a single .asmx service file with a code behind .asmx.cs and .asmx.resx files. 这些项目几乎完全相同,只有一个.asmx服务文件,后面有.asmx.cs和.asmx.resx文件。
  4. The C:\\Users[my username]\\IIS Express\\config\\applicationhost.config doesn't list any of the working or non-working services, so that can't be the difference. C:\\ Users [我的用户名] \\ IIS Express \\ config \\ applicationhost.config没有列出任何工作或非工作服务,因此不能区别。
  5. Examining the complete trace from C:\\Users[my username]\\IIS Express\\TraceLogFiles[service]\\fr000040.xml for a request on working and non-working services, they are virtually identical right up to step 109, AspNetMapHandlerEnter. 检查来自C:\\ Users [我的用户名] \\ IIS Express \\ TraceLogFiles [service] \\ fr000040.xml的完整跟踪,以获取有关工作和非工作服务的请求,它们几乎完全相同,直到步骤109,AspNetMapHandlerEnter。 The working service goes right to AspNetMapHandlerLeave at step 110, where the non-working service sets a few cache headers and then at step 112 sets the status code to 404 with a "warning" label on it. 工作服务在步骤110直接进入AspNetMapHandlerLeave,其中非工作服务设置一些高速缓存头,然后在步骤112将状态代码设置为404,其上带有“警告”标签。

I'm not sure what's going on here or what I can do next, so any suggestions would be much appreciated. 我不确定这里发生了什么或接下来我能做什么,所以任何建议都会非常感激。

I solved it by basically creating a new project and importing all the old files. 我通过基本上创建一个新项目并导入所有旧文件来解决它。 IIS express must have cached something somewhere when the project was invalid, and by recreating the assembly information it forced a refresh. 当项目无效时,IIS express必须在某处缓存某些内容,并通过重新创建程序集信息来强制刷新。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM