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
With VSTest, test projects may have been special and requiring special hacks in SDK. For MTP though, it's just as any other typical console app and doesn't need any special handling, and the above may be actually hiding actual issues. In that case, we will need to make the special casing specific to VSTest via '$(IsTestProject)' == 'true' AND '$(IsTestingPlatformApplication)' != 'true'
Basically, if one Exe project references another Exe project, they will both go in the output folder. However, if one is self-contained and the other isn't, then one or both of them will fail to run.
I think with VSTest, test projects were (or could be) Exe projects, but the output wasn't run directly. With MTP projects, the output is actually run.
So, it does seem like it would make sense to re-enable this error for MTP projects. That means that if you're testing a SelfContained project, then your test project will also need to be SelfContained. But generating an error telling you the problem would be better than a weird hostfxr failure which may say it can't find the shared framework or something.
We need to revise usages of
IsTestProject
in SDK. For example:sdk/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets
Lines 1358 to 1368 in 0b58937
With VSTest, test projects may have been special and requiring special hacks in SDK. For MTP though, it's just as any other typical console app and doesn't need any special handling, and the above may be actually hiding actual issues. In that case, we will need to make the special casing specific to VSTest via
'$(IsTestProject)' == 'true' AND '$(IsTestingPlatformApplication)' != 'true'
There is also
sdk/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets
Lines 114 to 121 in 0b58937
sdk/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets
Line 98 in 0b58937
The text was updated successfully, but these errors were encountered: