首页 > Windows开发 > 详细

Visual Studio 2010發行Windows Form應用程式後,出現【System.ArgumentNullException 未處理】的解決方式

时间:2014-01-28 20:29:54      阅读:1238      评论:0      收藏:0      [点我收藏+]

使用Visual Studio 2010發行Windows Form應用程式後,部分專案可以通過建置但無法執行並出現以下的錯誤訊息。

bubuko.com,布布扣
System.ArgumentNullException 未處理
  Message=值不能為 null。
參數名稱: activationContext
  Source=mscorlib
  ParamName=activationContext
  StackTrace:
       於 System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
       於 System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
       於 System.Activator.CreateInstance(ActivationContext activationContext)
       於 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
       於 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       於 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       於 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       於 System.Threading.ThreadHelper.ThreadStart()
  InnerException: 
bubuko.com,布布扣

原來發行後VS2010會自動將專案的安全性設定為【啟用ClickOnce安全性設定】(如下圖)。

bubuko.com,布布扣

只要取消【啟用ClickOnce安全性設定】即可恢復正常。

转自:http://www.dotblogs.com.tw/terrychuang/archive/2011/03/03/21647.aspx

参考资料:http://social.msdn.microsoft.com/forums/en-US/Vsexpressvcs/thread/a60f58c4-c285-4c14-899c-e4a21fc51afe/

Visual Studio 2010發行Windows Form應用程式後,出現【System.ArgumentNullException 未處理】的解決方式

原文:http://www.cnblogs.com/BeyondTime/p/3535583.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!