简体   繁体   English

IIS 7.5上的调试与发布模式

[英]Debug vs Release mode on IIS 7.5

I have an ASP.NET application that uses Austin Harris JSON RPC library to expose an RPC server. 我有一个使用Austin Harris JSON RPC库公开RPC服务器的ASP.NET应用程序。 The service works great when I use it in : 1) Debug build running on ASP.NET web server 2) Debug build running on IIS 3) Release build running on ASP.NET web server 在以下情况下使用该服务时,该服务效果很好:1)在ASP.NET Web服务器上运行的调试版本2)在IIS中运行的调试版本3)在ASP.NET Web服务器上运行的发布版本

However, the configuration that matters - release build running on IIS - does not work. 但是,重要的配置-在IIS上运行的发行版-不起作用。 The same code base throws "method not found" error over RPC simply by changing the build type and the host server. 只需更改构建类型和主机服务器,相同的代码库就会通过RPC引发“未找到方法”错误。

I have verified that the build and release configurations under all the projects in my solution match up and yet have turned up with nothing. 我已经验证了解决方案中所有项目下的构建和发布配置都匹配,但没有发现任何问题。

Has anyone seen this before? 谁看过这个吗? Any pointers? 有指针吗?

Thanks Rishi 谢谢Rishi

The problem was because I was declaring the service statically, outside of the Application_Start. 问题是因为我在Application_Start之外静态声明了服务。 For some reason (I guess this is part of Microsoft's optimization technique) the service was never instantiated because none of my code references it. 由于某种原因(我想这是Microsoft优化技术的一部分),该服务从未实例化,因为我的代码均未引用该服务。 Declaring the service outside Application_Start and instantiating it in the Application_Start solved the problem. 在Application_Start外部声明服务并在Application_Start中实例化该服务解决了该问题。 Found a lead by going through: 通过以下方式找到了潜在客户:

https://jsonrpc2.codeplex.com/discussions/483852 https://jsonrpc2.codeplex.com/discussions/483852

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

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