You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TestInitialize/TestCleanup methods on base class in other assembly no longer executed as of MSTest v4? #7339
We have a shared assembly that defines a few base classes for unit tests (eg. an AAA base class).
This worked fine up to at least version 3.10.4 of MSTest.
Today, we tried upgrading to version 4.0.2 and we learned that the methods on our base classes that are annotated with TestInitializeAttribute and TestCleanupAttribute are no longer executed.
Like I already mentioned, our base classes are in a separate assembly.
I found no mention of this in the v3 to v4 migration guide, but is this an intentional breaking change (similar to what- at one point was changed for AssemblyInitialize)?
If this is not an intentional breaking change, I'd be happy to provide a repro.
Youssef Fahmy (@Youssef1313), we did more research and found out that it was caused by an assembly version mismatch between the version of MSTest that was used by our shared assembly and the version that was used by the actual test project.
Activity
Youssef1313 commentedon Feb 4, 2026
I'm unable to reproduce this. This project has the setup described in the issue, but init/cleanup of the base class are executed as expected.
Issue7339.zip
drieseng commentedon Feb 4, 2026
I'll verify and make a small git repo that you can use to reproduce the issue.
drieseng commentedon Feb 4, 2026
Youssef Fahmy (@Youssef1313), we did more research and found out that it was caused by an assembly version mismatch between the version of MSTest that was used by our shared assembly and the version that was used by the actual test project.
I'm sorry for wasting your time with this!