Actually excluding files from the publication without checking

I am trying to publish a clean client project - that is - simple html / js / css files that are managed by nodes during dev management. Node creates a very deep path (longer than 260 characters) - inside node_modules / ...
Although I excluded node_modules:

<ExcludeFoldersFromDeployment>test;node_modules</ExcludeFoldersFromDeployment> 

It still throws an exception when trying to publish:

 Error 1 The "CollectFilesinFolder" task failed unexpectedly. System.IO.PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. at System.IO.PathHelper.GetFullPathName() 

I know that this is exactly node_modules, because manually deleting this solution solves the problem.
In addition, this eliminates termination (the "test" folder is excluded).

How to save these files for publication?

+6
source share
1 answer

I solved this by installing some (if not all) of the dependencies globally:

 npm install -g package 

and then install into the project with

 npm install --link 

As a result, NPM will create shortcuts for your globally installed packages instead of copying them, and it seems that msbuild is not trying to follow these links.

+1
source

Source: https://habr.com/ru/post/973635/


All Articles