سؤال

I'm trying to set up a third party library's signing tool as an external tool. The arguments are supposed to be as follows:

sign.exe "c:\projectdir\bin\debug\exename.exe" "c:\projectdir\bin\debug\exename.lic"

I have the arguments configured like this:

$(TargetPath) $(TargetDir)$(TargetName).lic

It works, but it points to \obj\debug instead of \bin\debug. Is there a way to either copy the resulting file to the \bin\debug folder or have file generated copied from \obj\debug to bin\debug? I've looked at the documentation here, but I don't see any way to do it.

هل كانت مفيدة؟

المحلول

I figured it out by opening the dialog window and playing with the parameters. The following achieves what I want. Interestingly, Visual Studio 2010 is smart about putting in the slashes/periods when necessary to make a sane path. Impressive!

$(BinDir)$(TargetName)$(TargetExt) $(BinDir)$(TargetName).lic

Incidentally, the dialog window is WAY too small and non-sizable. A quick Google search turned up this tool from this Superuser question. VERY handy for this particular issue...

نصائح أخرى

On my copy of Visual Studio 2010, the $(BinDir) macro mapped to the Visual Studio binary directory, so the solution above didn't work for me.

Unfortunately the Macros available for use by the External Tools dialog are somewhat lacking. There appears to be nothing to directly reference the Output path.

The only way I could achieve this was by hardcoding the "Output path" portion as follows:

$(ProjectDir)\bin\Debug\$(TargetName)$(TargetExt)

I hate hardcoding "bin\Debug", but other useful macros like $(ConfigurationName) didn't seam to work inside the external tools settings. The only macros that seamed to work are the limited set documented in the Help window for the External Tools dialog.

So that worked for me. I hope someone can prove me wrong and find a way to access this directory without hardcoding part of the directory name.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top