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

Open
opened this Issue Nov 27, 2018 · 8 comments

Projects
None yet
2 participants

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?

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 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.
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 commented Dec 5, 2018

 Yes it is problaby best you replicate your self. Very easy. Make a net standard solution with a c# library projekt Open the csproj and change to net45 Enable “generate package on build” Add some silly code in it. Build Create solution in a different root path with a new droid project “. Bonus points if another drive. In VS add a nuget to the path where you built the previous package and add to your new droid project. Add a inline where you call the silly code in the nuget. Try to debug. It will work. Change the root folder name where your nuget was built. Even move drive if you want to be sure. It won’t work...
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: In this article, it mentions using nuget pack -symbols so symbols are included in the nupkg. Does your nupkg file have symbols in it? 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 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?
Contributor

jonathanpeppers commented Dec 5, 2018 • edited

 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 commented Dec 5, 2018 • edited

 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...