jasontaylordev / NorthwindTraders

Northwind Traders is a sample application built using ASP.NET Core and Entity Framework Core.
MIT License
5k stars 1.59k forks source link

How to move ClientApp from WebUI to Src (root folder) #202

Closed AnassL closed 1 year ago

AnassL commented 5 years ago

Hi,

As failed to do with VS2019 template for ASP.Net Core 3.0 and Angular 8, in order to keep angular code outside of .Net code, I have tried to move ClientApp from WebUI to the root folder but failed, I guess the issue was related to npm setting in WebUI.csproj file where I could not find the right way to configure the "WorkingDirectory".

Please advise how to make it the right way.

Also, I have notices the next line in Startup.cs

spa.UseProxyToSpaDevelopmentServer("http://localhost:4200");

I would like to ask if still is there a way to have in startup.cs the ability to choose to enabled or disable running Asp.Net code and run Angular separately and manually. (second option: Asp.Net code launches automatically Angular app).

Poltergeisen commented 5 years ago

@AnassL I think all of that code is found in the WebUI .csproj file.

https://github.com/JasonGT/NorthwindTraders/blob/master/Src/WebUI/WebUI.csproj#L10

You can set here where you want to find your root directory, or remove the spa functionality altogether.

AnassL commented 5 years ago

@Poltergeisen I tried that previously, it can work only if the angular app is served manually, so we lose the ability to run it from the Asp.Net core project.

Poltergeisen commented 5 years ago

@AnassL you'd probably have to use a directory.targets file to set a variable where the root folder actually lives and then use that variable in your csproj file.

I'm not sure of the limitations with that though.

AnassL commented 5 years ago

@Poltergeisen I tried several combinations but failed, I expect that someone who succeeded that to share his experience.

jasontaylordev commented 1 year ago

Thank you for your interest in this project. This repository has been archived and is no longer actively maintained or supported. We appreciate your understanding. Feel free to explore the codebase and adapt it to your own needs if it serves as a useful reference. If you have any further questions or concerns, please refer to the README for more information.