Kinook Software Forums ClickOnce publish version.
 Register FAQ Social Groups Calendar Search Today's Posts Mark Forums Read

#1
12-14-2006, 12:58 AM
 CMoore Registered User Join Date: 12-13-2006 Posts: 8
ClickOnce publish version.

When I try to publish a ClickOnce application using VBP, it always publishes it as V1.0.0.0 and doesn't increment the version like VS2005 does. In the properties for the project I am publishing, I have the increment version checkbox checked in Visual Studio.

How can I get this version to increment in VBP?

Thanks.
#2
12-14-2006, 12:35 PM
According to http://msdn2.microsoft.com/en-us/lib...31(VS.80).aspx (ApplicationRevision property section) "it is not automatically incremented for builds performed at the command-line." It appears that the application revision value is stored in the project's .csproj.user file. A Run Script step with VBScript code like this could be used to increment it:

Code:
' load the .csproj.user file
Set msxml = CreateObject("MSXML.DOMDocument")
msxml.async = False

' retrieve the current revision and increment
Set node = msxml.selectSingleNode("/Project/PropertyGroup/ApplicationRevision")
node.Text = node.Text + 1

' save the changes
msxml.save "%CSPROJ_USER_FILE%"
Also, contrary to the documentation on the page, it seems that building from the command-line will not actually publish the project (it does not use the publish dir configured in project properties in the IDE). This can be resolved by passing

"/p:PublishDir=drive:\path\to\base_publish_dir\\"

in the additional values field on the Options tab of the Make VS.NET action.
#3
12-19-2006, 10:38 PM
 CMoore Registered User Join Date: 12-13-2006 Posts: 8
Thanks for that, it pointed me in the right direction and the hint about the publish_dir was helpful too.
#4
01-03-2007, 03:33 AM
 dchrno Registered User Join Date: 11-04-2003 Posts: 1
I ended up using msbuild to publish my ClickOnce projects:

%msbuild% project.csproj /t:clean,publish /p:Configuration="Release" /p:ApplicationRevision=%REVISION% /p:ApplicationVersion=%VERSION%.* /p:PublishDir=%publishrootdir%\Release

Start folder is set to the folder the csproj file resides in.
#5
06-04-2007, 10:08 AM
 VBuild_Rookie Registered User Join Date: 05-07-2004 Posts: 23
I'm new to clickonce....but is there away to have one compile step in VBP that would publish the entire solution. Our vs2005 solution has many projects and they may or may not change within build releases. So I would like to understand what and how I can just publish the entire solution to clickonce. Is this possible or do I have to publish each individual project file seperatly so if I have 10 Ihave 10 steps in VBP that uses msbuild or something else to publish the assembly?
#6
06-04-2007, 03:59 PM
If all projects can be published to the same base folder, you can use a single Make VS.NET step to do that, as shown here: http://www.kinook.com/Forum/showthre...?threadid=1401
#7
06-07-2007, 02:14 PM
 VBuild_Rookie Registered User Join Date: 05-07-2004 Posts: 23
Ok I'm using hte make VS.Net action.

I get this error
MSBUILD : error MSB1008: Only one project can be specified.

My solution file has spaces in the path
like

this is the actual path
C:\All Projects\Abc company\Enterprise\Version 2.0\Setup\CRM 2.0\Source

%LOCAL_SOURCE_SETUP_DEPLOYMENT%\Source\ABC CRM Inc - Version 2.0 - ABC - CRM.sln

I'm thinking the spaces are making MSBuild puke I tried to pass it as

"%LOCAL_SOURCE_SETUP_DEPLOYMENT%\Source\ABC CRM Inc - Version 2.0 - ABC - CRM.sln"

but that didn't work...any ideas?
#8
06-07-2007, 02:39 PM
The Make VS.NET action does quote the .sln filename if it contains spaces. Most likely, you're not properly quoting an argument specified in the Additional options field (i.e., /p:ProductName=Product Name rather than /p:ProductName="Product Name").
#9
06-07-2007, 03:56 PM
 VBuild_Rookie Registered User Join Date: 05-07-2004 Posts: 23
ok I got passed that error now I get this

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Micr osoft.Common.targets(3150,9): error : A signing key is required in order to publish this project. Publishing from Visual Studio 2005 will automatically configure a signing key for this project.

any clues?

I found this on the website
http://connect.microsoft.com/VisualS...dbackID=110131
#10
06-07-2007, 04:03 PM
You need to publish each project once from the IDE, then check the updated project and .pfx file into source control.
#11
06-07-2007, 04:17 PM
 VBuild_Rookie Registered User Join Date: 05-07-2004 Posts: 23
Ok I have publish from IDE for this project before. I'm only publishing one project which is my project and has references to other projects within the solution. I have selected ton include all the files under the application files button in the wizzard.

I will try to publish from the IDE again then I will check in the project file along with the pfx file. I check my file directory and I only have one pfx and its on teh project root directory that I published.

When I run VBP I delete all files from my build pc and get everything from source safe. The project .user files I copy from a source control as well. The project file has all the publish wizzard settings but I override some with the Make VS.Net options tab.

any suggestions why it would not work ..I get the error above even though I have published the project once from the IDE. ummm..I will try again ....but you have any clue why it would not work?
#12
06-07-2007, 04:43 PM
 VBuild_Rookie Registered User Join Date: 05-07-2004 Posts: 23
OK I had the IDE opened and I rebuild all and then publish the one project it went fine from the IDE..

I had the VBP open while I will publish from the IDE. I try to run the one action Make VS.Net and it puke still and this was right after I just did it from the IDE. I just changed the revision number to increment it by one.

here is the same error
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Micr osoft.Common.targets(3150,9): error : A signing key is required in order to publish this project. Publishing from Visual Studio 2005 will automatically configure a signing key for this project.

this is from the IDE when I was done publishing it.....

Verifying Control.dll.deploy... (46 of 46)
Publish success.

any clue what could be wrong? I mean I had that pfx file in the same location while IDE didi the publising. I even kept the IDE open when I ran the VBP action.
#13
06-07-2007, 04:59 PM
Perhaps the IDE needs to be closed before all changes get saved? I extracted ClickOnce.zip from http://www.kinook.com/Forum/showthre...?threadid=1401 to a folder containing spaces and ClickOnce.bld built and published the solution (both projects) successfully.
#14
06-08-2007, 08:56 AM
 VBuild_Rookie Registered User Join Date: 05-07-2004 Posts: 23
I don't think is the solution path with spaces that is giving me issues. It has to do something that the IDE is doing for the signing of the manifest that MSBuild isn't doing. I'm assuming that Make VS.Net action uses MSBuild to build/publish the project.

I mean the IDE from my build PC publishes the project just fine. But if I try to do it just using Make VS.net action it pukes.

I just publish from the cmd line using

msbuild /targetublish

but I noticed that this created a local file under my project root path. I want to publish to a server. Also it build the debug configuration not the Release. I thought doing msbuild would take the setting from the project file?

Last edited by VBuild_Rookie; 06-08-2007 at 09:11 AM.
#15
06-08-2007, 09:13 AM