RSS

Conditional postbuild in C#

24 Sep

Some Examples:

if “$(ConfigurationName)”==”Debug” “C:\Program Files (x86)\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe” /i $(TargetPath)

  • Do not put the “if clause” and the “action clause“  in seperate two lines
  • Use “”  if the command contains spaces, and if the command does not contain spaces, e.g. “SomeCommand” (not the “Some Command”, the quotation mark can be omitted;
  • This is the same as above
    if $(ConfigurationName)==”Debug”  “C:\Program Files (x86)\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe” /i $(TargetPath)

if “$(PlatformName)”==”x86” “C:\Program Files (x86)\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe” /i $(TargetPath)

Other variables:

Public property

  • $(Collection) Returns the collection containing the Configuration object supporting this property.
  • Public property$(ConfigurationName) Gets the project configuration to be built.
  • Public property$(DTE) Gets the top-level extensibility object.
  • Public property$(Extender) Returns the requested Extender if it is available for this object.
  • Public property$(ExtenderCATID) Gets the Extender category ID (CATID) for the object.
  • Public property$(ExtenderNames) Gets a list of available Extenders for the object.
  • Public property$(IsBuildable) Gets whether the project or project item configuration can be built.
  • Public property$(IsDeployable) Gets whether the project or project item configuration can be deployed.
  • Public property$(IsRunable) Returns whether the project or project item configuration can be run.
  • Public property$(Object) Gets an object that can be accessed by name at run time.
  • Public property$(OutputGroups) Gets a collection of OutputGroup objects that contains the names of the files that are outputs for the project.
  • Public property$(Owner) Gets the project or project item for the configuration.
  • Public property$(PlatformName) Gets the name of the platform supported by this assignment.
  • Public property$(Properties) Gets a collection of all properties that pertain to the Configuration object.
  • Public property$(Type) Gets a constant indicating the object type.

For more details, refer to here .

 
Leave a comment

Posted by on September 24, 2010 in Dotnet/C#

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: