gpt4 book ai didi

C# ASP.NET "InvalidProgramException: Common Language Runtime detected an invalid program"

转载 作者:太空宇宙 更新时间:2023-11-03 15:43:19 32 4
gpt4 key购买 nike

我在尝试使用 .NET 4.5 并针对“任何 CPU”“开始调试”ASP.NET MVC Web 应用程序时遇到上述异常。我发现的关于这个问题的所有其他问题似乎都确切地知道应用程序中的什么地方导致了问题,但是堆栈跟踪对我来说没有任何意义,因为它没有提到我自己编写的任何代码(见下文: )

[InvalidProgramException: Common Language Runtime detected an invalid program.]
System.Windows.Markup.XmlnsPrefixAttribute..ctor(String xmlNamespace, String prefix) +0
System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs) +0
System.Reflection.CustomAttribute.CreateCaObject(RuntimeModule module, IRuntimeMethodInfo ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs) +38
System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent) +589
System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType) +103
System.Reflection.RuntimeAssembly.GetCustomAttributes(Boolean inherit) +33
Owin.Loader.DefaultLoader.SearchForStartupAttribute(String friendlyName, IList`1 errors, Boolean& conflict) +294
Owin.Loader.DefaultLoader.GetDefaultConfiguration(String friendlyName, IList`1 errors) +105
Owin.Loader.DefaultLoader.LoadImplementation(String startupName, IList`1 errorDetails) +161
Owin.Loader.DefaultLoader.Load(String startupName, IList`1 errorDetails) +51
Microsoft.Owin.Host.SystemWeb.OwinBuilder.GetAppStartup() +238
Microsoft.Owin.Host.SystemWeb.OwinHttpModule.InitializeBlueprint() +103
System.Threading.LazyInitializer.EnsureInitializedCore(T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory) +86
System.Threading.LazyInitializer.EnsureInitialized(T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory) +72
Microsoft.Owin.Host.SystemWeb.OwinHttpModule.Init(HttpApplication context) +104
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +418
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +336
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296

[HttpException (0x80004005): Common Language Runtime detected an invalid program.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9930568
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254

谁能告诉我如何找出抛出异常的位置和时间?它在抛出之前甚至没有加载主页,也没有进入 startup.cs 文件的代码,所以我没有太多要继续的内容。

我是 ASP.NET MVC 开发的新手,所以调试以前没有遇到过的异常非常困难,我非常感谢任何帮助!

更新:我正在尝试在 Windows 8.1 Professional 64 位计算机上使用 IIS Express 在 Firefox 中运行在 Visual Studio 2013 中制作的 Web 应用程序,与一周前用于同一 Web 应用程序的配置相同。从那时起,我对 MVC 模型和 Controller 进行了更改,但没有更改任何会影响其部署/调试到这种程度的内容。我只需要知道如何获取有关抛出异常的位置的更多信息。

最佳答案

有一个article on Microsoft site :

主要原因是您试图在基于Windows XP 的环境 上运行程序。

Error code 0x80004005

This problem may occur if a file that the Windows Product Activation
(WPA)
requires is damaged or missing. This behavior occurs if one or both of the following conditions are true: - A third-party backup utility or an antivirus program interferes with the installation of Windows XP. - A file that WPA requires is manually modified.

关于C# ASP.NET "InvalidProgramException: Common Language Runtime detected an invalid program",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29319293/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com