testfx icon indicating copy to clipboard operation
testfx copied to clipboard

Remove DeploymentItem for .NET Core in MSTest v5

Open Youssef1313 opened this issue 2 months ago • 2 comments

I don't think this feature is reasonable for .NET Core. We should consider deprecating it for .NET Core in a future minor v4 release, and remove completely in v5.

Additionally, maybe we should even consider deprecating for .NET Framework when appdomain is not enabled.

Youssef1313 avatar Oct 18 '25 20:10 Youssef1313

I don't think the main motivation for the deprecation should be that appdomains don't exist in .NET Core. I've searched for deployment item mentions in multiple places, and I've never seen the internal details mentioned.

Instead we should understand what is the historical and intended usage of the attribute (IMHO the original intent is to isolate the binaries and files per test, so that the test can modify everything and not impact other tests).

That said searching for DeploymentItem on google will return two pages of results, all of those results complain about deployment item either being broken or non-obvious.

Websites and Articles

https://just-about.net/deploymentitem-a-tale-of-the-unexpected/

Do you know how to separate the knowing from the naive, the pros from the amateurs and the men from boys? It’s just by their reaction in certain situations. It’s the cold shivering and slight cough they get if you just whisper a single word, a word like “DeploymentItem”.

So what causes these reactions? Mortals would call it an attribute in MS Test. The most demonic one I have to add.

nohwnd avatar Oct 20 '25 11:10 nohwnd

I don't think the main motivation for the deprecation should be that appdomains don't exist in .NET Core.

My main motivation is that the feature wasn't designed or documented in a reasonable way, and it's very useless today. If we want to do it properly, I would consider as a completely new feature later when we have better design that is well understood in all scenarios.

Youssef1313 avatar Oct 20 '25 17:10 Youssef1313