-
Notifications
You must be signed in to change notification settings - Fork 10.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
Debug builds / local debugging? #9350
Comments
Hi @Sebazzz, I'm working on improvements to this repo and Microsoft.AspNetCore.App to make it easier for you to build and debug locally. Unfortunately, I think the 2.2 code is a bit of a mess. If you've managed to get things building so far, that's great, but you'll likely need to do a bit more to get a debug-able shared framework. Some questions:
|
Hi Nate. I did actually get it working somewhat, though it was rather more an art than a science though 🙃 This gist I made up for myself answers most of your questions: I did checkout the 2.2.0 tag. The Web project is here. |
As from the usability perspective: I don't mind checking out code, but I'd rather not build (primarily because of the large number of artifacts generated). I would like to simply point the build process to debug binaries (which would be a separate download, or NuGet version suffix whatever) and debug with that. |
Glad you got it working. You make an interesting point about publishing debug builds. Currently we only release optimized binaries and symbols. @Eilon @DamianEdwards @davidfowl what do you think about also producing and making available "debug" binaries/symbols for customers who want a better step-in experience with aspnetcore? Personally, I've run into the same issues. Source-link is good, but you can't set debug points on code that has been optimized away by the compiler. |
In the best case I'd prefer an approach which wouldn't modify your project but rather use some MSBuild property to link to different binaries. This wouldn't help with the shared framework approach, of course unless the assembly loader would also know to look up the binaries at a different location. But anything that is better than downloading the source and going through dozens of steps to get it working and debug binaries would already go a long way! |
@natemcmaster If they were on a different feed I would be fine with that. |
Having a separate feed isn’t sufficient on its own. NuGet cache uses package ID + package version. Unless we also published debug binaries with a unique package version or id, NuGet cached could easily end up with a non-deterministic mix of debug and release binaries. Setting up a separate build chain for debug packages with same sources but unique package versions wouldn’t be prohibitively difficult to set up, but it’s also not trivial and I don’t know if there is sufficient demand for it yet.
|
Are there other options to make debugging shared frameworks (or ASP.NET at all) more possible? I can't be the only one who needs to step in the sources. |
Another option—the one I’m working on for 3.0—is making it easier to build our source code locally. Other than that, I don’t see any. Either we build a debug build or you do.
I can't be the only one who needs to step in the sources.
As far as I’m aware, source link is working well enough for now for most people. As you mentioned, it has limitations when the compiler has optimized the code. But we can leave this open to see if there is sufficient demand for our team to do more to make debugging .NET easier.
|
Build was not really the issue, the instructions and process is sufficiently documented. The problem was actually getting the binaries and symbols in the right place, so the build process and debugger would pick it up while at the same time trying not to mess up my system-wide state (I don't want to replace my 2.2.0 system-wide binaries). One of the advantages of the local packages folder is that you would just overwrite the - for instance ASP.NET MVC - binaries with your own debug build and revert once you publish, or simply rely on your CI to do the publishing. Some documentation which shows what you can do to getting it build in the correct way and getting the binaries in the correct place would already help. |
Discussed in triage. There might be some debugger settings already available in Visual Studio or as an environment variable which would make source-link and debugging locals work better. I don't know what they are, but @Pilchie might. Aside from this, we're not sure how we would go able releasing debug binaries in a way that is usable. NuGet and the .NET Core runtime don't provide a way for you to easily switch from a release to debug version. |
The two things are:
This unfortunately does not help cases where the C# compiler does optimizations, but those tend to be a bit less of on issue than inlining, etc. Please give those a try and let us know how it goes. |
There doesn't seem to be any pending action items in this issue left and there hasn't been any recent activities. |
I'm trying to troubleshoot why I'm having authentication issues. For this I need to debug inside the ASP.NET Core libraries. Source link does not suffice because I need to go through many small inlined methods or async methods and the debugger can't make head or tails of the locals in each method or skips method calls altogether. So I need debug libraries and not the consumable release binaries.
I'm however confused how I can create a local build. I got as far as actually compiling the build and now have a bunch of 2.2.0-rtm-[number] NuGet packages, but how do I consume them from my project which uses the App metapackage which does not specify a version?
Perhaps this is an XY problem. Can I use builds from MyGet instead, are they not optimised?
In the
netframework
era it was easy, just compile the aspnetwebstack repo, disable strong name verification and copy the binaries to the local packages solution folder. Innetcoreapp1.1
you would simply check out the ASP.NET Core repositories you need and add the projects in the same solution or modify the global.json. Now we got the shared framework and metapackages, but I can't find any docs how I do the same.You can't just point NuGet to the local packages folder because it simply does not find the package, while nuget.exe lists the packages nicely:
This appears to be because it is probably looking into that shared-framework directory for this particular version (which it cannot find).
Using and asking for ASP.NET Core 2.2.0 here but I'm also interested in how this will work in netcoreapp3.0 and FrameworkReference based projects.
The text was updated successfully, but these errors were encountered: