Import Project and OutputPath (csproj)

P

prose

I am having a problem getting Import Project to work in my csproj
file.

I have a number of C# projects and I'd like to have easy control over
the folder that they are built to. In other words, I want all the .exe
files to be put in the same folder after the build. Additionally, I
want the guy down the hall to be able to easily choose a different
folder for the .exe files.

I have done the following:

csproj_exe.targets contains:

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/
developer/msbuild/2003">

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|
AnyCPU' ">
<OutputPath>L:\exe_debug\</OutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' ==
'Release|AnyCPU' ">
<OutputPath>L:\exe\</OutputPath>
</PropertyGroup>
</Project>

Each project contains:

<Import Project="..\csproj_exe.targets" />

and I've removed the OutputPath item.

------------------------------
Here's the problem:

When I open the project and look at the properties, the correct value
is in the OutputPath.

When I compile, it gives me an error saying that I need to specify an
OutputPath.

If I put an OutputPath statement in with the value "testing", then it
puts the output in a folder called "testing", so it is clearing
ignoring the "Import Project" line.

How do I get this to work?
 

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