{"id":3203,"date":"2011-04-05T09:00:00","date_gmt":"2011-04-05T09:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/vcblog\/2011\/04\/05\/build-related-improvement-in-vs2010-sp1\/"},"modified":"2021-10-05T15:37:04","modified_gmt":"2021-10-05T15:37:04","slug":"build-related-improvement-in-vs2010-sp1","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/build-related-improvement-in-vs2010-sp1\/","title":{"rendered":"Build Related Improvement in VS2010 SP1"},"content":{"rendered":"<p>Hi, my name is <strong>Li Shao<\/strong>. I am a Software Design Engineer in Test in C++ team. In VS2010, C++ has accomplished the migration of VCBuild to MSBuild based project and Build system. We have received very warm acceptance and overall customer satisfaction is very good. You can take a look of a few of my previous blogs (<a href=\"http:\/\/blogs.msdn.com\/b\/vcblog\/archive\/2009\/12\/08\/c-native-multi-targeting.aspx\">Native MultiTargeting<\/a>, <a href=\"http:\/\/blogs.msdn.com\/b\/vcblog\/archive\/2010\/03\/02\/visual-studio-2010-c-project-upgrade-guide.aspx\">Conversion<\/a>, <a href=\"http:\/\/blogs.msdn.com\/b\/vcblog\/archive\/2010\/04\/21\/quick-help-on-vs2010-custom-build-rule.aspx\">Custom Build Rules<\/a>) for some features and issues related to migration to MSBuild based build system for C++. VS2010 VS2010 SP1 release is around the corner. I would like to take this opportunity to let you know a few improvements that we have made in this area based on your feedback.<\/p>\n<p>&nbsp;<\/p>\n<h4>Managed Incremental Build<\/h4>\n<p>When referencing managed assemblies, a full rebuild is only needed when there are significant changes in the referenced assemblies. <em>Significant<\/em> changes include things like assembly version change, function signature, interface changes, etc. This functionality will greatly reduce the build time for managed or managed\/native interop applications, where managed or managed assemblies are referenced.<\/p>\n<p>We first introduced the managed incremental build feature in VS2008. In VS2010, we were not able to re-implement the managed incremental build feature with the build system moving to MSBuild. We received strong customer requests for this feature. As a result, we re-implemented this feature and it is included in VS2010 SP1.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2011\/04\/0285.clip_image002_thumb_37560641.gif\"><img decoding=\"async\" class=\"size-full wp-image-29263 aligncenter\" title=\"Enable Managed Incremental Build\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2011\/04\/0285.clip_image002_thumb_37560641.gif\" alt=\"Enable Managed Incremental Build\" width=\"621\" height=\"263\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<h4>Custom Dependency File List for Incremental Build<\/h4>\n<p>One of the customer reported issues is that for VS2010 disregards the <span style=\"font-family: courier new;\">\/\/{{NO_DEPENDENCIES}}<\/span> line in the <span style=\"font-family: courier new;\">resource.h<\/span> of MFC applications. When there is a <span style=\"font-family: courier new;\">resource.h<\/span> change either manually or by adding a resource ID using the resource editor, all the files that include <span style=\"font-family: courier new;\">resource.h<\/span> get rebuilt. This has a negative performance impact since <span style=\"font-family: courier new;\">resource.h<\/span> can be included by many files. It is also a behavior change from VS2008.<\/p>\n<p>To fix the problem, in VS2010 SP1, we have implemented a fix so that you can specify the list of header files that they would like to skip when doing incremental build. The property introduced is \u201c<span style=\"font-family: courier new;\">NoDependencies<\/span>\u201d. There are four ways that you can take advantage of this feature:<\/p>\n<p>1. Set as an environment variable<\/p>\n<p>You can use this approach if the dependencies to resource header files are common across all your projects. For example: set <span style=\"font-family: courier new;\">NoDependencies=resource.h;resource2.h<\/span>.<\/p>\n<p>You can set this in the environment that you launch Devenv or set this in your build environment<\/p>\n<p>2. Set through property sheet<\/p>\n<p>You can create a property sheet and set <span style=\"font-family: courier new;\">General -&gt; No Dependencies File List<\/span> to the list of files that you would like to exclude from dependency check.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2011\/04\/6560.clip_image004_thumb_42135D96.gif\"><img decoding=\"async\" class=\"size-full wp-image-29264 aligncenter\" title=\"No Dependencies File List\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2011\/04\/6560.clip_image004_thumb_42135D96.gif\" alt=\"No Dependencies File List\" width=\"609\" height=\"135\" \/><\/a><\/p>\n<p>3. Set as a global property for your project<\/p>\n<p>You can set the property as the following to the \u201c<span style=\"font-family: courier new;\">Global<\/span>\u201d property of the project file:<\/p>\n<div id=\"scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:809b8fa3-0a1b-4631-b2fe-12599c84f107\" class=\"class\" style=\"margin: 0px; float: none; padding: 0px;\">\n<div style=\"font-family: 'Courier New', courier, monospace; color: #000; font-size: 10pt; border: #000080 1px solid;\">\n<div style=\"background: #ddd; overflow: auto;\">\n<ol style=\"margin: 0px 0px 0px 2em; background: #ffffff; padding: 0px 0px 0px 5px;\">\n<li><span style=\"color: #0000ff;\">&lt;<\/span><span style=\"color: #a31515;\">PropertyGroup<\/span> <span style=\"color: #ff0000;\">Label<\/span><span style=\"color: #0000ff;\">=<\/span>&#8220;<span style=\"color: #0000ff;\">Globals<\/span>&#8220;<span style=\"color: #0000ff;\">&gt;<\/span><\/li>\n<li style=\"background: #f3f3f3;\"><span style=\"color: #0000ff;\">&lt;<\/span><span style=\"color: #a31515;\">ProjectGuid<\/span><span style=\"color: #0000ff;\">&gt;{<\/span>3C2EE7D3-A2C9-40A5-91F0-3F988C8D5DF5}<span style=\"color: #0000ff;\">&lt;\/<\/span><span style=\"color: #a31515;\">ProjectGuid<\/span><span style=\"color: #0000ff;\">&gt;<\/span><\/li>\n<li><span style=\"color: #0000ff;\">&lt;<\/span><span style=\"color: #a31515;\">Keyword<\/span><span style=\"color: #0000ff;\">&gt;<\/span>AtlProj<span style=\"color: #0000ff;\">&lt;\/<\/span><span style=\"color: #a31515;\">Keyword<\/span><span style=\"color: #0000ff;\">&gt;<\/span><\/li>\n<li style=\"background: #f3f3f3;\"><span style=\"color: #0000ff;\">&lt;<\/span><span style=\"color: #a31515;\">NoDependencies<\/span><span style=\"color: #0000ff;\">&gt;<\/span> resource.h;resource2.h<span style=\"color: #0000ff;\">&lt;\/<\/span><span style=\"color: #a31515;\">NoDependencies<\/span><span style=\"color: #0000ff;\">&gt;<\/span><\/li>\n<li><span style=\"color: #0000ff;\">&lt;\/<\/span><span style=\"color: #a31515;\">PropertyGroup<\/span><span style=\"color: #0000ff;\">&gt;<\/span><\/li>\n<\/ol>\n<\/div>\n<\/div>\n<\/div>\n<p>4. Set as a file level property<\/p>\n<div id=\"scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:21194b35-2abd-4adc-8199-e22d1f8fd41c\" class=\"class\" style=\"margin: 0px; float: none; padding: 0px;\">\n<div style=\"font-family: 'Courier New', courier, monospace; color: #000; font-size: 10pt; border: #000080 1px solid;\">\n<div style=\"background: #ddd; overflow: auto;\">\n<ol style=\"margin: 0px 0px 0px 2em; background: #ffffff; padding: 0px 0px 0px 5px;\">\n<li><span style=\"color: #0000ff;\">&lt;<\/span><span style=\"color: #a31515;\">ClInclude<\/span> <span style=\"color: #ff0000;\">Include<\/span><span style=\"color: #0000ff;\">=<\/span>&#8220;<span style=\"color: #0000ff;\">resource.h<\/span>&#8220;<span style=\"color: #0000ff;\">&gt;<\/span><\/li>\n<li style=\"background: #f3f3f3;\"><span style=\"color: #0000ff;\">&lt;<\/span><span style=\"color: #a31515;\">NoDependency<\/span><span style=\"color: #0000ff;\">&gt;<\/span>true<span style=\"color: #0000ff;\">&lt;\/<\/span><span style=\"color: #a31515;\">NoDependency<\/span><span style=\"color: #0000ff;\">&gt;<\/span><\/li>\n<li><span style=\"color: #0000ff;\">&lt;\/<\/span><span style=\"color: #a31515;\">ClInclude<\/span><span style=\"color: #0000ff;\">&gt;<\/span><\/li>\n<\/ol>\n<\/div>\n<\/div>\n<\/div>\n<p>Note that this feature only works if you would like to skip certain headers from incremental building. It does not work for files other than header files.<\/p>\n<p>&nbsp;<\/p>\n<h4>Signing of Managed Assemblies<\/h4>\n<p>In VS2010, there was a bug that signing of the managed assemblies cannot be accomplished when <span style=\"font-family: Courier New;\">Linker -&gt; Advanced -&gt; Delay Sign<\/span> is set to \u201c<span style=\"font-family: Courier New;\">Yes<\/span>\u201d. We have previously recommended a workaround to address this issue. In general, you would need to use post build steps to sign the assembly. This is a regression in terms of functionality from VS2008 behavior. In VS2010 SP1, we have attempted to fix the problem. However, there were still some issues with the fix. You can take a look of this <a href=\"http:\/\/blogs.msdn.com\/b\/vcblog\/archive\/2011\/03\/11\/10140139.aspx\">blog<\/a> posted by my colleague Amit Mohindra on how to fix the problem. Essentially, you need to manually modify <span style=\"font-family: Courier New;\">Microsoft.Cpp.Win32.targets<\/span>. You can also take a look of this readme (<a href=\"http:\/\/go.microsoft.com\/fwlink\/?LinkId=210711\">http:\/\/go.microsoft.com\/fwlink\/?LinkId=210711<\/a> \u2013 section 2.4.1.2) if you have application converted with VS2010 prior to SP1 RTM.<\/p>\n<p>&nbsp;<\/p>\n<p>These are the major changes we have made in SP1 regarding C++ build scenarios. Please let me know if you think there are issues we should have fixed. We will try to address them in future releases.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi, my name is Li Shao. I am a Software Design Engineer in Test in C++ team. In VS2010, C++ has accomplished the migration of VCBuild to MSBuild based project and Build system. We have received very warm acceptance and overall customer satisfaction is very good. You can take a look of a few of [&hellip;]<\/p>\n","protected":false},"author":289,"featured_media":35994,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[48,92],"class_list":["post-3203","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cplusplus","tag-build","tag-sp1"],"acf":[],"blog_post_summary":"<p>Hi, my name is Li Shao. I am a Software Design Engineer in Test in C++ team. In VS2010, C++ has accomplished the migration of VCBuild to MSBuild based project and Build system. We have received very warm acceptance and overall customer satisfaction is very good. You can take a look of a few of [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/3203","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/users\/289"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=3203"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/3203\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media\/35994"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media?parent=3203"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=3203"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=3203"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}