问题
In the context of a click-once application that is being debugged locally with exception breaking on "Thrown" turned on in VS2010, I am experiencing the following error:
Deployment Exception: "Store metadata "CurrentBind" is not valid."
at System.Deployment.Application.ComponentStore.GetPropertyString(DefinitionAppId appId, String propName)
when I execute the following line of code:
if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
This exception is being caught and handled by .net code, and the application will not crash after experiencing this error. Unfortunately, this error is followed up by:
InvalidDeploymentException: "Application is not installed"
at System.Deployment.Application.ApplicationDeployment..ctor(String fullAppId)
If I continue to wade through the exceptions, I get another error:
SynchronizationLockException: "Object synchronization method was called from an unsynchronized block of code"
at Microsoft.Practices.Unity.SynchronizedLifetimeManager.TryExit()
@ ProvidedContainer.RegisterInstance(LoggerFacade);
and finally:
ConfigurationErrorsException: "This element is not currently associated with any context"
at System.Configuration.ConfigurationElement.get_EvaluationContext()
in the constructor of
[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() {
}
}
These errors are all handled by the .net framework code and don't ripple into the application, but as long as I have the option to break on exception "Thrown" I continue to go through these errors until I lose patience and choose to break only on unhandled exceptions, at which point the app fully loads.
This has happened to me in the past, and at that time I had to completely re-install visual studio, but it worked fine after that. I'd rather not do that, as it is time consuming and my VS installation is pretty customized. Also, my co-workers are not experiencing the same error, so that tells me that there is something unique about my environment.
I experienced a visual studio hang recently when debugging, and had to kill the devenv process, that might play a role, but it's hard to say because I recently turned on the break on thrown option. I've already tried to delete the suo files, but that had no effect.
I have the following addons installed: Resharper, .Net Reflector, Team Explorer, TFS Power Tools, Theme Manager
回答1:
Looks like a lot of other people have solved this problem just by disabling breaking on this exception - see here, here, here and here, for example. Nobody seems to have any idea what use this exception is, though.
I should add that I had to add the exception manually to my Debug/Exceptions list - it didn't appear by default.
回答2:
What I did to resolve this issue was reinstall visual studio. After doing that, the exceptions went away.
回答3:
In my case I just reset current settings in Tools/Import and Export Settings in Visual Studio 2010 menu. I hope it works for you!
来源:https://stackoverflow.com/questions/4092645/store-metadata-currentbind-is-not-valid-error