Migrated from MSTest v1: AssemblyInitialize method has wrong signature
See original GitHub issueDescription
We are trying to migrate our tests to MSTest v2. Our test assemblies use [AssemblyInitialize]
and after migration all our test are failing with the following message:
Method …InitializeAssembly has wrong signature. Parameter 1 should be of type Microsoft.VisualStudio.TestTools.UnitTesting.TestContext.
Our InitializeAssembly
method looks like this:
[AssemblyInitialize]
public static void InitializeAssembly(TestContext context)
{
// code
}
First of all, it does meet the requirements. Also, I noticed that the actual message in the current version of code looks slightly different.
This makes me think that Visual Studio somehow uses the old MSTest tooling despite the fact that our projects no longer reference Microsoft.VisualStudio.QualityTools.UnitTestFramework
and reference MSTest.TestFramework
and MSTest.TestAdapter
instead.
Environment
We are referencing MSTest packages version 1.1.14. The problem is present both in VS 2017 test runner and ReSharper test runner.
We are also using the old .csproj format. Is it possible that we need to make some additional migration changes in our csproj files?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:10 (6 by maintainers)
Top GitHub Comments
That’s great news @ivonin .
you can use the
DeploymentItemAttribute
for that. Adorn this on aTestClass
orTestMethod
that needs the folder\file deployed.We do throw out the following warning in the Output -> Tests pane when these settings are used.
Warning : A testsettings file or a runsettings with a ForcedLegacyMode set to true is not supported with the MSTest V2 Adapter.
Feel free to file a new issue if you run into other problems with the migration effort.