How can I access the node_modules folder which is not included in the visual studio solution file from the wwwroot where my index.html is put. That index.html file need to r
You are not supposed to access files from outside of wwwroot
. The wwwroot
folder is the public folder that's accessible from outside, when you host it.
Everything over it, is off-limits.
The typical publishing process is, that you have a gulp or grunt task that runs when your ASP.NET webproject is compiled or published, it would run the tasks there and copy over the necessary files inside wwwroot
folder, i.e. wwwroot/libs
or wwwdata/js
.
Of course you can also manually copy the files over, but that's rather bad especially when you update many dependencies it's hard to keep track manually.
While it's not displayed in the solution (just indirectly, in the Dependencies/npm
section), you can still make it visible by hitting the "Show all files" button on top of the Solution Explorer and copy over the files you need.
But it's best to set up a gulp task for it, but that's out of the scope of this question.