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
PDBs fail to generate when referencing netstandard project from UWP app #955
Comments
Try using "pdb only" instead of "portable" in the .NET Standard library symbol generation settings. |
where is that setting? i'm facing the same issue here |
In project settings, build->advanced if not mistaking (sorry, writing from a phone) |
I ended up changing the project file by hand to:
This seems to work |
I've added the workaround to the top-comment. |
It looks to me like the issue here is probably that the .NET Native toolchain doesn't handle portable PDBs. |
Based on the comment here, it looks like this has been fixed. |
@dsplaisted I know that the thread you referenced says this should be fixed, but it doesn't seem like it is, in fact check the latest comment. Someone else still hitting this and so am I, I'm using dotnet sdk2.0 and VS2017 15.3 and UWP 5.4.0... can we re-open this issue? |
generate full PDBs so UWP projects can consume This looks good 👍 Ref: Work around for the bug dotnet/sdk#955 (comment)
I'm seeing this with VS2017 15.3.5, UWP5.4.0, and the UWP Community Toolkit:
|
ping @dsplaisted - the workaround here only works if you wrote the netstandard projects that your UWP project is referencing, if you are pulling netstandard libraries from nuget then you are stuck. |
@wpeter-sfdc Understood, but shouldn't the various declarations of it being "fixed" (links above, and the .NET Native 1.7 release notes supporting portable PDBs) mean the workaround isn't necessary? |
@adamhewitt627 Right, my point is that this bug should have some urgency to it as the workaround only works in some scenarios - and as more nuget libraries move to netstandard the workaround will be less applicable (since netstandard uses portable PDB by default). |
Ah good, we're on the same page. I completely missed that you're who already said it doesn't look fixed. I thought you were suggesting that nothing more needed done on this. Maybe a squeaky wheel can get some input on why this doesn't appear to be properly addressed in 1.7. |
@adamhewitt627 @Thealexbarney I would love to better understand the issue you're hitting as I was involved in the portable PDB implementation in .NET Native and this is the first time I'm hearing about any issues with that. Thealexbarney pointed out that release build worked fine for him but that's the mode using .NET Native, debug build normally uses CoreCLR - are you hitting the issue in debug mode with the "Use .NET Native" switch turned on? I must admit I don't fully understand the repro instructions above, the description almost exactly matches what I and others have been testing multiple times; I guess there must be something interestingly special about your code that's tripping this. The PDB format is pretty complex in its entirety, I can easily imagine we missed some corner case somewhere - that's exactly where a simple repro would be super helpful. Thanks Tomas |
It turns out reproducing this is harder than I expected. I forgot to mention that I have only really seen this error when trying to build at command line, while Visual Studio works.
EDIT: I didn't think about the build optimizing outputs. Including |
Thanks @adamhewitt627 for sharing the repro instructions, I've been able to reproduce the issue on my local installation of VS2017 15.4 preview 2. I believe the problem is an internal bug in VS build scripts. I have made a simple attempt to fix this but I wasn't successful, it will require a bigger scripting guru; I'll follow up on this with the VS folks. For now I have a very simple workaround that might get you unblocked in the short term: please set the environment variables set VC_ExecutablePath_x64_x64=%VCToolsInstallDir%bin\HostX64\x64 in the VS developer prompt prior to running msbuild to build your project. I was able to build your PdbRepro project successfully with this hack, please let me know if it fixes your issue. Thanks Tomas |
Since @adamhewitt627 already posted a repro repo, here are somewhat more detailed steps to reproduce the error from the GUI in VS 15.3.4.
At this point, associating the UWP app with the store and doing a build for upload to the store will also produce the error. Setting those two environment variables and rebuilding from the command line gives |
I am also getting build errors, even with those environment variables set: |
@trylek since you've confirmed this bug still exists can you re-open this issue? Thanks! |
Thanks @wpeter-sfdc and @adamhewitt627 for your additional feedback. There is an ongoing internal discussion on the subject and I have been given the following additional guidance on the subject: Basically, if a PDB was created with /fastlink, it is not included in symbols package. It should be fixable by making the following project change: In link.exe switches for C++ component(s), use /DEBUG:FULL or /DEBUG instead of /DEBUG:FASTLINK when intention is to produce Debug APPXBUNDLE and APPXSYM packages. Please let me know if this additional info finally helps you overcome the problems you're hitting. My understanding of the internal discussion is that conversion of FASTLINK PDB's is simply not supported by design. Based on your feedback with respect to the simple workaround we can continue discussing whether additional changes might be desirable at the VS side. |
Hi @trylek -- thank you for the update. I'm unable to comment on the newest detail regarding C++ debug linking options, as I have little experience there. However, in case it is helpful, I've attempted the workaround you suggested above with environment variables and am encountering the same errors that @adamhewitt627 described. This build failure is blocking the consumption of the UWP Community Toolkit as a dependency in my UWP Store app project, and I've been unable to find any local workaround; it looks like we're dependent either on an update on the SDK side or the application of a workaround at the library dependency level in order to unblock. |
@trylek I'm unclear what "simple workaround" you mean since setting the environment variables doesn't work. I'm also not sure how C++ build flags would impact a .NET app consuming a .NETStandard project. Also, that project file suggests it's building portable, not fastlink. (At least, I think that's the default?) |
@trylek That workaround does not help I don't believe... if I'm understanding it correctly, that workaround still puts the onus on making changes to the way netstandard libraries are generated. However, our UWP app consumes 3rd party nuget packages that don't know or care about this workaround, and therefore we get build errors. This seems like a pretty core scenario: a UWP app consumes netstandard libraries via nuget. Is there any workaround we can do on the UWP side (without needing to modify all 3rd party nugets we consume)? Why is this issue still closed? Many folks (including yourself) have confirmed it still repros, can you re-open the issue? I keep having to explain to management/colleagues "this bug is blocking us, I know it says closed but it's not". This bug is really hurting us, would appreciate some traction on it. Thanks! |
@wpeter-sfdc @adamhewitt627 Sorry Peter and Adam for the delay, we're really trying to find the rightful owner of this issue to prevent the situation when we reopen the issue and someone closes it again because it looks like the pre-existing situation was caused by a misunderstanding concerning the nature of the problem. I'm being told that someone with better understanding of VS scripts than I have should take over the investigation shortly and follow up on this thread as appropriate. In the meantime, could you please let me know what version of Visual Studio you're using? I'm being told that in the latest version the error has been downgraded to a warning so that it no longer prevents packaging. It also looks like I incorrectly interpreted the PDB flavor issue: indeed fastlink PDB's are irrelevant in the UWP case - it turns out that it's the case that the portable PDB's aren't supported either by the conversion tool. I understand you cannot affect the PDB flavor for nuget packages used by your app - that's probably where the new VS logic should hopefully provide some relief - however if you happen to be in control of the components you're using, it should be also possible to eliminate the problem by switching over to using "full" (non-portable) PDB's. [Modulo the fact that you'll still need to manually set the path to the convertor using the environment variables as I described above.] Thanks for your patience Tomas |
FYI I have just created an internal bug tracking the issue that is now being triaged on the VS team. |
@trylek Glad to hear. I'm on VS 15.3.5, and my experience is that inside VS it is a warning. However, I've still been getting an error building from command line, which is preferable for an automated build. |
Thank you for this. I've spent all day trying to get my commandline build working, and turns out I'm also hitting this bug. |
Same problem here, VS 15.3.5 building UWP app on Jenkins with Microsoft.Toolkit.Uwp.UI.Controls dependency. |
Same bug, but using VS 15.4.1 |
Getting this bug on VS 15.4.1. @trylek Any update on the progress on this issue? |
@steingran I apologize, this is completely beyond me for now. I see that an internal VS task #504917 has been created to track this but that's about it. @tmat, do you have any idea how to continue getting a traction on this issue? |
I verified that the app described by the repro steps from @Thealexbarney above is fixed with recent build of VS 15.5. The fix should be in VS 15.5 RTM. Not sure if it made it to 15.5 Preview 4 (once it's actually released which should be any day now), but it might. |
I am currently not able to debug with .NET Standard 2.0 on UWP. It's not all solutions, but one particular solution I cannot get working. In my case, I am seeing the PDB files. I have logged the issue here: dotnet/standard#621 . I wonder if there are still general issues with Visual Studio debugging .NET Standard dlls on UWP... I am using Visual Studio 15.5.3 |
I realize this is an older thread but I would like to add a "me too" to this: I have created a brand new UWP project as part of a Xamarin.Forms application. I am unable to set any breakpoints in code that I have written. Breakpoints are disabled with the message that "No symbols have been loaded..." Here is some of my version info... Microsoft Visual Studio Enterprise 2017 Xamarin Designer 4.12.264 (fc37cd02e) Xamarin.Android SDK 8.3.0.19 (HEAD/342b2ce96) Xamarin.iOS and Xamarin.Mac SDK 11.10.1.177 (7e782c1) |
Me too, I'm experiencing the same behavior. Breakpoints are disabled while doing debug, and not triggered. My Visual Studio info:
|
I am experiencing this issue when building on appcenter.ms with the Quartz scheduling library. |
/cc @tommcdon |
Steps to reproduce
Results
The pdb files aren't generated for the debug build or the appxupload. Release builds generate pdb files without apparent issue.
Pdb files aren't included in the appxupload package, even though the build succeeds.
This does not happen when referencing a PCL.
Update: MSBuild 15.1 gives the error
Failed to convert FastLink symbols to full PDBs for '....pdb' due to failure to find the tool '\mspdbcmf.exe'.
Here is the diagnostic output from the msbuild task:
Workaround
In the .NET Standard project, set the
DebugType
topdbonly
e.g.:
Or in the GUI, Project properties -> Build -> Advanced -> Debugging Information -> pdb-only
Issue also filed here.
The text was updated successfully, but these errors were encountered: