繁体   English   中英

在StructureMap应用程序上使用ANTS探查器时,“操作可能会破坏运行时的稳定性”

[英]“Operation could destabilize the runtime” when using ANTS profiler on a StructureMap application

我们最近升级了web / mvc应用程序以使用StrucutreMap 3.0.4

现在,当尝试使用RedGate Ant的分析器在“行级别计时,所有带源的方法”或更高级别上分析应用程序时,我们收到以下错误

Operation could destabilize the runtime.

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.Security.VerificationException: Operation could destabilize the runtime.

Source Error: 


Line 174:
Line 175:                            Initialise(context);
Line 176:                            ObjectFactory.Initialize(x => {     x.AddRegistry<BWebsiteIoc>(); });
Line 177:                        }
Line 178:                    }

Source File: c:\_Development\NT\Platform\WebSite\Global.asax.cs    Line: 176 

Stack Trace: 


[VerificationException: Operation could destabilize the runtime.]
StructureMap.ObjectFactory.Initialize(Action`1 action) in c:\BuildAgent\work\996e173a8ceccdca\src\StructureMap\ObjectFactory.cs:42
   Nga.Platform.Website.FirstRequestInitialisation.Initialise(HttpContext context) in   c:\_Development\NT\Platform\WebSite\Global.asax.cs:176
   Nga.Platform.Website.MvcApplication.Application_BeginRequest(Object source, EventArgs e) in c:\_Development\NT\Platform\WebSite\Global.asax.cs:106
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +182
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +165

我已经尝试在web.config中按照http://documentation.red-gate.com/display/APP8/Operation+could+destabilize+the+runtime+error+profiling+ASP.NET添加到system.web

可能是一个老问题,但它仍然是谷歌搜索结果中的第一个问题,所以这里有。

我能够通过在分析之前删除structuremap的pdb文件来解决这个问题。

我能够通过将以下内容添加到类库的AssemblyInfo.cs来解决问题。

[assembly: System.Security.SecurityRules(System.Security.SecurityRuleSet.Level1)]

我在Redgate论坛讨论中找到了这个解决方案。

<assemblyName>StructureMap</assemblyName>%LOCALAPPDATA%\\Red Gate\\ANTS Performance Profiler 9\\LineLevelBlacklist.xml中。

暂无
暂无

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

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