If you get an error like this while upgrading Magenic/MAQS from V4 to V5:
Severity Code Description Project File Line Suppression State
Error Could not install package ‘Microsoft.Extensions.Configuration 2.1.1’. You are trying to install this package into a project that targets ‘.NETFramework,Version=v4.5’, but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
Tried clearing the NuGet cache in VS 2017 but that didn’t help.
Troy Walsh suggested this solution…
Unfortunately, there is no clean upgrade path from V4 to V5.
The team has made several big changes, such as moving to .Net Standard 2.0, lazy initialization of the web driver, support for multiple web drivers in a single test, slitting of the config file sections and adding support for .Net Core to name just a few.
So there are 2 ways to upgrade
The hard way:
- Make sure you are using VS2017 or above
- Update your projects to 4.61 or above – https://docs.microsoft.com/en-us/dotnet/standard/net-standard
- Update your using statments
using Magenic.MaqsFramework to using Magenic.Maqs
- Use the system under test configurations
Config.GetValue(“WebSiteBase”) to SeleniumConfig.GetWebSiteBase()
- Remove any project references to Microsoft.VisualStudio.QualityTools.UnitTestFramework
- Use nuget to add the MSTest.TestAdapter package
- Update your app.config so it has a Selenium specific section
- Set the App.config to copy always
The easy way:
- Install the latest MAQS templates. – https://marketplace.visualstudio.com/items?itemName=vs-publisher-1465771.MAQSOpenFramework
- Create a new project
Copy your code into the new project
Note* You will need to update your using statements and any place you use the config settings