-
Notifications
You must be signed in to change notification settings - Fork 998
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
OOP-Designer is unable to resolve assembly references when CopyLocal = false #12791
Comments
@furkane-3, no exception pops up when add the usercontrol from toolbox to Form1.cs[Design] page as below screenshot, |
Hi Zheng, Thank you for the response. It appears as though you have the projects under the same solution, which is different from the structure in the repro that I sent. What you have:
What I have:
Sorry for the confusion. We are doing this because we have domain-specific code in this separate Could you please try again with the project structure that I have suggested? Thanks! |
@Zheng-Li01 - please move this issue to the designer repo once you can repro it. |
@furkane-3, thanks for your response. and the issue can reproduce based on your description. just there still have a question need to confirm with you. in my testing, the usercontrol can be added successfully when setting the CopyLocal = false & Private = True or uncommand the Private = False in the .csproj file as below screenshot. so this issue seems related the Private filed setting? |
Hi @Zheng-Li01 , Glad to hear that! I think the
So in the case where you are able to add the UserControl with Please correct me if I am wrong. Thanks |
@Tanya-Solyanik could you please have a check for above results. if still need to open a GH DT issue to track this? |
Environment
Version 17.12.3
.NET version
.NET 8.0
Did this work in a previous version of Visual Studio and/or previous .NET release?
Yes, in .NET 4.7.2
Issue description
Hi,
We are currently migrating a WinForms solution from .NET Framework (472) to .NET Core (8.0), but we are having issues with the Out-of-Process Designer resolving assembly references to several DLL's that are the output of another solution.
We are opting to do it this way because we still want to maintain backwards compatibility with the Framework edition of our codebase. It is our understanding that the general recommendation is to use NuGet feeds and/or CopyLocal = True for the referenced assemblies, but this does not work for our use case since both methods are disruptive to our workflow.
We are wondering if there is a way to assist the Designer in resolving these assembly references by indicating to it to look for:
<MySharedOutputDir>\MyAssembly.dll
instead of
C:\Users\<user>\AppData\Local\Microsoft\VisualStudio\17.0_XXXX\WinFormsDesigner\UserAppData\MyAssembly.dll
?Thanks!
Steps to reproduce
I have attached a reproduction below that causes the error when I try to add a UserControl. which refers to a class in the external assembly, to a Form.
WinFormsDesignerIssueRepro.zip
Caveat
I understand this example is quite simple and we could probably work around it by putting the instantiation of
Class1
behind a check for DesignMode, but this would not work in our actual project due to the sheer complexity of refactoring it as such.Steps:
ClassLibrary
solution => OKWinFormsApp
solution => OKForm1.cs
with the Designer and try to drag theUserControl1
from theToolbox
onto itSome diagnostic output from procmon64.exe that confirms the issue has to to with resolving the assembly reference:
Temporary Workaround
WinFormsApp.csproj
do the following:WinFormsApp
solutionForm1.cs
in Designer and try to add theUserControl1
from the Toolbox onto it => OKDiagnostics
The text was updated successfully, but these errors were encountered: