dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.7k stars 1.06k forks source link

AssemblyName.exe.withSupportedRuntime.config files generated after migration to SDK style projects #27114

Open payn-git opened 2 years ago

payn-git commented 2 years ago

Issue Description

We have exe type projects which are part of our pipeline which during compilation produce AssemblyName.exe and AssemblyName.exe.config files. After migrating those projects to SDK style projects while target type or frameworks didn't change. System started to generated additional files with "exe.withSupportedRuntime.config" which are not expected by integration pipeline and build will fail.

Steps to Reproduce

compile SDK style exe type project which is defined for NET Framework 48

Attaching binary log from compilation of same project which is defined as old style and SDK to see how different output are produced.

Expected Behavior

exe.withSupportedRuntime.config files are not generated

Actual Behavior

exe.withSupportedRuntime.config is generated

Analysis

none

Versions & Configurations

Build Engine version 16.11.2+f32259642 for .NET Framework, Win 10 64bit. Project_NonSDKStyleProject.zip

Forgind commented 2 years ago

This seems like an SDK concept: https://github.com/dotnet/sdk/blame/main/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.GenerateSupportedRuntime.targets Moving there.

dsplaisted commented 2 years ago

It looks like this file is generated in the intermediate output directory. I wouldn't suggest having a build pipeline which fails based on what is written to the intermediate output folder. This might change over time and it's also not surprising that it changes when you switch to SDK style projects.

payn-git commented 1 year ago

This issue can be closed

Lumoryel commented 1 year ago

There is another problem: When using automatic binding redirects, then those redirects don't get into the exe.withSupportedRuntime.config. If I add the "Publihed Items" for an exe project in a Visual Studio Installer Setup Project, then this config is used (missing the binding redirects).