Replies: 1 comment 3 replies
-
I don't think you need the <ItemGroup>
<Content Include="App_Data\**\*.*" />
</ItemGroup> |
Beta Was this translation helpful? Give feedback.
-
I don't think you need the <ItemGroup>
<Content Include="App_Data\**\*.*" />
</ItemGroup> |
Beta Was this translation helpful? Give feedback.
-
I'm migrating some of our legacy deployment processes for a WebForms app. Our current deployment procedure is to just copy the entire projects folder after build, which ends up including a ton of unnecessary files (such as the
.cs
files themselves) in the result, and doesn't support the XML transformation step that happens only on publish.I'm now switching into a more standard approach, where we first publish our project using the
/p:DeployOnBuild=true
MSBuild setting, and then grab the output from that.Because of this change, I need to make sure that all the "content" files (images, javascript, css, etc) in the project are properly considered as
Content
in MSBuild and subsequently copied to the publish folder.To achieve this, I took a look at how the standard files are added in the SDK, and tried to do something similar for my own needs.
This is what I added to my
csproj
file:I'd like to check if this is a good approach to the problem. It appears to work just fine, but I'm no MSBuild expert and was wondering if there is a simpler way to achieve the same results.
It looks verbose to me and has some duplication, but it seems better than individually marking each and every content file as
Content
in Visual Studio.Any feedback is welcome.
Beta Was this translation helpful? Give feedback.
All reactions