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

How do i debug against the source? #1293

Closed
TheoAndersen opened this issue Feb 10, 2016 · 6 comments
Closed

How do i debug against the source? #1293

TheoAndersen opened this issue Feb 10, 2016 · 6 comments

Comments

@TheoAndersen
Copy link

I've been trying to figure out how to run/debug against the source and have not found any information that seems to be working.

I have found this old blog entry (https://blogs.msdn.microsoft.com/webdev/2015/02/06/debugging-asp-net-5-framework-code-using-visual-studio-2015/).
But it dosen't seem to work. Sources is now called Projects in global.json it seems, but nothing changes when i enter a local src in there.

Is there any better resource on how to debug/run against the sources?

Thanks
/Theo

@pranavkm
Copy link
Contributor

Could you add what your global.json looks like? Also, have you tried restoring after you've updated global.json?

@TheoAndersen
Copy link
Author

I think ill just create a reference github project next, so you can see what I'm doing.

But first, what are the steps to debug against the source? Is it as stated in the article i mentioned, that you add the project into a solution, with a global.json with the source/projects property pointing at an array of paths?

Is there anything else one needs to do or setup?
Or is this described anyplace?

@pranavkm
Copy link
Contributor

That sounds about right. Once you restore, you should see VS include projects referenced as source in your solution.

@TheoAndersen
Copy link
Author

I just upgraded to Rc1-Update1 - and when scaffolding a new web application and adding source reference to the "projects" attribute of the global.json - it worked. Suddenly the core source code i had added the source to, was added to the solution

But i tried to add a solution to my existing aspnetcore project along with the global.json - and this didnt work - nothing happened.

How do i find out what is going wrong here? I cant seem to find anything in the restore logs. Is there any way to introspect what the "Restore" does with this to find errors like this?
It does seem rather magical what happens, and it dosen't really seem described anywhere - other than that old blogpost that is outdates (mentions "sources" and not "projects").

Is there another way of debugging against the "sources" that is not quite as 'magical'?

And why the solution dependency? i thought that the old solutions and projects was entirely out of the picture here? How does this work on mac/linux?

I would really love to be able to run against the sources on this. It seems the general documentation of aspnetcore is still a bit sparse, so its great to be able to look at the source too see whats happening behind the covers (and see why I'm using the api's wrongly) - but much better would be if i could do this in my dev environment (fx in Visual Studio) and be able to debug though it all.

If this isn't easy to do I'm afraid a lot of people will have a hard time contributing to aspnetcore.

/Theo

@pranavkm
Copy link
Contributor

But i tried to add a solution to my existing aspnetcore project along with the global.json - and this didnt work - nothing happened.

Sorry, I don't follow what this means.

If you run dnu restore or look in the Output window in VS, you should see the output from dnu. Most restore errors should show up as errors in the References node under the project (they would have an exclamation symbol). It doesn't seem particularly magical - you tell the restore here are additional locations to look for sources in. When resolving dependencies, it prefers source projects to NuGet packages and builds against the source. An alternative to using global.json would be to dnu pack the external dependency and get your application to reference this package.

Solutions are simply VS's way of keeping track of project. They don't affect what gets built or how things are resolved.

@aspnet-hello
Copy link

This issue is being closed because it has not been updated in 3 months.

We apologize if this causes any inconvenience. We ask that if you are still encountering this issue, please log a new issue with updated information and we will investigate.

dougbu added a commit to dotnet/extensions that referenced this issue Aug 11, 2019
- blocking dotnet/aspnetcore#1293 dependency update PR
- commit 3ec8c35 lost `AssemblyName` substitution
  - tasks assembly in package incorrectly named ".Manifest.Task.dll"
dougbu added a commit to dotnet/extensions that referenced this issue Aug 11, 2019
- blocking dotnet/aspnetcore#1293 dependency update PR
- commit 3ec8c35 lost `AssemblyName` substitution
  - tasks assembly in package incorrectly named ".Manifest.Task.dll"
@ghost ghost locked as resolved and limited conversation to collaborators Dec 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants