How to make XAML project to build faster on the Windows Platform

来源:互联网 发布:flv在线视频捕捉软件 编辑:程序博客网 时间:2024/05/19 20:00

XAML has a bad name/abominable in terms of the compiling time. 


there are some tips in how to tune your XAML project to make it to build faster on the Windows Platform.


1. running VS elevated

2. Breaking up XAML documents when possbile (styles in separate documents)

3. Changing XAML editor to "Source Code (Text) Editor" and always open documents in full XAML view

4. Disable Resharper in all XAML documents (ctrl+alt+shift+8) and turning off solution wide analysis

5. Moving as much as possible of the VS2010 default IO location to my local drive 

6. Turn off AutoRecover saving & Tracking of active items in solution explorer.

7. Disabling "rich visual experience" (but using hardware accel, still cause occasionally issues)


Also, there are some tips on the VS Settings



a. Set false to options -> Windows Forms Designer -> AutoToolboxPopulate (WPF respects this settings and if this is on, it will scan all of the project output assemblies for components or wpf controls whenever you build"

b. In the property window for xaml files, delete the CustomBuildTool "MSBuild:Compile", Every time you save a xaml file, it runs a mini compile to regenerate the .g.cs file . It does this because you might have named elements in your xaml file and you wouldn't get intellisense otherwise.. You will lose some autocreated method members before build, but it might be worth it.

c. try building out of process. You can create an external tool pointing to an msbuild command line to build project. Build then will longer grow the working set of VS. Some like command 

<verbatim>

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe Arguments=/m /clp:NoItemAndPropertyList;Summary;Verbosity=minimal "Carbon VS2010.sln" /property:Optimize=false,DebugSymbols=true
</verbatim>


Some others more.


I http://code.google.com/p/solutionloadmanager/ There is an extension , which can improve the initial opening of solutions and the overall memory consumption in larger solutions. 

II. set false the following: Options -> Text Editor -> XAML -> Miscellaneous -> Automatically populate toolbox items.

III. there are some tips on this page: http://support.microsoft.com/kb/2516297 which has one option: Disable the hardware acceleration.



this is just an summarization of the tips that you can apply to make the VS the even a slightly faster.


原创粉丝点击