This removes most of the web-specific info to a separate extension so that it can have web-related things co-located with it. The analyzers/codefixers are not self-contained, but that may require a bit more thinking as we distribute them. This is a first step towards organizing extensions by technology areas.
The resulting output looks like this:
```
upgrade-assistant
|- Microsoft.DotNet.UpgradeAssistant.Cli.dll
|- ....
|- extensions
|- default
|- [files]
|- web
|- [files]
```
We've had some churn recently in our extension framework. This updates the samples to build and work with the new model and adds them to the solution so that they'll continue to be built by CI in the future.
This seems to be causing problems with the way we're building our
extensions. Somehow it's detecting that we have a version when no
PackageReferences do. Since this is a preview feature, it appears we may
have hit a bug with that. For now, swapping back to non-centrally
managed versions allows for a more seamless inner dev-loop.
If an extension contains multiple assemblies, they will now resolve from within the extension thanks to a private load context. We want to ensure that we don't load a different version of anything the default context loads, so this checks for that as well.
This consolidates all the analyzers derived from `IdentifierUpgradeAnalyzer` and replaces them with a single analyzer/code fix provider for identifying and updating all cases where a type name needs replaced with a more modern equivalent.
It also updates this new `TypeUpgradeAnalyzer` to read the types to be replaced dynamically from additional texts so that users can easily extend the mapping of types to be replaced (by including a .typemap file in their project, including a .typemap additional file in their extension, or by registering an `AdditionalText` file with in UA's DI container).
This adds an additional codefixe for HttpContext.Current that helps to
refactor its usage to instead use method injection. The codefixe will
update calling methods to pass in HttpContext.Current, which can be
called multiple times to move HttpContext.Current up the stack.
This updates IdentifierUpgradeAnalyzer and IdentifierUpgradeCodeFixer to work with both C# and VB and consolidates ApiController analyzers and code fixers to use those base classes.
It also expands UA0013 analyzers and code fixers to handle both WebApi and MVC controllers.
We talked about combining all the IdentifierUpgrade analyzers and code fixers into one. I'll make that change in a follow-up PR to keep things manageable.
Fixes#514
This change removes CSharp from the name of the package as well as ensures the analzyer/codefixers are added for vb projects when added as NuGet packages.
This change moves the nuget reference retrieval back to non-async as the only async pathway we need is to ensure the restore is done. That has been moved now behind the the actual properties/methods that require that, which have in turn been turned into async.
This should be implicit and based on whether or not it's completed. When completed, delete it - it's only useful between project runs in the context of a solution.
This removes the need for extensions to be too aware of the fact that they are themselves extensions. This incorporates a builder pattern to register configuration that can be added to by other extensions and provides simpler access patterns.
This change refactors the package analyzer infrastructure to generalize it to any dependency. As part of this, the state and analyzer types are being moved to the abstractions layer so extensions may add implementations if they want.
This change does a couple of things to enable LTS/Current/Preview selection:
- Adds a command line argument to allow selection
- Maps the selected support model to identify the TFM that is needed
- Updates the PackageLoader to limit searches to results that match the TFMs in a project
This change replaces a simple record with `Name` to be one that includes
the parts that matter: FrameworkName, Version, Platform, PlatformVersion
This will then be formatted as needed in the property `Name`.
This change doesn't change too much for callers, but changes how a TFM is selected. Previously, one class held all the knowledge about how to select a TFM for a project. This swaps that out for a filter chain that can attempt to change the final result. Each of the filters can do whatever checks they may want, but the state that is passed through will only update the TFM if it is a higher or more constrained TFM.
This updates Upgrade Assistant to use the latest version of try-convert (which won't remove classic ASP.NET dependencies from libraries that keep a NetFx TFM) and adds additional package update analyzers to replace ASP.NET dependencies with ASP.NET Core ones after the TFM has been updated.
Fixes#347