Quantcast
Channel: Web Deployment Tool (MS Deploy)
Viewing all articles
Browse latest Browse all 663

Web Deploy ExcludeFromPackageFolders & ExcludeFoldersFromDeployment both not working

$
0
0

Hi Web Deployers,

My Web Deploy from VS 2017 on my Windows 10 dev machine  to IIS on a separate Windows Server machine completes correctly but when it opens the home page of that newly deployed site I get the following error in the browser:

The directory '/App_Code/' is not allowed because the application is precompiled.

Because of this error, I am trying to EXCLUDE '/App_Code/' from my package and/or from my deployment

To do this I have made the following two changes to my project, but neither of these have been successful if preventing the deployment of the "App_Code" folder !!??

Change 1

As described at https://docs.microsoft.com/en-us/aspnet/web-forms/overview/deployment/advanced-enterprise-web-deployment/excluding-files-and-folders-from-deployment

I added the following to MyProject.wpp.targets

      <ItemGroup>
          <ExcludeFromPackageFolders Include="App_Code">
           <FromTarget>To avoid the error The directory App_Code is not allowed because the application is precompiled</FromTarget>
          </ExcludeFromPackageFolders>
      </ItemGroup>

Change 2

As described in post by post by Brian Ogden at https://stackoverflow.com/questions/650875/exclude-files-from-web-site-publish-in-visual-studio

I added the following to Properties/PublishProfiles/MyProject.pubxml

 <PropertyGroup>
    ......
    <ExcludeFoldersFromDeployment>App_Code</ExcludeFoldersFromDeployment>
    ......
</PropertyGroup>

Any assistance understanding why the App_Code folder is not being Excluded from the Package or from the Deployment, and how to fix this issue, would be appreciated.

Thanks all

Terry Clancy

ClanceZ


Viewing all articles
Browse latest Browse all 663

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>