{"id":8243,"date":"2015-04-09T03:46:42","date_gmt":"2015-04-09T03:46:42","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/visualstudioalm\/2015\/04\/09\/layer-validation-in-visual-studio-architecture-modeling-tools-may-result-in-excessive-size-of-users-temporary-folder\/"},"modified":"2019-02-14T17:44:09","modified_gmt":"2019-02-15T01:44:09","slug":"layer-validation-in-visual-studio-architecture-modeling-tools-may-result-in-excessive-size-of-users-temporary-folder","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/devops\/layer-validation-in-visual-studio-architecture-modeling-tools-may-result-in-excessive-size-of-users-temporary-folder\/","title":{"rendered":"Layer Validation in Visual Studio architecture modeling tools may result in excessive size of user\u2019s temporary folder"},"content":{"rendered":"<p>When you perform Layer Validation using the tools available from the <strong>Architecture<\/strong> menu in Enterprise versions of Visual Studio 2012 and 2013, especially when Layer Validation is part of a Build process, you may find excessive growth of the user&#8217;s temporary folder due to caching of binary assemblies. This issue does not affect final release versions Visual Studio 2015.  <\/p>\n<h2>Problem details  <\/h2>\n<p>The <strong>LmrProvider<\/strong> class is used to access the content of managed assemblies when Layer Validation is performed. Shadow copies of these assemblies are placed in the user&#8217;s temporary folder, and may not be removed automatically after the process is complete. This results in rapid growth of the size of the temporary folder, and may eventually lead to problems through long start-up times and shortage of disk space.   <\/p>\n<h2>Workaround  <\/h2>\n<p>The temporary folder will have a path and name of the form:  <\/p>\n<p style=\"margin-left: 36pt\"><strong>%temp%LmrProviderTempAssemblyFolder  <\/strong><\/p>\n<p>Which is usually:  <\/p>\n<p style=\"margin-left: 36pt\"><strong>C:Users&lt;<\/strong><em>user<\/em><strong>&gt;AppDataLocalTempLmrProviderTempAssemblyFolder  <\/strong><\/p>\n<p>The simplest workaround is to include a post-build script in your Build process that empties or completely deletes the <strong>LmrProviderTempAssemblyFolder<\/strong> folder. By including the script in the post-build event of the <strong>.modelproj<\/strong> file, the workaround will be effective from the IDE and from the command line (non-team) build as well.  <\/p>\n<ol>\n<li>Unload the modeling project that contains the layer diagram by right clicking on it in Solution Explorer and choosing <strong>Unload Project<\/strong>.  <\/li>\n<li>Open the project file into the editor by right clicking on it in Solution Explorer and choosing <strong>Edit <\/strong><em>projectname<\/em><strong>.modelproj<\/strong>.  <\/li>\n<li>\n<div>Add the following property group inside and at the end of the <strong>&lt;Project&gt;<\/strong> element (immediately before the closing <strong>&lt;\/Project&gt; <\/strong>tag:  <\/div>\n<p><span style=\"font-family:Courier New;font-size:10pt\">&lt;PropertyGroup&gt;  <\/span><\/p>\n<p><span style=\"font-family:Courier New;font-size:10pt\">  &lt;RunPostBuildEvent&gt;Always&lt;\/RunPostBuildEvent&gt;  <\/span><\/p>\n<p><span style=\"font-family:Courier New;font-size:10pt\">  &lt;PostBuildEvent&gt;rd \/s \/q $(temp)LmrProviderTempAssemblyFolder 2&amp;gt;nul&lt;\/PostBuildEvent&gt;  <\/span><\/p>\n<p><span style=\"font-family:Courier New;font-size:10pt\">&lt;\/PropertyGroup&gt;  <\/span><\/p>\n<\/li>\n<li>Save the project file.   <\/li>\n<li>Right click on the modeling project in Solution Explorer and choose <strong>Reload Project<\/strong>.  <\/li>\n<\/ol>\n<p>  &nbsp;<\/p>\n<h2>More information  <\/h2>\n<p>For more information about creating post-build scripts, see <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/dn376353.aspx\">Run a script in your build process<\/a> on MSDN.  <\/p>\n<p>For more information about Layer Validation, see <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/dd409395.aspx\">Validate Code with Layer Diagrams<\/a> on MSDN.  <\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>When you perform Layer Validation using the tools available from the Architecture menu in Enterprise versions of Visual Studio 2012 and 2013, especially when Layer Validation is part of a Build process, you may find excessive growth of the user&#8217;s temporary folder due to caching of binary assemblies. This issue does not affect final release [&hellip;]<\/p>\n","protected":false},"author":77,"featured_media":45953,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-8243","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops"],"acf":[],"blog_post_summary":"<p>When you perform Layer Validation using the tools available from the Architecture menu in Enterprise versions of Visual Studio 2012 and 2013, especially when Layer Validation is part of a Build process, you may find excessive growth of the user&#8217;s temporary folder due to caching of binary assemblies. This issue does not affect final release [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/8243","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/users\/77"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/comments?post=8243"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/8243\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media\/45953"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media?parent=8243"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/categories?post=8243"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/tags?post=8243"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}