Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider using GenerateRuntimeConfigurationFiles instead of setting OutputType to Exe #15020

Open
Youssef1313 opened this issue Feb 28, 2025 · 3 comments

Comments

@Youssef1313
Copy link
Member

All VSTest cares about is having the runtimeconfig json file, AFAIK. For that, it uses the ugly trick of setting OutputType to Exe. This solution has been for many years, but it doesn't seem like it was a good idea. I think a better idea might be to set GenerateRuntimeConfigurationFiles to true so that the runtimeconfig.json is generated.

@nohwnd
Copy link
Member

nohwnd commented Feb 28, 2025

How sure are you this won't break us? :)

@Youssef1313
Copy link
Member Author

Can't say. That's why I opened an issue rather than a PR :)

@Youssef1313
Copy link
Member Author

One note is whether or not we delete the entry-point generation. In case the user is adding OutputType Exe in csproj, it will be breaking if we didn't generate the entrypoint. I'm not sure how common that scenario is though. But we may just keep the entrypoint generation under Condition="'$(OutputType)'=='Exe'".

Another note is interaction with MTP. Maybe some users of MSTest metapackage and MTP are relying on VSTest to set the OutputType for them. But I think it may be fine to break those as it's not a good idea, and eventually causes some other issues in certain scenarios where the .NET SDK has some logic relying on whether or not OutputType is Exe, but that logic of .NET SDK may be evaluated before VSTest is able to set OutputType. So it was already fragile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants