Using WinForms Controls provided via NuGet inside the Out-Of-Process Designer without copying them to the build output #11319
Labels
area-DesignerSupport
area-VSDesigner
Windows Forms out-of-proc designer related issues
tenet-compatibility
Incompatibility with previous versions or with WinForms for .NET Framework
Milestone
Environment
17.10.0 Preview 6.0
.NET version
8.0
Did this work in a previous version of Visual Studio and/or previous .NET release?
.NET Framework
Issue description
I cannot find a way to use WinForms controls inside my plugin project that are provided by the main application without including them in the project build output and therefore also distributing them via
dotnet publish
. They are only "compile time" dependencies as they are provided by the main application when the plugin is loaded inside it.In the .NET Framework, I was able to provide the WinForms controls inside a NuGet package in the
ref
folder so that they were not copied to the build output. After wondering why this did not work after migrating to .NET 8, I finally found the Control Library NuGet Package Spec and found out that they need to be distributed inside thelib
folder because the new WinForms Out-Of-Process .NET Designer needs them at "runtime".This requirement conflicts with the documentation on how to structure plugin projects available here: Create a .NET Core application with plugins, as it says there:
When I use
<ExcludeAssets>runtime</ExcludeAssets>
for my winforms control library, thelib
content is not copied to the build output anymore (good), but the WinForms Out-Of-Process .NET Designer is also not working anymore (bad). The controls are listed inside the toolbox, but fail to be instanciated which might be expected by the current architecture.What is the suggested approach for solving this constellation?
Steps to reproduce
Install any NuGet package that contains UI controls (e.g. ReaLTaiizor) and try to exclude them from the build output while still being able to use them in the Out-Of-Process Designer.
Diagnostics
No response
The text was updated successfully, but these errors were encountered: