Increasing Your Project’s Build Effeciency
This method of increasing build and general loading efficiency will not work in all cases and while it may make sense to me it won’t really make sense to people that have a set routine. Also this has only been tested on a C# project so I have no idea if it will work for any other project types.
First some quick basics , if you did not already the CSProj file is used to load al the files that you see in the project but it also contains all the details about files that need to be built. What commonly happens to me and I’m sure many other developers is that (hopefully) you keep your DAL in a separate DLL .This makes building and distribution amongst other things a lot easier.
This example is targeted at subsonic but I am sure if you work with another DAL generator you might have a similar problem. When you generate the required files for subsonic you will notice that the files appear as hidden first , at this point you have to include them into the project. Once you include them everything looks nice and happy but in the background VS is adding these files to your CS project. What is wrong with this you may ask? Well it’s pretty simple; as you add more files the size of the project file is going to keep on growing and causes VS to load them slower as it now needs to load a larger file.
The solution to this is pretty simple, first unload your CSProject. Next edit it using any text editor or even VS itself. Once the file has loaded navigate to the second ItemGroup section which contains a list of compile entries. Now at this point I should note that you should take some caution as to what you want to remove (you won’t lose or delete any files but it’s a pain to re add stuff that should not have been removed), what I typically is ensure that all my Generated Files are located in a generated folder so that I don’t make a mistake. Once you have found all the generated files remove them as you see necessary and replace them with this <Compile Include=”Generated\*.cs” />. What that does is instruct the compiler to include all the files in that folder in the compilation. Now reload the project again, at this point you should notice some increased loading speed depending on the size of the project.
It’s also at this point where some people may decide not to use this method. Basically if you run you generator and new files are created in the folder that we specified the only way to include them to unload and reload the project. On this point I again think it’s faster than manually finding each file and selecting include.
There are other little edits that you can make to get the load and build to run a little faster but i will have to leave that for another time. Let me know what you think and also if this did increase your project load speed.
~stalkerh







