What is Microsoft.DependencyValidation.Analyser and why does Visual Studio 2017 force a package to be installed?

I just installed Visual Studio 2017 (on a new Windows 10 VM) in preparation for the 2015 upgrade path. Our existing project is using .Net 4.5.2. (ASP.NET classic / not Core)

VS 2017 seems to insist on adding the package dependency Microsoft.DependencyValidation.Analyser to every project in my current solution.

What is this addiction? Why projects? Canceling the check doesn't help, it just goes back and adds it again. If I register the package.config files with the change, will it break VS2015 if the team members don't make any updates?

+3


source to share


2 answers


Well, it turns out that the dark Visual Studio UI templates bounced off the shark.

Below is a heavily dramatized version of how to Microsoft.DependencyValidation.Analyzer

set magically ... well almost magically. (There are also answers to my questions above).

On a new virtual machine, you just loaded your solution from the original control and started it for the first time, you expect Nuget to alert you to reload dependencies. So you quickly skim the posts that appear on VS 2017, hey, you've been using it for 20 years, do you expect them to keep improving, do they have a spin? Well, out of the corner of your eyes, you see the words "Dependency" and "updated" highlighted in yellow above the decision manager.

Dependency check message

What do you do? Click on "Refresh" (thinking your Nuget packages are downloading ... sucker !!!) BOOM!

After 30 minutes, all of your 63 projects were checked out and they seem to have the same .config package.

You go wut. Try to undo checkout ... sorry Mate VS got you (r back) ... it returns code, reloads project and adds dependency again).

At first you don't understand what's going on. You get angry, you say that you repeat the same things for an hour, and finally you throw your laptop out of the window in the middle of the night and sob bitterly.

After a while, you slowly get up and bring the laptop back and through the cracked screen, you decide to close visual studio, reopen it, and try another branch of your code.

This time, you will carefully read the little yellow label and get the suspicion of not pressing the refresh button. You click on a link that takes you to a general page where you need to use Bing err Ctrl + F to search for a topic, which is just a general blog post. However, everything builds perfectly. And then it turns out what happened. Shivering from the cold draft from the broken window, but delighted that you "fixed" it, you throw everything in the air and call it night.



The next morning you start Visual Studio again. You are not downloading any solutions. Instead, you open the Source Control Explorer, uncheck, and hooray, everything is back, there will be no more volatile changes in your solution.

Happy and crying (the joy of success or the sorrows of a cracked screen and guts pouring out of a laptop) you open your solution and WHAM! That freaky yellow warning comes back again ... You stand there confused ... you scream ... in your head ... why-oh-why? I have a 3 member development team, I can literally walk up to someone and tell them that you shouldn't add this link because it breaks the esoteric pattern. But no ... I paid a gazillion pounds for an MSDN license, so my "Enterprise" software will insist on doing something that will

  • break everything for everyone else in the team (VS2017 Dependency voodoo is different from VS2015 version)
  • slow down your VM to crawl (it literally ran out of memory and crashed twice, just tried to build).
  • and give me more error messages than I need. I don't look at the error bar anymore because I can't tell if Visual Studio is really serious about the error or is just jerking my chains because the app is running (Yay Razor syntax check !!!)

At this point, you just cry ... and you don't know why ...

RANT END

If anyone from Visual Studio is reading here, this is what I want from Visual Studio (20 years old)

  • Fast loading (yes, I have 63 projects in my solution and I want them to load fast, no, I won't split them into different solutions).
  • Fast compiler (C # and Typescript is what I use, but you get it) I have gazillion GBs of memory, use it!
  • Consistent Intellisense (auto complete, maybe a leaflet from VSCode?) Anything else that takes part two extra is ruining my performance and I DO NOT want it to turn on, so please get out of my way!

It was already 20 years old, I think I shouldn't hold my breath!

PS I was able to track down a setting to turn off this warning, but I think the people who injected the property forgot to tell people in another building holding the solution explorer, so it doesn't work.

enter image description here

+6


source


If you have a data access project that needs to be fully agnostic for data persistence frameworks such as Entity Framework or ADO.NET or other technologies, how do you ensure that even one line of code hasn't been written that depends on these dependencies? You can write interfaces to be completely agnostic, but how do you get the developer to add a reference to ADO.NET?

This is what Microsoft.DependencyValidation.Analyser

will do for you. When you build it, it will analyze all projects and ensure that it does not depend on the assemblies that you ordered.

This ensures that your architecture is not just a pretty diagram, but that your developers actually follow it. This is not limited to ADO.NET and other large assemblies, but even assemblies that you create yourself.



You can tell Visual Studio to either give a warning when the architecture has been broken, or to compile it.

This is nothing new and was not, but I guess VS 2017 makes it easier to enforce rules like this. Whether this is a good idea or not depends on the project. If I am writing a quick disposable app or POC then I would disable it. But for a project that will require months of development and months to years of maintenance, this can be very helpful. However, some may disagree with me. The important breakaway is that he is a tool, if we need one.

More details here

+3


source







All Articles