我最近在我的开发系统上安装了.NET 4.6,但我仍在使用Visual Studio 2013.自从安装.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)
{
}
}
发生了什么事?
答案 0 :(得分:4)
安装Visual Studio 2013 Update 5解决了这个问题。