This project has moved and is read-only. For the latest updates, please go here.

Exits with Code 1

Feb 28, 2014 at 5:13 PM
Great Idea!
I tried to run the NuGet package, and I see that it brings in the file and changes the post event build successfully. However, when I build the file, I get

Error 2 The command "PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& 'C:\Users\Joseph\Documents\Visual Studio 2012\Projects\Projects\Projects\PostBuildScripts\AutoUpdateProjectsMinimumRequiredClickOnceVersion.ps1' -ProjectFilePaths 'C:\Users\Joseph\Documents\Visual Studio 2012\Projects\Projects\Projects\Projects.vbproj'"" exited with code 1.

Any idea? I am using:
Windows 7 64 bit
VS 2012 Pro
VB File

I have tried to reload the project and VS.

Thank you!
Feb 28, 2014 at 5:42 PM
Open the Output window pane and set it to show output from the Build. This should give you more information about the problem and how to fix it. Typically it will throw an error if you haven't already set the project up to be a ClickOnce app. This setup is done in the Publish tab of the project's Properties window. Let me know if you need any more help.
Feb 28, 2014 at 6:21 PM
Thank you for your reply. This is a ClickOnce App, but I am not too familiar with these scripts. Here is the output Window:

Parameter attributes need to be a constant or a script block.
At C:\Users\Joseph\Documents\Visual Studio 2012\Projects\Projects\Project
s\PostBuildScripts\AutoUpdateProjectsMinimumRequiredClickOnceVersion.ps1:85 cha
  • [ValidatePattern("(.csproj|.vbproj)$" <<<< )]
    • CategoryInfo : ParserError: (:) [], ParseException
    • FullyQualifiedErrorId : ParameterAttributeArgumentNeedsToBeConstantOrScr
Feb 28, 2014 at 6:54 PM
I have gotten it to work:

in the clickonceVersion.ps1,
Line 85, [ValidatePattern("(.csproj|.vbproj)$")]

I changed the double quotes to single quotes, and seems to work fine now. Thank you very much for the script!!
Marked as answer by deadlydog on 2/28/2014 at 11:33 AM
Feb 28, 2014 at 7:33 PM
Strange that I've never seen that error before. Perhaps you have some different system configuration than me (e.g. older version of powershell installed, etc.). I'll fix that up and publish a new version. Thanks! :)
Feb 28, 2014 at 7:39 PM
This is now fixed in v1.0.7 of the NuGet package. Thanks again!