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

xamarin nuget with symbols do not debug work unless source is in same location as original build source path #2460

Open
generik0 opened this Issue Nov 27, 2018 · 8 comments

Comments

Projects
None yet
2 participants
@generik0

generik0 commented Nov 27, 2018

Hi

When I create our own nuget packages I have GeneratePackageOnBuild and include symbols (portable) and include source for the .net stanadr projects creating the nugets.

The symbols and debugging works with "normal" .net apps., however, they are not debuggable in Xamavin project. With that said the symbols will work if I replicate the build path (on the service running the agent pool and MSBuild) to be on the same location on my local machine and add the source.

It does not matter what I enter in VS2017 15.9.2 Options->Debugger->Symbols
The absolute path from where the package was built, is required locally and the source code should be in this location locally also.

Again. we need to have the source code in the same location/path as it is on the build server. (this is difficult as each build has its own id) and it will work.
It does not matter if i index and do a seperate pack on the build server. Or whatever i do.

It just appears that the paths must be equal.

Any ideas?

@generik0 generik0 changed the title from xamarin symbols do not work unless source is in same location as original build source path to xamarin nuget with symbols do not debug work unless source is in same location as original build source path Nov 27, 2018

@jonathanpeppers jonathanpeppers added this to the far future milestone Dec 4, 2018

@jonathanpeppers

This comment has been minimized.

Contributor

jonathanpeppers commented Dec 4, 2018

@generik0 can you create a quick example project? or post a *.nupkg?

What value do you have set for DebugType? Options are full, portable, pdbonly, etc.

@generik0

This comment has been minimized.

generik0 commented Dec 4, 2018

@jonathanpeppers. I can but on holiday right now. Will get from college.
Used portable and full.
Both only work if the source code is in the same path as the build path.

I need a private email or something to send the nugets. I cannot send to an open forum.

@jonathanpeppers

This comment has been minimized.

Contributor

jonathanpeppers commented Dec 4, 2018

Both only work if the source code is in the same path as the build path.

Can you give a concrete example? XYZ is at path C:\foo\etc and ABC is at path C:\bar\etc.

I emailed you via the email listed on your Github account if you want to share nugets privately.

@generik0

This comment has been minimized.

generik0 commented Dec 5, 2018

Hi @jonathanpeppers.

Yes it is problaby best you replicate your self. Very easy.

  1. Make a net standard solution with a c# library projekt

  2. Open the csproj and change to net45

  3. Enable “generate package on build”

  4. Add some silly code in it.

  5. Build

  6. Create solution in a different root path with a new droid project “. Bonus points if another drive.

  7. In VS add a nuget to the path where you built the previous package and add to your new droid project.

  8. Add a inline where you call the silly code in the nuget.

  9. Try to debug. It will work.

  10. Change the root folder name where your nuget was built. Even move drive if you want to be sure. It won’t work...

@jonathanpeppers

This comment has been minimized.

Contributor

jonathanpeppers commented Dec 5, 2018

To make sure I follow: You are trying to step into the source code of the compiled NuGet?

This sounds like an IDE problem, and not really anything to do with Xamarin.Android.

A couple of things to try:

  1. In this article, it mentions using nuget pack -symbols so symbols are included in the nupkg. Does your nupkg file have symbols in it?
  2. In this SO question, they mention there is a setting in the IDE you have to point to a directory where your source code lives.

Hope that helps! Closing for now, as I think you would hit the same problem with a regular .NET console app. Feel free to comment if you find otherwise!

@generik0

This comment has been minimized.

generik0 commented Dec 5, 2018

@jonathanpeppers
No a regular console app does not have this issue. The IDE can open the src code from other locations than the exact build path.
This is an issue when specifically using the google Android emulator.

I am building the symbols package. I forgot to write for you to tick this in my steps. My mistake.

The settings pointing to the src code is filled out. But has no effect.

Once again this issue is isolated to the android emulator and VS nuget (with symbols) debugging.
The arrivals are all followed 100%. Did you at least try it yourself before closing?

@jonathanpeppers

This comment has been minimized.

Contributor

jonathanpeppers commented Dec 5, 2018

Sorry, the steps seem a bit vague to me... Did you take a look at the two links? You're doing what they suggest already?

@generik0 I do think it's best if you could make a quick reproduction project, so we can look into this further.

What $(DebugType) is your project using in Release mode? DebugType=portable works better with Mono/Xamarin.Android. A quick sample would be best, so the problem is isolated.

@generik0

This comment has been minimized.

generik0 commented Dec 5, 2018

Hi @jonathanpeppers
I am on holoday, so i have asked a colllegue to double check the VS Settings. I will get back to you ASAP.

We actually don’t build in release mode. Build in Debug ;-) and in .net standard the default when building package in debug appears to be portable now.
I have built in full also.

My colleague will double this check. Let me get back to us...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment