Version history 2013-10-18 v1.3.4 VS 2013 support 2012-11-22 v1.3.3 Fixed FINDFILEDIR macro as recursive search and null reference exception in VS2012. 2012-07-10 v1.3.2 Fixed issues when simple project file opened and generated solution without path occurs. 2012-04-27 v1.3 Added global vsenvironment.xml file support in your C:\Users\<username>\Documents\Visual Studio 201x folder. 2012-03-12 v1.2 Added macros, Output pane and Error list (see Description). Fixed readonly attribute bug. 2012-03-12 v1.1.1 Added support for VS 11. 2012-03-08 v1.1 Added new option, how to set more variables from xml file. 2012-02-11 TodayI found another solution for T4 (not mentioned in MSDN documentation). It is possible to use some macros in some T4 dicrectives (@include, @assembly) : $(SolutionDir) and $(ProjectDir), so this Addin is no longer needed for T4 purposes. You can use
2012-02-10 v1.0 Initial version
Description Addin for configuring VS Environment variables from solution properties. When solution is loaded, Environment variables are updated from it's properties. Now only %XDTE.Solution.FullName% %XDTE.Solution.Dir% are provided, but it is easy to add more. Please write comment, if you need more properties/variables. More variables can be set from configuration file vsenvironment.xml in solution directory. Global variables can be set from filevsenvironment.xml in your Documents\Visual Studio 201x folder. All files are processed when solution is loaded or file changes. If you have more solutions in same directory, you can use alternative xml file name{solutionname}.vsenvironment.xml, for exampleMySolution.vsenvironment.xml. Create vsenvironment.xml file in your solution directory and edit it's content by this example: <VSEnvironmentSettings> <variable name="MYVARIABLE" value="%MYANOTHERVARIABLE%"/> <variable name="PROGRAMMERNAME" value="Bob"/> <variable name="PATHTOCOMPANYFRAMEWORK" value="$FINDPROJECTDIR(My.Company.Framework)"/> These defined variables will be set inside VS environment and can be accesed by%MYVARIABLE% in places, which are expecting environment variables (for example T4 templating include directive). Variable values can contain another variables (in % and % signs), andmacros but it will be evaluated in order which is in xml. You can also use macro in form of $macro(params). Implemented macros are:
It is very usable for configuring T4 template <#@include #> directive to use Solution specific path, not global or relative path, so T4templates can be then stored in version control. You can than use (anywhere in your solutions directory hierarchy) <#@include file="%XDTE.Solution.Dir%\MyTemplatesProj\MyGreatTemplate.t4"> <#@include file="%MYFrameworkDir%\MyTemplate.t4"> and so on. Errors are shown in errlor list, all variables and it's current values are shown in Output pane. |