Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > VS 2005 "Web Deployment Projects" wdproj lacks macros?

Reply
Thread Tools

VS 2005 "Web Deployment Projects" wdproj lacks macros?

 
 
DBxGlock
Guest
Posts: n/a
 
      11-17-2005
I'm trying to create the equivalent of a post build event for a
website. I have the "Web Deployment Projects" add-in installed and am
attempting to follow the instructions in the "Using Web Deployment
Projects with Visual Studio 2005" document. In the "Customizing Web
Deployment Projects" section, it gives an example of an "AfterBuild"
target where a directory is created using the $(TargetDir) macro. When
I attempt to use $(TargetDir), it doesn't seem to exist. The only
macros I can find that work within the .wdproj file are solution level
(SolutionPath, SolutionDir, etc). What I really need are TargetDir,
ProjectDir, and ConfigurationName (to determine if we're compiling in
Debug or Release mode).

I have attempted using several of the macros available in standard
project post build events like this:

<Target Name="AfterBuild">
<Message Importance="high" Text="SolutionDir: $(SolutionDir)" />
<Message Importance="high" Text="ProjectDir: $(ProjectDir)" />
<Message Importance="high" Text="TargetDir: $(TargetDir)" />
<Message Importance="high" Text="OutDir: $(OutDir)" />
<Message Importance="high" Text="ConfigurationName:
$(ConfigurationName)" />
</Target>

The only one of these that works is $(SolutionDir). Does anybody know
why these aren't available in my .wdproj file and how I can get this
information? Most important is the Configuration being compiled.

Thanks,
Dan

 
Reply With Quote
 
 
 
 
Juan T. Llibre
Guest
Posts: n/a
 
      11-17-2005
Hi, DBxGlock.

I'm not sure if many people here are using the tool yet.

Scott Guthrie asked that, if you run into problems with the tool,
you should post your questions to :

http://forums.asp.net/138/ShowForum.aspx

He also said the Dev Team who created the tool would answer questions there.




Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Espaņol : http://asp.net.do/foros/
======================================
"DBxGlock" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> I'm trying to create the equivalent of a post build event for a
> website. I have the "Web Deployment Projects" add-in installed and am
> attempting to follow the instructions in the "Using Web Deployment
> Projects with Visual Studio 2005" document. In the "Customizing Web
> Deployment Projects" section, it gives an example of an "AfterBuild"
> target where a directory is created using the $(TargetDir) macro. When
> I attempt to use $(TargetDir), it doesn't seem to exist. The only
> macros I can find that work within the .wdproj file are solution level
> (SolutionPath, SolutionDir, etc). What I really need are TargetDir,
> ProjectDir, and ConfigurationName (to determine if we're compiling in
> Debug or Release mode).
>
> I have attempted using several of the macros available in standard
> project post build events like this:
>
> <Target Name="AfterBuild">
> <Message Importance="high" Text="SolutionDir: $(SolutionDir)" />
> <Message Importance="high" Text="ProjectDir: $(ProjectDir)" />
> <Message Importance="high" Text="TargetDir: $(TargetDir)" />
> <Message Importance="high" Text="OutDir: $(OutDir)" />
> <Message Importance="high" Text="ConfigurationName:
> $(ConfigurationName)" />
> </Target>
>
> The only one of these that works is $(SolutionDir). Does anybody know
> why these aren't available in my .wdproj file and how I can get this
> information? Most important is the Configuration being compiled.
>
> Thanks,
> Dan
>



 
Reply With Quote
 
 
 
 
Scott Allen
Guest
Posts: n/a
 
      11-17-2005
On 17 Nov 2005 05:46:19 -0800, "DBxGlock" <(E-Mail Removed)> wrote:

>
>The only one of these that works is $(SolutionDir). Does anybody know
>why these aren't available in my .wdproj file and how I can get this
>information? Most important is the Configuration being compiled.
>


The configuration is selected in the <PropertyGroup> sections in your
WDP file. Try the following:

