“Store metadata ”CurrentBind“ is not valid” in debug of ClickOnce application

后端 未结 4 996
孤独总比滥情好
孤独总比滥情好 2021-02-19 08:52

When I try to access \"Application.CommonAppDataPath\" i get this error message:

System.Deployment: Store metadata \"CurrentBind\" is not valid

4条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-19 09:29

    ApplicationDeployment.IsNetworkDeployed (in the System.Deployment.Application namespace) is a boolean property that returns true if the application was launched with ClickOnce.

    if (ApplicationDeployment.IsNetworkDeployed)
    {
        //CommonAppPath code
    }
    

    What are you trying to do with CommonAppDataPath? Depending on what you're trying to accomplish, we could probably come up with something that will work no matter how the app is launched.

提交回复
热议问题