aws / aws/aws-toolkit-visual-studio
All appsettings.json environments deployed to AWS
- Dominant language
- No language data
- Stars
- 135
- Forks
- 37
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
All appsettings.json files are deployed to AWS even when using the csproj file to control which files are copied into the bin folder. The proper files are copied into the bin folder per configuration selected. However, the temp folder that is used to bundle the app before sending to AWS has all of the projects appsettings.json files. This causes a problem as the production appsettings overrides the others.
**To Reproduce**
1. Create an `appsettings.production.json` and `appsettings.development.json` files
2. Update csproj file with `` conditions (included below)
3. Right click the project and select "Publish to AWS..."
4. Select existing target and then "Edit Settings" from the far right
5. Change "Dotnet Build Configuration" to `Debug`
6. Publish and wait for temp folder to be created
7. Navigate to folder and see additional files that were not in the bin folder for that configuration
**Expected behavior**
Appsettings.json files that are excluded in the csproj file should not show up in the temp folder which is then packaged and set to AWS.
**Screenshots**
Bin folder

Temp folder create by AWS Toolkit

**Computer (please complete the following information):**
- Windows Version: Windows 10 21H1
- Visual Studio Version: 2022 Version 17.3.0
- AWS Toolkit for Visual Studio Version: 1.35.1.0
**Additional context**
## Conditional files in csproj
```
Always
Always
Never
Always
Never
Always
Never
Never
Never
```
Contributor guide
Research direction
Start with the AWS publish workflow invoked by Visual Studio's "Publish to AWS..." command, comparing the configuration-selected bin folder with the generated temp folder. Reproduce the Debug case using the conditional csproj entries for appsettings.json, appsettings.Development.json, and appsettings.Production.json; done means excluded files are absent from the packaged temp folder.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws
- Domain
- cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100