aspnetcore-vueclimiddleware icon indicating copy to clipboard operation
aspnetcore-vueclimiddleware copied to clipboard

[#ask] Can we use parent folder for ClientApp

Open azulkipli opened this issue 4 years ago • 5 comments

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

azulkipli avatar Apr 29 '20 06:04 azulkipli

Hi! We're using it that way. Setting SourcePath = "../ClientApp" works well.

Remember to update <SpaRoot> in .csproj as well for publish build

johndab avatar Jun 30 '20 21:06 johndab

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

Kingside88 avatar Jan 09 '21 23:01 Kingside88

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.

pmaga avatar Jan 25 '21 23:01 pmaga

Note: these templates are based on the official SPA templates from https://github.com/dotnet/aspnetcore/tree/main/src/ProjectTemplates/Web.Spa.ProjectTemplates

EEParker avatar Feb 02 '21 19:02 EEParker

@pmaga

I have the same issue with the react templates, did you get it to copy to the right directory, by any chance?

timotheegloerfeld avatar Jun 24 '21 09:06 timotheegloerfeld