编程语言
首页 > 编程语言> > c#-AccessViolationException在带有VS2013和.NET 4.6的空程序中的第一行代码之前

c#-AccessViolationException在带有VS2013和.NET 4.6的空程序中的第一行代码之前

作者:互联网

我最近在开发系统上安装了.NET 4.6,但是我仍在使用Visual Studio2013.自从安装.NET 4.6之后,每当尝试通过调试启动程序时,我都会收到AccessViolationException:

at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

即使该程序针对.NET 4.5,甚至对于完全琐碎的程序,也会发生这种情况.在调试或发行版本中启动没有附加调试器的程序时,不会发生这种情况.

失败的程序示例:

class Program
{
    static void Main(string[] args)
    {
    }
}

这是怎么回事?

解决方法:

安装Visual Studio 2013 Update 5可解决此问题.

标签:access-violation,net-4-6,visual-studio-2013,c
来源: https://codeday.me/bug/20191028/1949574.html