vscode-csharp: Debugger fails to start because project is built to 'bin\BPC\...' instead of 'bin\...'
Environment data
dotnet --info
output:
dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 2.1.302
Commit: 9048955601
Runtime Environment: OS Name: Windows OS Version: 6.1.7601 OS Platform: Windows RID: win7-x64 Base Path: C:\Program Files\dotnet\sdk\2.1.302\
Host (useful for support): Version: 2.1.2 Commit: 811c3ce6c0
VSCode Version: Version: 1.25.1 Commit: 1dfc5e5 Date: 2018-07-11T15:43:53.668Z Electron: 1.7.12 Chrome: 58.0.3029.110 Node.js: 7.9.0 V8: 5.8.283.38 Architecture: x64
Steps to Reproduce:
- dotnet new console
- run in debug mode, get error
Narrative: the issue is that when I run “dotnet new console” it’s creating an extra layer of hierarchy that the debug part is not aware of somehow. The screen shot below should illustrate this issue: the paths to the dll are different.
About this issue
- Original URL
- State: open
- Created 6 years ago
- Comments: 17 (6 by maintainers)
Thanks! This clears it all up.
If you aren’t an admin, you could open a command prompt, run
set PLATFORM=
to clear the environment variable, and launch VS Code from the command prompt. If you do this all the time, you could make yourself a trivial batch script to do this.Since it is unlikely by now that HP will ever stop setting the PLATFORM variable to one of their unrelated values, every dev on a HP laptop coding with VS Code will have this issue.
Is the official story to tell them to unset the PLATFORM variable, or could we set in the default csproj template…
Or detect if the PLATFORM variable isn’t set to one of the known values, and warn the user if so?
I don’t know, losing like 30 minutes on this issue felt like a waste of time 😛
It seems HP easy setup. https://stackoverflow.com/questions/2507856/why-is-my-platform-environment-variable-defined-as-bnb
It doesn’t sound like the internet knows what is adding
Platform=BPC
. Do you have any guesses as to what you might have installed?More information: In the Visual Studio/msbuild world, ‘Platform’ is usually a CPU architecture (ex: AnyCPU, x86, x64, arm, arm64). Usually VS/msbuild don’t pass around ‘Platform’ as an environment variable, but rather as an an MSBuild property. However, when msbuild starts it will turn all environment variables into properties. This is potentially useful when doing command line builds to avoid needing to repeat
/p:Platform=AnyCPU
(for example) every time MSBuild is invoked. Though obviously in your case it is just annoying.