dotnet / dotnet/aspnetcore

How to pass the EnvironmentName on publish of an ASP.NET Core app with Angular 2022

Open
#61,550 0 comments 0 reactions 0 assignees View on GitHub
area-mvc
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Is your feature request related to a problem? Please describe the problem.

I created a project based on the tutorial and ran into a problem

https://learn.microsoft.com/en-us/visualstudio/javascript/tutorial-asp-net-core-with-angular?view=vs-2022

how to pass the EnvironmentName specified in the .pubxml file (in project Server)

```xml
Test
```

in the Server project to the client project .esproj
to influence the BuildCommand and replace npm run build with your custom one

EnvironmentName on the client is empty
```xml


npm start
Jasmine

false

$(MSBuildProjectDirectory)\dist\angularwithasp.client\
npm run build:Test
npm run build

```

### Describe the solution you'd like

I would like to influence the client's npm run build script when publishing the server

the idea of ​​this template is that when publishing a server, the client part BuildCommand is launched, and the build result is placed in wwwroot, I would like to customize this and influence the BuildCommand called on the client when publishing a server project

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.