2016-04-11 22 views
0

在編譯WinForm-Apps期間出現奇怪的問題。往往會出現訪問衝突異常,也有完全空的WinForm-Projekt的新創建:Visual Studio 2015 - 應用程序處於中斷模式 - 訪問衝突異常(在外部代碼中)

System.AccessViolationException was unhandled 
Message: An unhandled exception of type 'System.AccessViolationException' occurred in System.Windows.Forms.dll 
Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. 

它發生在這裏:

[Managed to Native Transition] 
EXCEPTION >>> System.Windows.Forms.dll!System.Windows.Forms.Control.SendMessage(int msg, int wparam, System.IntPtr lparam) + 0x44 bytes 
System.Windows.Forms.dll!System.Windows.Forms.Form.UpdateWindowIcon(bool redrawFrame) + 0x111 bytes 
System.Windows.Forms.dll!System.Windows.Forms.Form.CreateHandle() + 0x2f9 bytes 
System.Windows.Forms.dll!System.Windows.Forms.Control.Handle.get() + 0x65 bytes 
Microsoft.VisualStudio.HostingProcess.Utilities.dll!Microsoft.VisualStudio.HostingProcess.HostProc.RunParkingWindowThread() + 0xb6 bytes  
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) + 0x160 bytes 
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) + 0x17 bytes 
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x52 bytes  
mscorlib.dll!System.Threading.ThreadHelper.ThreadStart() + 0x52 bytes 
[Native to Managed Transition] 

運行新安裝的Win8.1 64位系統VS2015企業( v14.0.25123.00更新2)

也試過: - 改變幾個例外設置(啓用僅我的代碼,禁用JIT等)

沒有幫助到目前爲止。

任何人都可以幫助我嗎?處理這個問題幾乎是不可能的... :(

+0

編譯x86如果發生這種情況是正確的嗎?wpf項目遇到了這樣的問題..我可以在x86上編譯它們,但只要運行它,我就會遇到訪問衝突。 –

+0

編譯任何目標(任何CPU,X64,X86,...),也作爲管理員身份運行的VS;問題出現:( – SiL3NC3

+0

作爲管理員運行不是我的解決方案,因爲我有相同的問題。我發現的一種解決方法是在沒有調試器的情況下運行它(CTRL + F5),但是目前我需要調試器來開發噸。如果有人找到了調試器的解決方案,請在這篇文章中添加一個答案! – Kyle

回答

1

我有同樣的問題,我覺得我已經找到了解決方法 我試圖取消選中「啓用Visual Studio宿主進程」,並且它的工作原理