[英]WCF unhandled exception occured during the excution of the current web request
I have a WCF service that is build in VS2008 When I publish the service and run it in IIS (32 bit applications are enabled in application pool) then fine, it works. 我有一个在VS2008中构建的WCF服务,当我发布该服务并在IIS中运行(在应用程序池中启用了32位应用程序)时,它可以正常工作。 But when I try debugging the application (platform targets of all the projects are Any CPU), I get the following error:
但是,当我尝试调试应用程序时(所有项目的平台目标都是Any CPU),出现以下错误:
Common Language Runtime detected an invalid program.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidProgramException: Common Language Runtime detected an invalid program.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[InvalidProgramException: Common Language Runtime detected an invalid program.]
System.ServiceModel.HostingManager..ctor() +0
System.ServiceModel.ServiceHostingEnvironment.EnsureInitialized() +463
System.ServiceModel.ServiceHostingEnvironment.OnEnsureInitialized(Object state) +185
System.ServiceModel.PartialTrustHelpers.PartialTrustInvoke(ContextCallback callback, Object state) +314
System.ServiceModel.ServiceHostingEnvironment.SafeEnsureInitialized() +209
System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) +295
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +344
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +557
What does that error mean?? 该错误是什么意思? any help is highly appreciated
任何帮助都受到高度赞赏
The platform your have for development is 32 bit and the platform on which you deploy is 64 bit
. 您要开发的平台是32位 ,部署的平台是
64 bit
。 Selecting the debug type AnyCPU assembly will JIT to 64 bit code when loaded into 64 bit
process and 32 bit
when loaded into a 32 bit
process. 当被加载到选择所述调试型AnyCPU组件将JIT到64位代码
64 bit
处理和32 bit
当被加载到32 bit
处理。 The published assembly / dependent assembly is most probably not compatible for 64 bit and need to be in 32 bit process. 发布的程序集/从属程序集很可能与64位不兼容,并且需要采用32位处理。
You can read more about choosing the target platform and its impact over here . 您可以在此处阅读有关选择目标平台及其影响的更多信息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.