<Target Name="AfterBuild">
<Message Importance="high" Text="SolutionDir: $(SolutionDir)" />
<Message Importance="high" Text="OutputPath: $(OutputPath)" />
<Message Importance="high" Text="Configuration: $(Configuration)" />
</Target>

The common macros that are now working for you are defined in
Microsoft.common.targets, which the WDP doesn't include.

--
Scott
http://www.OdeToCode.com/blogs/scott/

 
Reply With Quote
 
DBxGlock
Guest
Posts: n/a
 
      11-17-2005
Scott,

Thank you! That is exactly what I needed. Those macros work great.
Is there a list of the macros available in WDP?

Thanks,
Dan

 
Reply With Quote
 
Scott Allen
Guest
Posts: n/a
 
      11-17-2005
On 17 Nov 2005 09:02:39 -0800, "DBxGlock" <(E-Mail Removed)> wrote:

>Scott,
>
>Thank you! That is exactly what I needed. Those macros work great.
>Is there a list of the macros available in WDP?
>


I was trying to figure out all the properties just yesterday (the
MSBuild term is a "property"). I haven't found a way to dump all the
available properties as yet. Some of the properties come from the
..wdproj file, some come from the included targets file. I get the
feeling MSBuild also picks up some from the .sln file, too, but I have
not been able to verify it :/

--
Scott
http://www.OdeToCode.com/blogs/scott/
 
Reply With Quote
 
DBxGlock
Guest
Posts: n/a
 
      11-17-2005
Scott,

I just noticed a few hours ago that it picks up some of those
"properties" from the wdproj file. That was the final piece of the
puzzle because allows me to now copy only the files I want to deploy to
the website to a separate folder.

We have a single website running in IIS and each page has its own
solution (and in VS 2003 its own project). This means that there is a
1-to-1 correlation between aspx and dll files. This made it very hard
to convert to VS 2005. After a lot of prayer and your help, I was able
to put the following 2 lines in the "AfterBuild" target in the wdproj
file:

<Target Name="AfterBuild">
<Copy
SourceFiles="$(MSBuildProjectDirectory)\$(OutputPa th)$(SingleAssemblyName).aspx"
DestinationFolder="$(SolutionDir)ForDistribution\W ebsite\$(OutputPath)"
/>
<Copy
SourceFiles="$(MSBuildProjectDirectory)\$(OutputPa th)bin\$(SingleAssemblyName).dll"
DestinationFolder="$(SolutionDir)ForDistribution\W ebsite\$(OutputPath)bin"
/>
</Target>

Now when a developer edits the webpage, the App_Web<mangled>.dll and
App_Code.dll files are compiled into a single dll named the same as the
aspx file (assembly name per WDP). Just those 2 files now are copied
to a special directory under the solution so they know exactly what
needs to be deployed (and so they don't accidentally grab a a similarly
named dll instead of the one they mean to deploy).

Dan

 
Reply With Quote
 
Scott Allen
Guest
Posts: n/a
 
      11-18-2005
On 17 Nov 2005 13:05:54 -0800, "DBxGlock" <(E-Mail Removed)> wrote:

>After a lot of prayer and your help, I was able
>to put the following 2 lines in the "AfterBuild" target in the wdproj
>file:
>


Very cool.

P.S. I did find a way to dump all the properties. Run MSBuild from the
command line against the project and specify /v:diag - this sets the
verbosity level to "diagnostic".

--
Scott
http://www.OdeToCode.com/blogs/scott/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
jython lacks working xml processing modules? Jane Austine Python 14 07-18-2012 08:09 AM
Can I stitch pictures if my camera lacks stitch mode? cc_brewster@yahoo.com Digital Photography 8 03-19-2006 09:31 AM
Grrr.. Sipura SPA-2100 lacks "Sip-Proxy-Require" Mark UK VOIP 6 08-11-2005 07:56 AM
OSx 10.4 lacks pythonIDE? baza Python 7 05-17-2005 06:18 PM
convert ftp.retrbinary to file object? - Python language lacks expression? Robert Python 5 02-03-2005 04:05 PM



Advertisments