mjrousos / CppCliMigrationSample

Simple demonstration of C++/CLI on .NET Core
16 stars 10 forks source link

C++/CLI Net Core 3.1 dll includes reference to every dll included in framework #2

Closed amaitland closed 3 years ago

amaitland commented 3 years ago

Hi,

It wasn't clear on the best place to raise this so I'm hoping that you might be able to point me to the correct place. Apologies for opening in this repo.

When compiling a C++/CLI project using Net Core 3.1 and inspecting it's references in say dotPeek it lists every single dll that's part of the Microsoft.NETCore.App 3.1 framework (%ProgramFiles%\dotnet\packs\Microsoft.NETCore.App.Ref\3.1.0\ref\netcoreapp3.1). Building with .Net 4.x and the resulting dll only includes the required references.

This is rather undesirable as .Net 5.0 has removed support for some of these dlls (e.g. System.Runtime.InteropServices.WindowsRuntime) which I'm not using and yet show up in the references (everything shows up). I would like to also provide a .Net 5.0 targeted build however I'm getting a linker error which is possibly another bug.

I can also reproduce this with the netcore branch of this repo. My project is https://github.com/cefsharp/CefSharp

If you can point in the correct direction for where to discuss this that would be greatly appreciated.

Thanks, Alex


clicppnetcorerferences

System: Visual Studio: 16.8.3

dotnet --info .NET SDK (reflecting any global.json): Version: 5.0.101 Commit: d05174dc5a

Runtime Environment: OS Name: Windows OS Version: 10.0.19041 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\5.0.101\

Host (useful for support): Version: 5.0.1 Commit: b02e13abab

.NET SDKs installed: 5.0.100 [C:\Program Files\dotnet\sdk] 5.0.101 [C:\Program Files\dotnet\sdk]

.NET runtimes installed: Microsoft.AspNetCore.All 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

amaitland commented 3 years ago

I've opened https://github.com/dotnet/sdk/issues/15535