|
index > Visual Studio Guidance Automation Toolkit > Making compiling faster!!! |
|
Making compiling faster!!! |
|
|
It seems to take forever to build a Guidance Package. This is horrible for me because I love to make changes and test very often. There were a couple other messages in this forum that hinted at the problem but none said how to fix it.
First build your new Guidance Package at least once. Now that that is done and everything is set up correctly, we can fix the package csproj file etc. so that we only do the expensive building steps when we need to.
First, open your package csproj file with a text editor like NotePad. There are three projects in the solution and you want the first (not the Installer or Setup projects). Remove the following from just before the end of the file:
<PropertyGroup> <PostBuildEventDependsOn>$(PostBuildEventDependsOn);ComputePostBuildEvent</PostBuildEventDependsOn> </PropertyGroup> <Target Name="ComputePostBuildEvent"> <CreateProperty Value=""$(TargetFrameworkDirectory)\installutil.exe" /ShowCallStack /i /DesignMode=true /Configuration="$(TargetDir)GuidancePackage1.xml" "..\..\..\GuidancePackage1Installer\$(OutDir)GuidancePackage1Installer.dll"
"> <Output TaskParameter="ValueSetByTask" PropertyName="PostBuildEvent" /> </CreateProperty> </Target> <PropertyGroup> <PostBuildEvent> echo. </PostBuildEvent> </PropertyGroup>
I'm not sure why they have the "echo ." in there, I guess it was just a mistake? Now take the Value attribute text from the CreateProperty element in the Target element. This is the part that takes forever in a build. It runs installutil.exe and takes over 1/2 minute on my machine. Make a file called "Register Guidance Package.bat" on your desktop. Put the above text in it and fill all the paths replacable parameters with the full paths, etc. Mine looks like this:
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\installutil.exe" /ShowCallStack /i /DesignMode=true /Configuration="C:\Projects\8.4\VSIP\GuidancePackage1\bin\Debug\GuidancePackage1.xml" "C:\Projects\8.4\VSIP\GuidancePackage1Installer\bin\Debug\GuidancePackage1Installer.dll"
From now on you only have to run this batch file whenever you change your GuidancePacakge.xml file. If you forget, the Guidance Package framework will yell at you when it tries to load your package.
The above makes things a LOT faster. Another thing you can do is create a new solution with only the one project. This gets rid of the other time waste of building the .msi file. In any case when you get ready to build something for real, just open the original solution with all the projects, switch to Release and compile away!
Hopefully, this helps make development faster without making building too much more confusing. | | JLeBert |
|
|
| reply 1 |
|
|
|
You can use google to search for other answers |
|
|
|
|
More Articles |
|
| Unfold Recipe vs New Item |
| Extensibility with DSL |
| Building a first Guidance Package |
| Multiple Project Creation Template |
| T4 in a custom tool |
| Trying to add a new class to the References folder... |
| How do you enable delay signing on a web project programmatically... |
| Synchronizing - GAT Package Changes |
| Thanks for the tip |
| Another installation error |
|