.NET Framework Bookmark and Share   
 index > MSBuild > Visual Studio 2008 build error (MSB3073)
 

Visual Studio 2008 build error (MSB3073)

Hello,

I'm using a post build event to sign with a digital certificate the output of a C# class library project.

The command line (added through the property page of the project) is signtool.exe sign /f mycertificate.pfx /p mypassword /v"$(TargetPath)"

The project compiles without problem but the post build event execution raise a MSB3073 error which says:'signtool.exe' is not recognized as an internal or external command, operable program or batch file.

The file signtool.exe is placed in'C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin' and 'C:\Program Files\Microsoft Visual Studio 9.0\SDK\v3.5\Bin'.

So, I think there is something wrong with some environment variables in the VS2008.

Could somebody give any idea about how to fix this?

Thanks,

-Fred.

Fred G C
When a PostBuildEvent is executed it doesn't use the same path value as a Visual Studio Command Prompt does, therefor you have to specify the fullpath to the tool. You should be able to reference those environment variables from your PostBuildEvent though, so I'm not sure why you are having these problems. Can you paste your entire post build event.
For future I would suggest to stay away from pre/post build events see my artice Inside MSBuild in the Extending the Build Process section for more info how to avoid it.

Sayed Ibrahim Hashimi

sedodream.com
Sayed Ibrahim Hashimi
are either of those paths in your PATH environment variable?
Mike Fourie

Should those paths be in the environmet variable PATH?

I mean, when I open the VS2008 command prompt I can use without problem all the tools in the SDK. I can execute signtool.exe and other VS tools from this command prompt. So I guess I would be able of using all the tools I can use from the VS2008 command prompt in a post build event, Am I wrong?

On the other hand, signtool executes successfully in a post build event of a VC++ project of the same solution than the C# project. I don't get what is the problem with the build of the C# project.

I have found that the VC++ project uses two environment variables: $(WindowsSdkDir) points to 'C:\Program Files\Microsoft SDKs\Windows\v6.0A' and $(FrameworkSdkDir) points to'C:\Program Files\Microsoft Visual Studio 9.0\SDK\v3.5\Bin' to resolve some paths. Then I have changed the post build event to$(WindowsSdkDir)\bin\signtool but the environment variable is not defined.

Now, the problem is simplified to make available the environment variable to the Build process of C# projects. Any Ideas?

As a temporal solution I am using an absolute path to specify the location of signtool in the post build event. Set it in the PATH could solve the problem but I haveinstalled VS2005 and VS2003 and don't want to add something specific to VS2008 available to the others version.

-Fred

Fred G C
When a PostBuildEvent is executed it doesn't use the same path value as a Visual Studio Command Prompt does, therefor you have to specify the fullpath to the tool. You should be able to reference those environment variables from your PostBuildEvent though, so I'm not sure why you are having these problems. Can you paste your entire post build event.
For future I would suggest to stay away from pre/post build events see my artice Inside MSBuild in the Extending the Build Process section for more info how to avoid it.

Sayed Ibrahim Hashimi

sedodream.com
Sayed Ibrahim Hashimi

Hi Sayed Ibrahim Hashimi,

I need help below! Please, can you help me?

"c:\Builds\ZKInternet\ZKCivil\BuildType\TFSBuild.proj" (EndToEndIteration target) (1) ->
(AfterCompile target) ->
c:\Builds\ZKInternet\ZKCivil\BuildType\TFSBuild.proj(287,5): error MSB3073: The command ""C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv" "c:\Builds\Application\Web\Sources\Application/Source/Deployment/web_Installer/web_Installer.vdproj" /REBuild" exited with code 1.

846 Warning(s)
1 Error(s)



Thanks! // S....

simgau
I'm having the same error code problem. My solution is a migrated one from VS2005TS. I'm using v3.5 of MSBuild and it appears that using /m switch it happens to throw me that error code because of the PostBuildEvents executing simple-2-lines "copy commands" or even simple-2-lines "batch fle". I "solve it" putting an "exit 0" at the end of the batch file, but I really don't like the whole idea, but I don't have much more time to figure out these kind of things anymore, almost 1.5 days fighting against this apparently buggy feature of MSBuild v3.5 and VS2008 (not happing with previous MSBuild version and VS2005) - Anyone have coped with that already in a at least no that uggly way I've described ? Thnks - Cyas!
gonzalo.vinas
I had the VS Project directory variable set to an UNC path (from my Windows profile set to share on a file server during installation of VS). When I changed the variable to point tothe local directory which I actually use as solution/project basedirectory, everything works.

/lp
  • Edited bya3lp33l Tuesday, September 15, 2009 3:44 PMI can't spell...
  •  
a3lp33l
I'm having the same error code problem. My solution is a migrated one from VS2005TS. I'm using v3.5 of MSBuild and it appears that using /m switch it happens to throw me that error code because of the PostBuildEvents executing simple-2-lines "copy commands" or even simple-2-lines "batch fle". I "solve it" putting an "exit 0" at the end of the batch file, but I really don't like the whole idea, but I don't have much more time to figure out these kind of things anymore, almost 1.5 days fighting against this apparently buggy feature of MSBuild v3.5 and VS2008 (not happing with previous MSBuild version and VS2005) - Anyone have coped with that already in a at least no that uggly way I've described ? Thnks - Cyas!

Yep. Almost 1.5 days I remember... also I remember being way tired.... now that I read the whole post I see those miss-typos... :D
gonzalo.vinas

You can use google to search for other answers

Custom Search

More Threads

• MSBuild + ProjectReference + tmp_xxx files?
• Reference assembly
• Build is being skipped
• parameterize/reuse of targets?
• Custom Task for Team Build
• Console output text color / colour
• vs building with pdb from diff location then own bin
• Determine location of common folders?
• Clickonce publishing issue using msbuild/NAnt
• MSB4018 Out of Memory Exception