Closed Tratcher closed 7 years ago
@vijayrkn do you know the settings that should be in project.json to prevent bin from being included in publish?
I think it can be added to the PublishOptions exclude.
"publishOptions": {
"exclude": [
"bin\**",
"obj\**",
]
},
Even without these, the publish used to work in U3. It would be good to get a repro project to see what is causing the recursive copy. May be some custom pattern in publishOptions include could be causing this.
I am using a new .net core project with all defaults.
This looks like an issue with this pattern ("**/*.cshtml"
) in publish include which is causing all the cshtml files to be included from the publishOutput folder as well.
In this case, it included all the cshtml files from bin\Release\PublishOutput\Views.
This issue is not specific to VS tooling. I think this issue will repro if you delete bin\Release folder and run this command from commandline multiple times.
C:\Program Files\dotnet\dotnet.exe publish "C:\Projects\New folder\WebApplication1\src\WebApplication1" --framework netcoreapp1.0 --output "bin\Release\PublishOutput" --configuration Release
You may have to add this to PublishOptions exlude - bin\Release\PublishOutput.
The issue is resolved if the pattern "*/.cshtml" is removed or replaced. I replaced it with "Views".
I'm having the exact same issue (https://github.com/Microsoft/msbuild/issues/2185) and removing/replacing **/*.cshtml
and/or adding bin/**
to exclude section in project.json did not, unfortunately, fix it for me.
From @ewhance on December 23, 2016 17:17
I'm using Visual Studio Enterprise 2015, version 14.0.25431.01 Update 3 and a .net core project. The SDK does not change the result.
Steps to reproduce:
I also have found that even if I manually delete all of the published output as well as the publish profiles, the next publish still results in the same behavior.
Copied from original issue: aspnet/Home#1888