build commands - path navigation

B

Berryl Hesh

I have a folder of shared library binaries in one place for the primary
solution I am working on. I often make a quick & dirty separate solution
when I want to work through a particular new concept - I'm doing this now to
get a handle on NHibernate.

Another thing I need to get a handle on is build blood & guts. A recommended
practice for incorporating some sqlce dll's into a NHibernate project is to
use a post build event, with the a syntax being
copy $(ProjectDir)..\..\SharedLibs\sqlce*.dll $(ProjectDir)$(OutDir)

Because I want to use a different library folder, I used the command prompt
to verify that it's relative location was (3) levels up and then two levels
in, or
cd ..\..\..\Smack\Lib ( I can DIR all of the dll's from here)

so I changed the post build command line to
copy $(ProjectDir)..\..\..\Smack\Lib\sqlce*.dll $(ProjectDir)$(OutDir)

This got me the error below. Any one have any insights to what I'm doing
wrong? Are there any utilities that hellp verify command syntax?

Thanks,
Berryl

Error 2 The command "copy C:\Documents and Settings\BH\My Documents\Visual
Studio
2008\Projects\Learning\Lab\NHibernateDev\..\..\..\Smack\Lib\sqlce*.dll
C:\Documents and Settings\BH\My Documents\Visual Studio
2008\Projects\Learning\Lab\NHibernateDev\bin\Debug\" exited with code 1.
NHibernateDev
 
P

Pavel Minaev

I have a folder of shared library binaries in one place for the primary
solution I am working on. I often make a quick & dirty separate solution
when I want to work through a particular new concept - I'm doing this nowto
get a handle on NHibernate.

Another thing I need to get a handle on is build blood & guts. A recommended
practice for incorporating some sqlce dll's into a NHibernate project is to
use a post build event, with the a syntax being
copy $(ProjectDir)..\..\SharedLibs\sqlce*.dll $(ProjectDir)$(OutDir)

Because I want to use a different library folder, I used the command prompt
to verify that it's relative location was (3) levels up and then two levels
in, or
cd ..\..\..\Smack\Lib ( I can DIR all of the dll's from here)

so I changed the post build command line to
copy $(ProjectDir)..\..\..\Smack\Lib\sqlce*.dll $(ProjectDir)$(OutDir)

This got me the error below. Any one have any insights to what I'm doing
wrong? Are there any utilities that hellp verify command syntax?

Thanks,
Berryl

Error 2 The command "copy C:\Documents and Settings\BH\My Documents\Visual
Studio
2008\Projects\Learning\Lab\NHibernateDev\..\..\..\Smack\Lib\sqlce*.dll
C:\Documents and Settings\BH\My Documents\Visual Studio
2008\Projects\Learning\Lab\NHibernateDev\bin\Debug\" exited with code 1.
NHibernateDev

Looking at the command, the problem seems to be that your paths
contain spaces, and aren't quoted. Try this instead:

copy "$(ProjectDir)..\..\..\Smack\Lib\sqlce*.dll" "$(ProjectDir)$
(OutDir)"

By the way, in general, I try to avoid using VS post-build commands,
and instead using the appropriate MSBuild target - if you open your
project file in any text editor and scroll down to the end, you'll see
a commented-out section just for that. The main benefit is that you
can use MSBuild tasks there, which run in-process, and you don't have
to worry about things such as command-line escaping.
 
B

Berryl Hesh

Thx for the response, but that didn't get it done either. I just copied the
dll's manually for now.

Is MSBuild your tool of choice? Is it pretty much the same as NAnt?

Thx,
Berryl
 
P

Pavel Minaev

Thx for the response, but that didn't get it done either. I just copied the
dll's manually for now.

Is MSBuild your tool of choice? Is it pretty much the same as NAnt?

In what it does, but not quite in how it does it. But basic things are
the same, yes - tasks, dependencies, and so on.

You're actually using it anyway if you're using VS2005 or higher - all
C# and VB projects are actually MSBuild files, so even if you don't
have VS installed on the system, but only .NET SDK, you can still
build VS projects & solutions by running MSBuild directly. VS is also
smart enough to understand modified project files, and it won't try to
overwrite your customizations - this makes it possible to add very
powerful pre- and post-build processing while still using VS to build.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top