Skip to content
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

Visual studio 2019 can not load local pdb file extracted from snupkg #9302

Closed
moh-hassan opened this issue Mar 15, 2020 · 3 comments
Closed

Comments

@moh-hassan
Copy link

moh-hassan commented Mar 15, 2020

Environment:
Visual studio 2019 v16.4.2
console project in net461
using nuget from CI appveyor server loaded locally to my machine.

I try to debug a console project using snupkg package locally in my machine for debugging locally.

reference the package

<ItemGroup>
	<PackageReference Include="mypackage" Version="1.2.0" />
</ItemGroup>

Appveyor don't support loading snupkg, so I downloaded the corresponding snupkg package from CI Appveyor server to my machine from the artifact for test. (it's not published yet to nuget gallery)

I unzipped the snupkg file (it's zip file) to c:\folder1.

I add the path in debug options of VS:

options->debug->symbols-> c:\folder1\lib\net461\mypakag.pdb

Visual studio 2019 v16.4.2 can not recognize the symbol pdb file and fire a message:

a matching symbol file was not found in this folder

Why Visual studio can not load the pdb file of the snupkg package? What I missed to do?

Note: I used the same procedures before with the legacy pdb .symbol.nupkg and it was working.

This issue is different than #8809
workaround solution
Unzip both nupkg and snupkg and add pdb which is extracted from snupk in the same folder of dll then reference the the dll file in the project.
In that case VS auto load the pdb.

<ItemGroup>
	  <Reference Include="mypackage">
           <!-- mypackage.pdb is unzipped from snupkg and loaded in the same folder with dll -->
	    <HintPath>C:\Users\admin\source\repos\Test\lib\mypackage.dll</HintPath>
	  </Reference>
	</ItemGroup>
@kartheekp-ms kartheekp-ms added the WaitingForCustomer Applied when a NuGet triage person needs more info from the OP label Mar 18, 2020
@kartheekp-ms
Copy link
Contributor

Please uncheck Enable Just My Code in Debug -> Options -> General and also in debug session open the Modules window and see if the symbols are loaded. Please refer doc just to make sure all the required settings are configured appropriately. If the issue still persists please let us know.

@moh-hassan
Copy link
Author

moh-hassan commented Mar 18, 2020

uncheck Enable Just My Code

yes, it's unchecked

In debug session open the Modules window and see if the symbols are loaded

refer doc just to make sure all the required settings are configured appropriately.

I did all required options including in the symbol page. I added the path to my extracted pdb file from snupkg:

C:\Users\admin\source\repos\Test_2_8_0\mypackage.2.8.0-ci-145\lib\net461

When opening the Modules window, i find a message:

Cannot find or open the PDB file

Then i clicked "Symbol load information..", i find the path that i entered above show the message:

PDB does not match image.

So, why it does not match image although my workaround solution in my post is working. The pdb match the same dll extracted from both snupkg and nupkg packages.

It seems that some match logic is tested by VS for snupkg.

Note: It was working the the legacy pdb mypackage.symbol.nupkg , so i think it may be somethink special for snupk is done.

@kartheekp-ms kartheekp-ms removed the WaitingForCustomer Applied when a NuGet triage person needs more info from the OP label Mar 19, 2020
@moh-hassan
Copy link
Author

I resolved the issue.

The package is generated in CI appveyor for both windows and ubuntu 18.04.
It seems that Appveyor upload the packages from the last image (ubuntu) while I used the snupkg of windows. That is interpret why vs show PDB does not match image.

when I used snupkg of ubuntu image, VS 2019 load the symbol file correctly.
So, Vs 2019 can use snupkg correctly.

Thanks for help.
I can close my issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants