Thanks for your reply, the method you suggested may work (I shall have to
try in the next few days). I am curious though about your project
configuration statement. I can not seem to figure out how to specify the
output type for a specific project configuration in VS 2005. How is
accomplished in VS 2005? The "Configuration" combo is disabled when I view
the project properties (at least on the Application tab). I agree that this
approach would be the ideal method, I just could figure out how to do it.
Thanks,
Matt
>>I have a need to generate both the DLL version of my application and an
>>EXE version. I would like to build both of them with a single call
[quoted text clipped - 30 lines]
>>
>> Matt
ME - 27 May 2006 21:13 GMT
I thought I would post the answer to my msbuild question. After taking Ben
Voigt's advice I came up with the following PostBuildEvent that I can now
include in every EXE project that I want to also be a DLL:
1) I specify the default project output as Windows Application in the
project properties.
2) I specify the following PostBuildEvent command excluding the brackets:
[C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\msbuild.exe /t:build
$(ProjectPath)
/p:outputtype=library;outputpath=$(OutDir)DLL;postbuildevent=]
3) I Set the PostBuildEvent to build on successfull build only.
Hopefully that may help someone else. Note that I specify a SEPERATE
outputpath for the DLL in the command above. Also note that the
"postbuildevent=" property in the command above disables the second
postbuildevent that will occur and is required or the build will never end.
Thanks,
Matt
> Thanks for your reply, the method you suggested may work (I shall have to
> try in the next few days). I am curious though about your project
[quoted text clipped - 43 lines]
>>>
>>> Matt
ME - 27 May 2006 21:25 GMT
One more thing I have found if you specify the $(ProjectPath) do so in
quotes like this:
[C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\msbuild.exe /t:build
"$(ProjectPath)"
/p:outputtype=library;outputpath="$(OutDir)DLL";postbuildevent=]
That way if you have paths with spaces the command will not fail. The
/t:build switch can also be removed completely if you want.
Thanks,
Matt
>I thought I would post the answer to my msbuild question. After taking Ben
>Voigt's advice I came up with the following PostBuildEvent that I can now
[quoted text clipped - 68 lines]
>>>>
>>>> Matt
Ben Voigt - 29 May 2006 14:03 GMT
> Thanks for your reply, the method you suggested may work (I shall have to
> try in the next few days). I am curious though about your project
[quoted text clipped - 4 lines]
> that this approach would be the ideal method, I just could figure out how
> to do it.
Well, I created a new project configuration (Build menu->Configuration
Manager, select a project, drop-down the configuration list next to the
project name, click New...) and changed the output type... studio changed it
for all configurations. So the GUI gets in the way. However, if you edit
the .csproj file, you'll see sections looking like:
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
...
<OutputType>WinExe</OutputType>
...
</PropertyGroup>
This should be pretty self-explanatory, just set different outputtype in the
project file, and hopefully studio won't automatically overwrite it to make
them match.
> Thanks,
>
[quoted text clipped - 34 lines]
>>>
>>> Matt