aspnetcore-vueclimiddleware
aspnetcore-vueclimiddleware copied to clipboard
[#ask] Can we use parent folder for ClientApp
I have sample folder strucure for the app
- Dashboard
- - - Backend
- - - - - - ClientApp
- - - - - - Controllers
------etc
How to achieve folder structure like this
(ClientApp
to upper folder align with Backend folder)
- Dashboard
- - - ClientApp
- - - Backend
- - - - - - Controllers
------etc
I just try change "ClientApp" to "../Frontend" does not work
Hi! We're using it that way.
Setting SourcePath = "../ClientApp"
works well.
Remember to update <SpaRoot>
in .csproj
as well for publish build
johndab means you can write it as relative path. By the way absolute path is also working well. 2 dots in front means one folder up counting from your ASP binaries. you can combine them to go up as much as you like f.e: ../../../ClientApp
This does not seem to work properly when the --output (or -o) parameter is used.
If you publish to custom directory: dotnet publish --configuration Release --output myapp
, the ClientApp directory is copied to the parent directory of the destination directory (myapp
).
Similarly if you change it from <SpaRoot>..\ClientApp\</SpaRoot>
to for example: <SpaRoot>..\..\ClientApp\</SpaRoot>
, it will copy the ClientApp to directory two level higher in hierarchy.
Note: these templates are based on the official SPA templates from https://github.com/dotnet/aspnetcore/tree/main/src/ProjectTemplates/Web.Spa.ProjectTemplates
@pmaga
I have the same issue with the react templates, did you get it to copy to the right directory, by any chance?