Closed HaythemJ closed 4 years ago
You may find one of the solutions in https://github.com/dotnet/cli/issues/4062 helpful.
Easiest way is to add this to your csproj file
<ItemGroup>
<Content Include="wwwroot\lib\vendors\node_modules\**" CopyToPublishDirectory="PreserveNewest" />
</ItemGroup>
It works, thank you. But I have to remove other entries like below, othewise the publish won't work saying that there is duplicate entries. I am wondering why the Content Include did not work without the attribute CopyToPublishDirectory
`<ItemGroup>
<Content Include="wwwroot\lib\vendors\node_modules\**"
CopyToPublishDirectory="PreserveNewest" />
</ItemGroup>
It depends on what you already have in your csproj file.. if you clicked "include in project" once, you'll likely have a huge load of those include items.. Best to remove them all and just have the wildcard include. the other option would be <Content Update=... CopyTo.. />
but that would be a hard-to-manage csproj file.
@dasMulli thanks for replying on this issue. @HaythemJ let us know if the suggestions above do not work for you.
It works great. Thank you for the support. I will close the issue.
Steps to reproduce
dotnet core 2.0 Visual Studio 2017 15.5.1 Publish Web Application
Expected behavior
folder with name node_modules should be published like any other folder
Actual behavior
folder with name node_modules is not published
Environment data
dotnet --info
output: .NET Command Line Tools (2.1.3)Product Information: Version: 2.1.3 Commit SHA-1 hash: a0ca411ca5
Runtime Environment: OS Name: Windows OS Version: 10.0.16299 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\2.1.3\
Microsoft .NET Core Shared Framework Host
Version : 2.0.4 Build : 7f262f453d8c8479b9af91d34c013b3aa05bc1ff
I have a Web Application where I put Javascript files under wwwroot/lib/vendors/ like below:
When publishing the folder wwwroot/lib/vendors/node_modules is not published in the output folder which leads to missing libraries.
Is there a way to force the publish of that folder?