-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dotnet build uses DebugType=portable for projects targeting .NET Framework #1238
Comments
@tmat Is this expected? Should portable PDBs work for full framework TFMs? |
From @tmat on May 19, 2017 21:52 They'll work starting with 4.7.1. They were supposed to work in 4.7 but the support was removed due to an issue that's fixed in 4.7.1. |
From @tmat on May 19, 2017 21:53 (by work I mean the stack trace reporting line numbers and file names) |
I think it may still make sense for any full framework that is not 471, to default to a different debug type. I will move this issue to dotnet/sdk. |
This is by design. We shouldn't add unnecessary complexity to the defaults. Portable PDB for < 4.7.1 is not incorrect, it's just that the framework stack trace implementation can't read them, but any VS capable of using the SDK has a debugger that can. I think we should continue to have the same default irrespective of target framework. Users can set the PDB type in their projects if they want stack trace on older versions of .NET framework to show source info. It is going to open up a can of worms around breaking change of moving default from props to targets in order to vary by TargetFrameworkIdentifier and TargetFrameworkVersion. |
Another data point: VS Code is only able to debug assemblies with Portable PDBs. So if Windows PDBs are produced for the library VS Code won't be able to debug it even on Windows. |
So what would be be best option to choose from? |
|
... yet it has to be set to full (at least for now) in order to get code coverage running, just linking here for the sake of reference: https://github.com/Microsoft/vstest/issues/800 |
If I modify the original repro to This is the csproj: <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net471</TargetFramework>
</PropertyGroup>
</Project> |
Hm, it does work if I target |
…125.3 (dotnet#1238) - Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20075.3
From @innix on May 19, 2017 18:26
dotnet build
by default usesDebugType
value ofportable
which I believe is only valid for .NET Core projects. Whenportable
pdb's are emitted for .NET Framework projects, they just get ignored. This can be confirmed by looking at a stack trace.Steps to reproduce
In the
.csproj
file, change theTargetFramework
tonet462
(or whatever full .NET Framework version you have installed).Change
Program.cs
to this:Expected behavior
I expect source file names and line numbers to be present in the stack trace:
That is the stack trace you get when running it as a
netcoreapp1.1
app, so a stack trace for anet462
app should be identical, right?Actual behavior
This is what you actually get when targeting
net462
:It can easily be fixed by changing the
DebugType
tofull
/pdbonly
in your.csproj
file but the default behaviour seems wrong.Environment data
dotnet --info
output:Copied from original issue: dotnet/cli#6637
The text was updated successfully, but these errors were encountered: