VS 2005 "Web Deployment Projects" project lacks macros?

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

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)" />

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.


11/16/2005 7:56:20 PM
asp.net.visual-studio-2005 7760 articles. 0 followers. Follow

4 Replies

Similar Articles

[PageSpeed] 19

An Update:

In another forum ( http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet ), I was told that WDP doesn't include the macros defined in Microsoft.common.targets.  Instead, it was pointed out that I have SolutionDir, OutputPath, and Configuration available to me.  Is there documentation somewhere that will show me which macros I have available?  Are there any macros available for the project name or project directory?  I'm still a little confused as to why TargetDir doesn't work, since it was specifically referenced as an example in the "Using Web Deployment Projects with Visual Studio 2005" document, but that's not as big of an issue now that I have the OutputPath and Configuration available now.

11/17/2005 4:35:42 PM

A number of the common targets 'macros' were not used for internal reasons. You should be able to use the following however:

- "OutDir": converted to "WDOutDir". "WDTargetDir" is actually the path that is used to build to;
- "ProjectDir": is not set, try "MSBuildProjectDirectory" instead;
- "Configuration" should work instead of "ConfigurationName";
- "SolutionDir" should be OK.

We'll ensure that we get this into a rev of the whitepapers.


This posting is provided "AS IS" with no warranties, and confers no rights.
11/17/2005 5:49:27 PM

Are there any macros for the output aspx and output dll name, or even for just the assembly name?  I have my output assemblies property set to "Merge all outputs to a single assembly" and have checked "Treat as library component (remove the App_Code.compiled file).  Basically, I want this entire "website" compiled into one aspx and one dll, and in my "AfterBuild" target I want the aspx and dll copied to a distribution directory.  This way, only the assembly I'm working on gets deployed to the server, and not all of the references.


11/17/2005 6:53:22 PM
Woohoo!  Found some information on the web about MsBuild.  It
appears that the macros available are merely xml nodes in the project
file.  Looking through the project file, it appears that the
assembly name is $(SingleAssemblyName).  I plugged this into my
AfterBuild target and it works like a charm!  I couldn't use the
$(MSBuildProjectName) macro because the assembly is named after the
website, not the WDP.  Thanks again for all your help.  It
would be really nice to have all of this information in a document
somewhere though.  Stick out tongue <img src=">

11/17/2005 7:10:38 PM

Similar Artilces:

Difference between "Visual Studio 2005 Professional" and "Visual Web Developer 2005 Express Edition"
I would like to build a web application for my department.  But I found that both tools can be used to build a ASP web site.  What is the difference between these two tools ?  Do they function the same ?  You can review this online features matrix between all visual studio versionshttp://msdn2.microsoft.com/en-us/vstudio/aa700921.aspx  Hosam Kamel Remember to click on Mark as answer on the post that helped you Have a look here http://blogs.msdn.com/mikhailarkhipov/archive/2006/06/26/647516.aspx. Thanks----------------------------------------------------------...

Visual Studio "Orcas" Visual Studio.net "2005"
What are Microsoft on weed??? Whidby Orcas Indigo XAML Longhorn What are they trying to do to us developers. The transition to any new tools should be minimal. What we know about WebServices is now old bunk. Why did we bother with .net 1.1???????? Now we need to learn new silly names and new ways of doing things. Yes .net 1.1 is still supported in v2.0. But there are a million and one other needless things that we will have pushed onto us. Only to find in anther two years that they are old hat and there are new radical ways to do what we want.MCAD.Net vb.n...

Upgrading from "Visual Web Developer 2005 Express Edition Beta 2" to "Visual Studio 2005 Beta 2"
Newby question: I am learning ASP.NET and downloaded "Visual Web Developer 2005 Express Edition Beta 2" in order to practice and learn the ropes.I just received "Visual Studio 2005 Beta 2" and would like to upgrade. However, I haven't found any reference to removing "Visual Web Developer 2005 Express Edition Beta 2" before installing "Visual Studio 2005 Beta 2".Should I remove it?What do I need to back up before doing so?Thanks in advance,Ira I believe you can install VS on top of VWD. They, in fact, can coexits (although they will share some files).Thanks----------------------------------...

In Visual Studio 2005 whats difference between "new Project" and "new website".
In Visual Studio 2005 whats difference between "new Project" and "new website".  Is new project for non web realted stuff.   Hi Parms,New Project enables you to add projects to your solution for non-web related projects -- for example: windows applications, class libraries, etc.  New Website adds a project specific to web UI developmnet.Hope this helps,Scott Hi Scott --On a related subject: I've got a VS 2003 solution with three web apps. The third web app is really just a library of classes that are shared between the other two web apps.app_1: a real web app (references ...

Website Project vs. Web Application Project in Visual Studio.net 2005
 Website Project vs. Web Application Project in Visual Studio.net 2005 What are the main benefits of using a Web App project over a Website project or vice-versa? Web App Project: You have to jump through hoops to use edit and continue with a Web App where in a website it just works. I’ve figured this out with the help of ScottGu. Thanks! http://weblogs.asp.net/scottgu/archive/2006/05/08/VS-2005-Web-Application-Project-V1.0-Released.aspx Web App Project: what are the *.aspx.designer.cs files for? Website Project: how do you set up the project to use a ...

The new "Visual Studio 2005 Web Application Projects (RC1)"
are there any further readme's or instructions on how to use the new features in this package?  Some of the features sound interesting but I don't know where to find them in vs.thanks,http://msdn.microsoft.com/asp.net/reference/infrastructure/wap/default.aspxPeter Kellnerhttp://73rdstreet.com and blogging athttp://PeterKellner.netMVP, ASP.NET Did you check out Scott Guthrie's blog post here?http://weblogs.asp.net/scottgu/archive/2006/04/05/442032.aspxHe has tons of links to additional info as well.Darrell Norton, MVPDarrell Norton's BlogPlease mark this post as answered if it help...

How to uninstall "Visual Studio 2005 Web Application Project Preview"
How to uninstall "Visual Studio 2005 Web Application Project Preview" Go to Control Panel / Add-Remove Programs. -- Bash This posting is provided "AS IS" with no warranties, and confers no rights....

Empty Toolbox on Web "Site" (Project) in VS 2005
 Hi, My Visual Studio Professional 2005 toolbox (for web site "projects" is empty).  The text in the toolbox says "There are no usable controls in this group.  Drag an item onto this text to add it to the toolbox.". I've tried the "Tools/Import, Export Option Settings" to try to reset and get the standard controls in the toolbox, but not success so far. Also tried the right-mouse click on the toolbox to "reset", but still an empty toolbox. Ideas how I can get my Web toolbox filled? Thanks! Hi Andy, I just forwarded this thread off to someone who will hopefully be ...

Migrating from VS 2005 Web Site Projects to VS 2005 Web Application Projects witn vb and c# code
I've tring to migrate Web Site to Web Aplication in VS 2005. In my Web Site I have pages written using VB and C#. During converting to WA i choose VB and only pages with VB code i can migrate. If I choose C# as language for WA only pages with C# I can migrate. Is a way to migrate Web Site with mix of VB and C# code? Wieslaw Hi, As far as I know, The ASP.NET Web application doesn't support that C# application project contains VB page or VB application project contains C# page. But it can compile the different language class file in project. In your case, you can tr...

"Find All References" no longer works in Web App projects under VS 2005?
On any function/sub from within my web app, if I right click the function name and select "Find All References" -- it ALWAYS returns Zero results found.  If I do the same on a regular Windows Forms app, it works fine. If I use the Edit | Quick Find and select the function name, that works in both web apps and windows forms apps. VS 2005 SP1 - using VB Anyone else come across the problem? Rob.Rob Ainscough...

Hi, I'm really helpless on this one. When I try to add a Class Diagram to a Asp.Net Web Project, VS.NET "blows up" disappears ! I believe this problem started after installing some of the .NET 3.0 Add-ins but I'm not sure.I reinstalled sp1 with no effect. I tried a repair and it didn't fix it.  Thanks, Paul 1. Version of the VS 2005 (regular or with Service Pack).Microsoft Visual Studio 2005Version 8.0.50727.762  (SP.050727-7600)Microsoft .NET FrameworkVersion 2.0.50727Installed Edition: ProfessionalMicrosoft Visual Basic 2005   7...

Web deployment project
I created a web deployment project - merge all files to singe assembly output. I am puzzled which files do I need to deploy.I end up with "release" folder and many files in it ,and a "bin" folder inside with my precompiled single assembly and again someadditional files.I do not see a web config file in this folder. So my question is do I need to deploy "release" or "bin" folder or just the precompiled single assembly to my remote web server ?? Also what happens to a web.config file in this case ??   Thanks     Did you choose &quo...

How to deploy web project in VS 2005 using web setup project
I have developed a new .NET Web application in C#. It is working find in localhost, i want to deploy the application to the production server. Please let me know what are the steps i need to follow to create an MSI file with VS.NET Installer in VS 2005. When i am trying to create a websetup project with a new solution option, it is not giving me the primary output file selection, i mean to say i am not at all getting the list of resources to select in the drop down list and also my project in the projects drop down list. Please some boyd help me and tell me is there any thing need to be done...

Creating a setup project in Visual Studio 2005: Can install project from within VS but not via web page
Have created a simple project is vb using VS2005. If I right click it from within Visual Studio and select Install, the project is installed on my machine correctly together with a shortcut to the program on the desktop (which I defined in the File System Editor). To do this the Setup Wizard runs. Have added a Windows Setup project to the solution which creates a web page from which I want users to be able to install the program on their machines. When I click on the Install button it does not run the Setup Wizard. It does, however, install the program on my machine but not the shortcut. C...

Web resources about - VS 2005 "Web Deployment Projects" project lacks macros? - asp.net.visual-studio-2005

Resources last updated: 1/7/2016 11:15:34 PM