ASP.NET Core Publish Exclude Folder (or .json files)












0















I have an asp core 2.1 project, and I'm trying to publish via web deploy.



I have a folder called "Angular" and inside that are my source files (including some .json files for angular's config) - these get built (via a separate process "ng build") into the wwwroot/app directory ready for publish. As such, I want NOTHING from this Angular directory to end up on the published folder. But I still want the Angular folder to show up in the project / solution explorer / find in files.



At present, it is publishing the Angular folder with all .json files inside. Obviously this is bad and I need to stop this from happening. I'm pretty sure this is happening because of this...
https://github.com/aspnet/websdk/blob/dev/src/ProjectSystem/Microsoft.NET.Sdk.Web.ProjectSystem.Targets/netstandard1.0/Microsoft.NET.Sdk.Web.ProjectSystem.props#L32



I am publishing using the following command:



dotnet publish C:blah -c Release /p:PublishProfile=WebDeployProfile


(and also sometimes doing it via the Visual Studio Publish using the same profile, but less frequently - I notice that these function differently, which I find odd)



I have tried so many different things, both in the .csproj and .pubxml, it's getting ridiculous, and I currently believe msbuild/deploy is a total mess, and quite broken.



I am hoping someone can help me with what should be a supremely simple and easy thing to accomplish - exclude a folder from publish (whilst leaving it in the project).










share|improve this question





























    0















    I have an asp core 2.1 project, and I'm trying to publish via web deploy.



    I have a folder called "Angular" and inside that are my source files (including some .json files for angular's config) - these get built (via a separate process "ng build") into the wwwroot/app directory ready for publish. As such, I want NOTHING from this Angular directory to end up on the published folder. But I still want the Angular folder to show up in the project / solution explorer / find in files.



    At present, it is publishing the Angular folder with all .json files inside. Obviously this is bad and I need to stop this from happening. I'm pretty sure this is happening because of this...
    https://github.com/aspnet/websdk/blob/dev/src/ProjectSystem/Microsoft.NET.Sdk.Web.ProjectSystem.Targets/netstandard1.0/Microsoft.NET.Sdk.Web.ProjectSystem.props#L32



    I am publishing using the following command:



    dotnet publish C:blah -c Release /p:PublishProfile=WebDeployProfile


    (and also sometimes doing it via the Visual Studio Publish using the same profile, but less frequently - I notice that these function differently, which I find odd)



    I have tried so many different things, both in the .csproj and .pubxml, it's getting ridiculous, and I currently believe msbuild/deploy is a total mess, and quite broken.



    I am hoping someone can help me with what should be a supremely simple and easy thing to accomplish - exclude a folder from publish (whilst leaving it in the project).










    share|improve this question



























      0












      0








      0








      I have an asp core 2.1 project, and I'm trying to publish via web deploy.



      I have a folder called "Angular" and inside that are my source files (including some .json files for angular's config) - these get built (via a separate process "ng build") into the wwwroot/app directory ready for publish. As such, I want NOTHING from this Angular directory to end up on the published folder. But I still want the Angular folder to show up in the project / solution explorer / find in files.



      At present, it is publishing the Angular folder with all .json files inside. Obviously this is bad and I need to stop this from happening. I'm pretty sure this is happening because of this...
      https://github.com/aspnet/websdk/blob/dev/src/ProjectSystem/Microsoft.NET.Sdk.Web.ProjectSystem.Targets/netstandard1.0/Microsoft.NET.Sdk.Web.ProjectSystem.props#L32



      I am publishing using the following command:



      dotnet publish C:blah -c Release /p:PublishProfile=WebDeployProfile


      (and also sometimes doing it via the Visual Studio Publish using the same profile, but less frequently - I notice that these function differently, which I find odd)



      I have tried so many different things, both in the .csproj and .pubxml, it's getting ridiculous, and I currently believe msbuild/deploy is a total mess, and quite broken.



      I am hoping someone can help me with what should be a supremely simple and easy thing to accomplish - exclude a folder from publish (whilst leaving it in the project).










      share|improve this question
















      I have an asp core 2.1 project, and I'm trying to publish via web deploy.



      I have a folder called "Angular" and inside that are my source files (including some .json files for angular's config) - these get built (via a separate process "ng build") into the wwwroot/app directory ready for publish. As such, I want NOTHING from this Angular directory to end up on the published folder. But I still want the Angular folder to show up in the project / solution explorer / find in files.



      At present, it is publishing the Angular folder with all .json files inside. Obviously this is bad and I need to stop this from happening. I'm pretty sure this is happening because of this...
      https://github.com/aspnet/websdk/blob/dev/src/ProjectSystem/Microsoft.NET.Sdk.Web.ProjectSystem.Targets/netstandard1.0/Microsoft.NET.Sdk.Web.ProjectSystem.props#L32



      I am publishing using the following command:



      dotnet publish C:blah -c Release /p:PublishProfile=WebDeployProfile


      (and also sometimes doing it via the Visual Studio Publish using the same profile, but less frequently - I notice that these function differently, which I find odd)



      I have tried so many different things, both in the .csproj and .pubxml, it's getting ridiculous, and I currently believe msbuild/deploy is a total mess, and quite broken.



      I am hoping someone can help me with what should be a supremely simple and easy thing to accomplish - exclude a folder from publish (whilst leaving it in the project).







      angular asp.net-core publish asp.net-core-2.1 webdeploy






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 21 at 18:16









      ekad

      12.2k123741




      12.2k123741










      asked Nov 15 '18 at 0:37









      NightCabbageNightCabbage

      21519




      21519
























          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53310848%2fasp-net-core-publish-exclude-folder-or-json-files%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53310848%2fasp-net-core-publish-exclude-folder-or-json-files%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Xamarin.iOS Cant Deploy on Iphone

          Glorious Revolution

          Dulmage-Mendelsohn matrix decomposition in Python