简体   繁体   中英

How to easily debug internal Nuget packages from Azure Devops

I work at a company where we have a monolithic application and I want to split it out into smaller web services / windows services / websites etc

I want to be 'smart' and re-use libraires contained in the monolith by putting them into their own class libraries and creating a NUGET package for them on build, using Azure Devops (although not entirely bound to this tool).

The main one I am attempting to isolate is the Data-Access Layer, as it is the most commonly used.

So far, the CI side will build one of my class libraries, and publish an incremented version number to a nuget feed I can connect to through VS.

The problem is, I cannot for the life of me figure out how to debug these nuget packages as if we were still debugging in the monolith - and we are all very used to being able to debug through the entire end-to-end of request -> response.

I think I essentially want to

  • Host a nuget package
  • Have it able to be built in DEBUG or RELEASE variants, (release on publish, debug during development)
  • Step into the library easily, with full source and variable watch abilities, as if we were still in the monolith design

I refuse to believe this isn't possible as I assume most companies who craft good code will surely do this, or am I thinking about it all wrong?

The only thing I've managed to find online is someone who actively copies nuget packages locally to his machine, builds them in debug and drags pdb files across - which would be more hassle than its worth and make me want to just 'stick to the monolith design'.

It depends on your expectations, or what you consider the definition of debugging. Say you're debugging and the bug is indeed in the package. Do you expect to be able to change a few lines of code of an assembly in the package, build a new version of your app using the dependency and run again? In that case no, it's not going to be as easy as that and you're best off keeping everything in a single solution, even if they're deployed as multiple services.

However, if you just mean using Visual Studio's debugger and being able to step into methods, then you can use the Azure DevOps Pipelines task to publish symbols . Note this is different to using a symbols package or snupkg like if you were publishing symbols to nuget.org. The Azure DevOps task is just copying the *.pdb directly to their symbol server. Each developer will also need to configure their VS one time to use the symbol server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM