Skip to content
Discussion options

You must be logged in to vote

There's no MSBuild property for it. The static web assets SDK hardcodes the folder: ResolveProjectStaticWebAssets in Microsoft.NET.Sdk.StaticWebAssets.targets calls DefineStaticWebAssets with RelativePathPattern="wwwroot/**" and ContentRoot="$(MSBuildProjectDirectory)\wwwroot".

You can still keep the files somewhere else. DefineStaticWebAssets matches on an item's Link (or TargetPath) metadata before its physical path, and ContentRoot can be set per item. So you can map another folder in as if it were wwwroot:

(web is whatever subfolder you want.) Delete the old wwwroot folder, or the default glob will pick it up too. The files still get served from the app root and published to wwwroot…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@Clockwork-Muse
Comment options

Answer selected by Mliybs
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants