Geeks With Blogs

News My Blog has been MOVED to
Michael Freidgeim's OLD Blog My Blog has been MOVED to
We have only couple of developers who are using PostSharp.Toolkit.Diagnostics and having  PostSharp Pro license .
However ther are much more developers , who are building our solution, but do not required Toolkit.Diagnostics XmlMulticast features, that are referred in %ProjName%.psproj file.

As a workaround I've suggested to to replace locally psproj file with dummy, that doesn't have XmlMulticast(PostSharp feature that available only in Pro edition).

If a developer doesn't have PostSharp Pro license, they shoul set  Environment variable POSTSHARP_PRO=false to effectively exclude psproj from the build on their local machine.
detailed instructions How to Add, Remove or Edit Environment variables in Windows 7 can be found at
For Each project using PostSharp.Toolkit.Diagnostics  A subfolder DEV.Config has been created.
It includes minimal dev.psproj , 
and the full %ProjName%.psproj (e.g. MyProject.psproj ) that is used as a master version on build machine.

%ProjName%.psproj located in the root on local machines should kept  as minimal – the same as Dev.Config\dev.psproj.


<?xml version="1.0" encoding="utf-8"?>

<!--Empty project for developers without PostSharp Pro.

       Do NOT check-in   %ProjName%.psproj


       <Project xmlns="" ReferenceDirectory="{$ReferenceDirectory}">

              <Property Name="LoggingBackEnd" Value="nlog" />

              <Using File="default" />





For each project that uses toolkit insert into PreBuild Event command line
cmd /c $(ProjectDir)\DEV.Config\PreBuild.cmd $(ProjectName)

File DEV.Config\PreBuild.cmd
rem developers without PostSharp Pro installed please set environment variable POSTSHARP_PRO=false
@rem  see detailed instructions  How to Add, Remove or Edit Environment variables in Windows 7
@REM Insert into PreBuild Event command line
@REM cmd /c $(ProjectDir)\DEV.Config\PreBuild.cmd $(ProjectName)
set ProjName=%1
set PSProjFile=..\%ProjName%.psproj
if  '%POSTSHARP_PRO%=='false goto devPsproj
set FileFrom=%ProjName%.psproj
@goto copyFile
set FileFrom=dev.psproj
rem The current dir seems to be \bin\Debug for Library project, but \bin for WAP(Webjet application project)
cd ..\..\Dev.Config

ATTRIB -R %PSProjFile%
copy /Y %FileFrom% %PSProjFile%
@rem pause
Posted on Saturday, February 16, 2013 2:57 PM .Net Framework , Visual Studio/TFS/git , PostSharp | Back to top

Comments on this post: Using PostSharp.Toolkit.Diagnostics, when not all developers have Pro licenses.

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Michael Freidgeim | Powered by: