How do I get the ClickOnce Publish version to match the AssemblyInfo.cs File version?

We use Team Foundation Server Team Build and have added a block to the TFSBuild.proj’s AfterCompile target to trigger the ClickOnce publish with our preferred version number: <MSBuild Projects=”$(SolutionRoot)\MyProject\Myproject.csproj” Properties=”PublishDir=$(OutDir)\myProjectPublish\; ApplicationVersion=$(PublishApplicationVersion); Configuration=$(Configuration);Platform=$(Platform)” Targets=”Publish” /> The PublishApplicationVersion variable is generated by a custom MSBuild task to use the TFS Changeset number, but you could use your … Read more

Unable to install or run the application: Click Once

I found solution here: “Unable to install or run the application. The application requires that the assembly be installed in the Global Assembly Cache (GAC) first.” Excerpt from wordpress link: I recevied this error while compiling my first C# production application. I had to do the following in Visual Studio for the project: In Solution Explorer, … Read more

Clear the .NET-downloaded application cache without Mage?

Visual Studio isn’t needed, just Mage. It comes with the Windows SDK for people that haven’t gotten it via Visual Studio or the Framework SDK. Another option would be to write code to clear the cache. Or you could have them delete the folder ClickOnce files are installed in (C:\Users\[username]\AppData\Local\Apps on my Windows 7 machine). That … Read more

How to synchronise the publish version to the assembly version in a .NET ClickOnce application?

sylvanaar’s last line looks like the way to go, in my experience; but with the caveat that it is only available to deployed versions of the application. For debugging purposes, you might want something like: static internal string GetVersion() { if (ApplicationDeployment.IsNetworkDeployed) { return ApplicationDeployment.CurrentDeployment.CurrentVersion.ToString(); } return “Debug”; }