VB.NET - Slow Compilation and Building of VB.NET Project

Asked By Vikas Sharma on 19-Jun-12 03:19 PM
Earn up to 30 extra points for answering this tough question.
Hello Friends,

               I have a website Project in VB.NET and this project has been provided to me for fixing errors and bugs after all i have fixed all the issues but now when i build the project it takes a lot of time for completion well it is also taking time to run ,please any one can tell me the solution so that i can build my project fast.

Thanks in Advance
Jitendra Faye replied to Vikas Sharma on 20-Jun-12 12:05 AM
For this clean your solution and try to rebuild again.
Jitendra Faye replied to Vikas Sharma on 20-Jun-12 12:07 AM
Reference from-


http://social.msdn.microsoft.com/Forums/da-DK/vseditor/thread/3ce20ea1-c6f9-46ba-b954-e784424fa8f6


Solution-



You can try the following workarounds to speed up the compile.


1.Put the obj directory for each project on a RAM-disk.

To force Visual Studio to write the obj files to the RAM Disk, you must manually edit the project file

in an XML editor (or notepad) to add the BaseIntermediateOutputPath key.An example is shown below.

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <PropertyGroup>

    <ProjectView>ProjectFiles</ProjectView>

    <BaseIntermediateOutputPath>R:\MyProjectName\obj\</BaseIntermediateOutputPath>

  </PropertyGroup>

</Project>

Applying this to all of your projects , you will find you have speeded up your compile speed.

2.Build Projects in Parallel, you can manually trigger msbuild yourself as a Visual Studio external

tool to compile your solution in parallel.

3.Try to change almost all of the “Copy local” settings in all the referenced DLLs from the default True

to False. This will prevent the referenced DLLs to be copied to the output folder of each project. And will

also speed up your compile speed.

More detail information about speed up Visual Studio Builds, please refer to :

http://www.codeproject.com/Articles/197663/Speed-up-Visual-Studio-Builds/?display=Mobile
[)ia6l0 iii replied to Vikas Sharma on 20-Jun-12 10:31 PM
The above solution indicating you to avoid "Copy Local" can be dangerous if you don't have libraries installed in the Global Assembly Cache (GAC). It is never intended to be a good idea. A bin copy can help.

These are the things I would recommend you to check. 

a) First and foremost thing I would do is to remove the source control link, which most of the times externally causes visual studio compilation times to be high

b) Increase the parallel build count. You can do this by going to Tools - Options. Open "Projects and Solutions" section and choose "Build and Run". Increase it to a higher number. See below for a screenshot. 



c) You can also try age-old trick of disabling your antivirus program. It for sure, adds to the slowness.

d) Add more project references instead of assembly reference.

e) Lower the number of files in the app_code folder. Try to see if you can migrate them outside. This also at times, cause slowness.

f) Disable third-party plugins or addins that you may have. 

g) And most important of all - Rightclick your website, and choose Property pages. Go to build section, and choose the option that reads Build website as part of the solution, and set the Start action as "Build page"



Hope this helps.