0

We are experiencing bad slowdowns in Visual Studio 2019 that appears partly due to a large folder of content (~12,000 files) that we have in our wwwroot folder. This content rarely changes, but it ends up getting searched when we do "Find in files...", etc. which we don't need, and ends up slowing down normal operations such as adding/renaming classes.

Is there any way to keep the content in source control, exclude it from Visual Studio, yet still have it get deployed when we publish?

I haven't been able to figure out if this is possibly editing the csproj file using the settings such as DefaultItemExcludes, or various options on the ItemGroup element.

G_P
  • 2,100
  • 3
  • 16
  • 18
  • Check out this question: https://stackoverflow.com/questions/3137880/how-to-get-visual-studio-publish-functionality-to-include-files-from-post-buil – TrevorBrooks Sep 06 '19 at 17:29

1 Answers1

0

Here is what we have done to (hopefully) resolve this issue for us:

  1. Added the following line to our WebApp.csproj file within the PropertyGroup:

    <ProjectGroup>
        <DefaultItemExcludes>$(DefaultItemExcludes);wwwroot\hugecontentfolder\**</DefaultItemExcludes>
    </ProjectGroup>
    
  2. The huge content folder stays where it is in source control, this simplifies things as we need those files there to be served locally for development

  3. We updated our Azure DevOps pipelines with new tasks to copy the contents of that folder from source control into the build artifact staging directory

  4. Updated the Dotnet Publish Azure Devops task to no longer zip it's output

  5. Another new Azure DevOps task to Archive the build artifact staging directory (which now has the non-zipped dotnet publish output, as well as the huge content folder output in the correct location) into a zip file for publishing.

G_P
  • 2,100
  • 3
  • 16
  • 18