2010-11-03 118 views
5

在正與VS2010中「時拋出」開啓例外打破本地調試點擊一次應用程序的情況下,我遇到了以下錯誤:存儲元數據「CurrentBind」無效。錯誤

Deployment Exception: "Store metadata "CurrentBind" is not valid." 
    at System.Deployment.Application.ComponentStore.GetPropertyString(DefinitionAppId appId, String propName) 

當我執行下面的一行代碼:

if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed) 

此異常正在被.net代碼捕獲和處理,並且遇到此錯誤後應用程序不會崩潰。不幸的是,這個錯誤是由隨訪:

InvalidDeploymentException: "Application is not installed" 
     at System.Deployment.Application.ApplicationDeployment..ctor(String fullAppId) 

如果我繼續通過例外韋德,我得到另一個錯誤:

SynchronizationLockException: "Object synchronization method was called from an unsynchronized block of code" 
     at Microsoft.Practices.Unity.SynchronizedLifetimeManager.TryExit() 
@ ProvidedContainer.RegisterInstance(LoggerFacade); 

最後:

ConfigurationErrorsException: "This element is not currently associated with any context" 
    at System.Configuration.ConfigurationElement.get_EvaluationContext() 

在構造函數的

[System.Diagnostics.DebuggerStepThroughAttribute()] 
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] 
public partial class InfrastructureDataServiceClient : System.ServiceModel.ClientBase<Infrastructure.DataServices.IInfrastructureDataService>, Infrastructure.DataServices.IInfrastructureDataService 
    { 
     public InfrastructureDataServiceClient() { 
    } 
} 

這些錯誤全部由.net框架代碼處理,並且不會影響應用程序,但只要我有選擇打破異常「投擲」,我會繼續經歷這些錯誤,直到我失去耐心並選擇只在未處理的異常時纔打破,此時應用程序將完全加載。

這在過去發生在我身上,當時我不得不徹底重新安裝visual studio,但是之後它運行良好。我寧願不這樣做,因爲它很費時間,我的VS安裝非常自定義。此外,我的同事也沒有遇到同樣的錯誤,所以這告訴我有關於我的環境的獨特之處。

我最近在調試時遇到了視覺工作室掛起,並且不得不殺死devenv進程,這可能會起到一定作用,但很難說,因爲我最近打開了拋出選項的中斷。我已經嘗試刪除suo文件,但沒有任何效果。

我已經安裝了以下插件: ReSharper的,.net反射,團隊資源管理器,TFS電動工具,主題管理器

回答

1

我解決這個問題的方法是重新安裝visual studio。這樣做之後,例外就消失了。

+3

這是錯誤的。這是一個簡單的調試選項,您需要取消選中。請參閱http://stackoverflow.com/questions/1914531/store-metadata-currentbind-is-not-valid-in-debug-of-clickonce-application – 2012-05-06 23:13:02

3

看起來像其他很多人已經解決了這個問題,只是通過禁用打破這個例外 - 例如參見here,here,herehere。但是,似乎沒有人知道使用這種例外的是什麼。

我應該補充一點,我不得不手動添加異常到我的調試/例外列表 - 它沒有默認出現。

+0

我做了什麼來解決這個問題是重新安裝Visual Studio。這樣做之後,例外就消失了。 – 2011-08-29 14:20:45

0

在我的情況下,我只是在Visual Studio 2010菜單中的工具/導入和導出設置中重置當前設置。我希望這個對你有用!

相關問題