winforms
winforms copied to clipboard
Assembly resolving logic in Out-Of-Process WinForms Designer does not work for *.Resources.dll Assemblies
Environment
17.10.0 Preview 2.0
.NET version
.NET 8
Did this work in a previous version of Visual Studio and/or previous .NET release?
No response
Issue description
The assembly resolution logic in the Out-Of-Process WinForms Designer (DesignToolsServer) does not work when also using satellite assemblies with the Company.Resources.resources.dll
naming scheme when there is also a Company.Resources.dll
assembly.
In this case, the designer attempts to resolve types from the latter assembly even though the type is defined in the former.
Steps to reproduce
- Open the provided solution
- Drag&Drop
UserControl1.cs
from the Toolbox to the form
=> Exception
When deleting the .vs
directory before restarting Visual Studio it seems to work for some time before the same problem occurs.
Diagnostics
[13:33:52.019965] info: Creating VsDesignerLoader
[13:33:52.026965] info: BasicDesignerLoader.BeginLoad - Setting _loadDependencyCount to 0.
[13:33:52.027965] info: BasicDesignerLoader::BeginLoad - Calling AddLoadDependency
[13:33:52.027965] info: VsDesignerLoader::PerformLoad - Calling AddLoadDependency.
[13:33:52.027965] info: BasicDesignerLoader::BeginLoad - Calling DependentLoadComplete
[13:33:52.101963] info: [Company]: TypeResolution: type = System.Windows.Forms.Form, TimeTaken = 0 ms.
[13:33:52.101963] info: [Company]: TypeResolution: type = Microsoft.DotNet.DesignTools.Serialization.CodeDomSerializationProvider, TimeTaken = 0 ms.
[13:33:52.104963] info: [Company]: TypeResolution: type = System.Windows.Forms.Form, TimeTaken = 0 ms.
[13:33:52.104963] info: [Company]: TypeResolution: type = System.Windows.Forms.Form, TimeTaken = 0 ms.
[13:33:52.105963] info: [Company]: TypeResolution: type = System.ComponentModel.Design.IRootDesigner, TimeTaken = 0 ms.
[13:33:52.105963] info: [Company]: TypeResolution: type = System.ComponentModel.Design.IDesigner, TimeTaken = 0 ms.
[13:33:52.105963] info: [Company]: TypeResolution: type = System.ComponentModel.Design.IRootDesigner, TimeTaken = 0 ms.
[13:33:52.111962] info: [Company]: TypeResolution: type = System.ComponentModel.ComponentResourceManager, TimeTaken = 0 ms.
[13:33:52.111962] info: [Company]: TypeResolution: type = Microsoft.DotNet.DesignTools.Serialization.CodeDomSerializationProvider, TimeTaken = 0 ms.
[13:33:52.112962] info: [Company]: TypeResolution: type = System.Boolean, TimeTaken = 0 ms.
[13:33:52.112962] info: [Company]: TypeResolution: type = System.Drawing.SizeF, TimeTaken = 0 ms.
[13:33:52.112962] info: [Company]: TypeResolution: type = System.Drawing.Size, TimeTaken = 0 ms.
[13:33:52.112962] info: [Company]: TypeResolution: type = System.String, TimeTaken = 0 ms.
[13:33:52.112962] info: [Company]: TypeResolution: type = System.String, TimeTaken = 0 ms.
[13:33:52.112962] info: [Company]: TypeResolution: type = System.String, TimeTaken = 0 ms.
[13:33:52.112962] info: [Company]: TypeResolution: type = System.Boolean, TimeTaken = 0 ms.
[13:33:52.112962] info: [Company]: TypeResolution: type = System.Drawing.SizeF, TimeTaken = 0 ms.
[13:33:52.112962] info: [Company]: TypeResolution: type = System.Drawing.Size, TimeTaken = 0 ms.
[13:33:52.112962] info: [Company]: TypeResolution: type = System.String, TimeTaken = 0 ms.
[13:33:52.112962] info: [Company]: TypeResolution: type = System.String, TimeTaken = 0 ms.
[13:33:52.112962] info: [Company]: TypeResolution: type = System.String, TimeTaken = 0 ms.
[13:33:52.113962] info: [Company]: TypeResolution: type = System.ComponentModel.ComponentResourceManager, TimeTaken = 0 ms.
[13:33:52.114963] info: [Company]: TypeResolution: type = System.Windows.Forms.Form, TimeTaken = 0 ms.
[13:33:52.115963] info: [Company]: TypeResolution: type = System.Windows.Forms.AutoScaleMode, TimeTaken = 0 ms.
[13:33:52.162963] info: VsDesignerLoader::PerformLoad::LoadCompletionTask - Calling DependentLoadComplete.
[13:33:52.169962] info: InputShield handle created.
[13:33:53.330044] info: List of high priority assembly names:
[13:33:53.330044] info: System.Drawing.Common
[13:33:53.330044] info: System.Windows.Forms
[13:33:53.330044] info: Microsoft.DotNet.DesignTools.Server
[13:33:53.330044] info: System.ComponentModel.TypeConverter
[13:33:53.330044] info: System.Private.CoreLib
[13:33:53.330044] info: System.Drawing.Primitives
[13:33:53.330044] info: Company.UserInterface
[13:33:53.330044] info: ---List ends---
[13:33:53.343046] info: [Thread 1] Creating design-time ITypeResolutionService.
[13:33:53.346046] info: Start processing enqueued assemblies
[13:33:53.348047] info: Added 'Microsoft.WinForms.DesignTools.Protocol'
[13:33:53.349046] info: Added 'Microsoft.WinForms.DesignTools.Client'
[13:33:53.407047] info: [Thread 50] Launching server...
[13:33:53.505044] info: Shadow cache base directory: C:\Users\Default\AppData\Local\Microsoft\VisualStudio\17.0_26d18316\WinFormsDesigner
[13:33:53.506049] info: [Company]: Preparing shadow cache folder.
[13:33:53.506049] info: [Company]: NetCoreServerLayout - Platform: AnyCPU, Normalized PlatformName: x64
[13:33:53.506049] info: [Company]: Copying design tools server common files from: 'c:\program files\microsoft visual studio\2022\preview\common7\ide\commonextensions\microsoft\windows.forms\DesignToolsServer\Common'.
[13:33:53.532045] info: [Company]: Copying design tool server platform-specific files from: 'c:\program files\microsoft visual studio\2022\preview\common7\ide\commonextensions\microsoft\windows.forms\DesignToolsServer\x64'.
[13:33:53.534045] info: [Company]: Copying project output file: 'C:\Users\Default\source\repos\RnD.WinformsNET\Output\Debug\Company.dll'.
[13:33:53.535046] info: [Company]: Copying 'C:\Users\Default\source\repos\RnD.WinformsNET\Company\obj\Debug\Company.designer.deps.json' to 'DesignToolsServer.deps.json'
[13:33:53.535046] info: [Company]: Copying 'C:\Users\Default\source\repos\RnD.WinformsNET\Company\obj\Debug\Company.designer.runtimeconfig.json' to 'DesignToolsServer.runtimeconfig.json'
[13:33:53.536044] info: [Company]: Copying project reference: 'C:\Users\Default\source\repos\RnD.WinformsNET\Output\Debug\Company.UserInterface.dll'.
[13:33:53.537044] info: [Company]: Copying project reference: 'C:\Users\Default\source\repos\RnD.WinformsNET\Output\Debug\Company.UserInterface.Resources.dll'.
[13:33:53.538045] info: [Company]: Copying project reference: 'C:\Users\Default\source\repos\RnD.WinformsNET\Output\Debug\de\Company.UserInterface.Resources.resources.dll'.
[13:33:53.538045] info: [Company]: Copying project reference: 'C:\Users\Default\source\repos\RnD.WinformsNET\Output\Debug\de\Company.UserInterface.resources.dll'.
[13:33:53.564044] info: Shadow caching completed.
[13:33:53.564044] info: Obtained ServerConnectionTimeout value: 120000.
[13:33:53.564044] info: Obtained OutputWindowLoggingService.
[13:33:53.564044] info: [Company]: Launching design tools server process...
[13:33:53.697045] info: [Company]: Connected to named pipe: DesignToolsServer.e742fddc-df88-468a-840c-1da51b7942c1
[13:33:53.705044] info: [Company]: Connecting to pipe: DesignToolsServer.e742fddc-df88-468a-840c-1da51b7942c1...
[13:33:53.705044] info: [Company]: Successfully connected to pipe: DesignToolsServer.e742fddc-df88-468a-840c-1da51b7942c1
[13:33:53.708045] info: [Company]: Creating DesignToolsServer [thread 1]
[13:33:53.710045] info: [Company]: Starting UI thread [thread 1]
[13:33:53.712045] info: [Company]: Performing start up tasks [thread 7]
[13:33:53.732047] info: [Company]: UI thread started
[13:33:53.735048] info: [Company]: Loaded server manifest [thread 11]
[13:33:53.735048] info: [Company]: Loading design-time assemblies [thread 11]
[13:33:53.736048] info: [Company]: Wait for start up tasks to complete... [thread 7]
[13:33:53.881045] info: [Company]: Building MEF composition
[13:33:54.052048] info: [Company]: Start up tasks completed [thread 11]
[13:33:54.052048] info: [Company]: Initialize JsonRpc [thread 11]
[13:33:54.066046] info: [Company]: Start processing enqueued assemblies
[13:33:54.066046] info: [Company]: Listening for JSON RPC messages
[13:33:54.066046] info: [Company]: Design tools server process is running
[13:33:54.066046] info: [Company]: Design tools server process launch completed successfully.
[13:33:54.066046] info: [Thread 72] DesignToolsServer launch time = 659 ms.
[13:33:54.066046] info: [Thread 72] Initializing client...
[13:33:54.067046] info: [Thread 72] DesignToolsClient init time = 0 ms.
[13:33:54.067046] info: [Thread 72] Initializing server...
[13:33:54.089044] info: [Thread 30] DesignToolsServer init time = 22 ms.
[13:33:54.089044] info: [Thread 30] Populating server with style data...
[13:33:54.089044] info: [Company]: Added 'System.Private.CoreLib'
[13:33:54.124045] info: [Company]: Added 'System.Windows.Forms'
[13:33:54.127047] info: [Company]: Added 'System.Drawing'
[13:33:54.127047] info: [Company]: Added 'System.Drawing.Primitives'
[13:33:54.127047] info: [Company]: TypeResolution: type = System.Drawing.GraphicsUnit, TimeTaken = 7 ms.
[13:33:54.128045] info: [Company]: Added 'System.Drawing.Common'
[13:33:54.131046] info: [Company]: Added 'System.ComponentModel.TypeConverter'
[13:33:54.131046] info: [Company]: Added 'Company.UserInterface'
[13:33:54.131046] info: [Company]: Added 'System.ComponentModel.Primitives'
[13:33:54.131046] info: [Company]: Added 'System.ComponentModel'
[13:33:54.131046] info: [Company]: Added 'System.ComponentModel.EventBasedAsync'
[13:33:54.133046] info: [Company]: Added 'System.CodeDom'
[13:33:54.133046] info: [Company]: Added 'System.Diagnostics.EventLog.Messages'
[13:33:54.133046] info: [Company]: Added 'Accessibility'
[13:33:54.134048] info: [Company]: Added 'Microsoft.VisualBasic'
[13:33:54.139048] info: [Company]: Added 'System.Design'
[13:33:54.140048] info: [Company]: Added 'System.Drawing.Design'
[13:33:54.140048] info: [Company]: Added 'System.Windows.Forms.Design.Editors'
[13:33:54.140048] info: [Company]: Added 'Microsoft.Win32.Registry.AccessControl'
[13:33:54.140048] info: [Company]: Added 'Microsoft.Win32.SystemEvents'
[13:33:54.144045] info: [Company]: Added 'System.Configuration.ConfigurationManager'
[13:33:54.145046] info: [Company]: Added 'System.Diagnostics.EventLog'
[13:33:54.146047] info: [Company]: Added 'System.Diagnostics.PerformanceCounter'
[13:33:54.149048] info: [Company]: Added 'System.DirectoryServices'
[13:33:54.149048] info: [Company]: Added 'System.IO.Packaging'
[13:33:54.150048] info: [Company]: Added 'System.Resources.Extensions'
[13:33:54.152048] info: [Company]: Added 'System.Security.Cryptography.Pkcs'
[13:33:54.152048] info: [Company]: Added 'System.Security.Cryptography.ProtectedData'
[13:33:54.154046] info: [Company]: Added 'System.Security.Cryptography.Xml'
[13:33:54.154046] info: BasicDesignerLoader.BeginLoad - Setting _loadDependencyCount to 0.
[13:33:54.154046] info: BasicDesignerLoader::BeginLoad - Calling AddLoadDependency
[13:33:54.154046] info: VsDesignerLoader::PerformLoad - Calling AddLoadDependency.
[13:33:54.154046] info: BasicDesignerLoader::BeginLoad - Calling DependentLoadComplete
[13:33:54.165044] info: [Company]: Added 'System.Security.Permissions'
[13:33:54.165044] info: [Company]: Added 'System.Threading.AccessControl'
[13:33:54.166045] info: [Company]: Added 'System.Windows.Extensions'
[13:33:54.166045] info: [Company]: Added 'Microsoft.VisualBasic.Forms'
[13:33:54.169048] info: [Company]: TypeResolution: type = System.Windows.Forms.Form, TimeTaken = 0 ms.
[13:33:54.173045] info: [Company]: Added 'Microsoft.DotNet.DesignTools.Server'
[13:33:54.173045] info: [Company]: TypeResolution: type = Microsoft.DotNet.DesignTools.Serialization.CodeDomSerializationProvider, TimeTaken = 2 ms.
[13:33:54.175048] info: [Company]: Added 'System.Windows.Forms.Design'
[13:33:54.181045] info: [Company]: TypeResolution: type = System.Windows.Forms.Form, TimeTaken = 0 ms.
[13:33:54.187044] info: [Company]: Added 'System.Windows.Forms.Primitives'
[13:33:54.187044] info: [Company]: TypeResolution: type = System.Windows.Forms.Form, TimeTaken = 4 ms.
[13:33:54.190048] info: [Company]: Added 'DirectWriteForwarder'
[13:33:54.192123] info: [Company]: TypeResolution: type = System.ComponentModel.Design.IRootDesigner, TimeTaken = 0 ms.
[13:33:54.209046] info: [Company]: Added 'System'
[13:33:54.209046] info: [Company]: TypeResolution: type = System.ComponentModel.Design.IDesigner, TimeTaken = 17 ms.
[13:33:54.210049] info: [Company]: TypeResolution: type = System.ComponentModel.Design.IRootDesigner, TimeTaken = 0 ms.
[13:33:54.221048] info: [Company]: Added 'PresentationCore'
[13:33:54.221048] info: [Company]: Added 'PresentationFramework-SystemCore'
[13:33:54.221048] info: [Company]: Added 'PresentationFramework-SystemData'
[13:33:54.221048] info: [Company]: Added 'PresentationFramework-SystemDrawing'
[13:33:54.222048] info: [Company]: Added 'PresentationFramework-SystemXml'
[13:33:54.222048] info: [Company]: Added 'PresentationFramework-SystemXmlLinq'
[13:33:54.223049] info: [Company]: Added 'PresentationFramework.Aero'
[13:33:54.223049] info: [Company]: Added 'PresentationFramework.Aero2'
[13:33:54.223049] info: [Company]: Added 'PresentationFramework.AeroLite'
[13:33:54.224049] info: [Company]: Added 'PresentationFramework.Classic'
[13:33:54.224049] info: [Company]: Added 'PresentationFramework.Luna'
[13:33:54.224049] info: [Company]: Added 'PresentationFramework.Royale'
[13:33:54.275046] info: [Company]: Added 'PresentationFramework'
[13:33:54.275046] info: [Company]: TypeResolution: type = System.ComponentModel.ComponentResourceManager, TimeTaken = 9 ms.
[13:33:54.275046] info: [Company]: TypeResolution: type = Microsoft.DotNet.DesignTools.Serialization.CodeDomSerializationProvider, TimeTaken = 0 ms.
[13:33:54.278048] info: [Company]: Added 'PresentationUI'
[13:33:54.283047] info: [Company]: Added 'ReachFramework'
[13:33:54.301045] info: [Company]: Added 'mscorlib'
[13:33:54.301045] info: [Company]: TypeResolution: type = System.Boolean, TimeTaken = 16 ms.
[13:33:54.303047] info: [Company]: Added 'System.Printing'
[13:33:54.308047] info: [Company]: Added 'System.Windows.Controls.Ribbon'
[13:33:54.325046] info: [Company]: Added 'System.Windows.Input.Manipulations'
[13:33:54.325046] info: [Company]: TypeResolution: type = System.Drawing.SizeF, TimeTaken = 0 ms.
[13:33:54.325046] info: [Company]: Added 'System.Windows.Presentation'
[13:33:54.329048] info: [Company]: Added 'System.Xaml'
[13:33:54.330048] info: [Company]: TypeResolution: type = System.Drawing.Size, TimeTaken = 0 ms.
[13:33:54.330048] info: [Company]: TypeResolution: type = System.String, TimeTaken = 0 ms.
[13:33:54.330048] info: [Company]: TypeResolution: type = System.String, TimeTaken = 0 ms.
[13:33:54.331048] info: [Company]: Added 'UIAutomationClient'
[13:33:54.331048] info: [Company]: TypeResolution: type = System.String, TimeTaken = 0 ms.
[13:33:54.332048] info: [Company]: TypeResolution: type = System.Boolean, TimeTaken = 0 ms.
[13:33:54.332048] info: [Company]: TypeResolution: type = System.Drawing.SizeF, TimeTaken = 0 ms.
[13:33:54.332048] info: [Company]: TypeResolution: type = System.Drawing.Size, TimeTaken = 0 ms.
[13:33:54.332048] info: [Company]: TypeResolution: type = System.String, TimeTaken = 0 ms.
[13:33:54.332048] info: [Company]: TypeResolution: type = System.String, TimeTaken = 0 ms.
[13:33:54.332048] info: [Company]: TypeResolution: type = System.String, TimeTaken = 0 ms.
[13:33:54.334048] info: [Company]: Added 'UIAutomationClientSideProviders'
[13:33:54.334048] info: [Company]: TypeResolution: type = System.ComponentModel.ComponentResourceManager, TimeTaken = 0 ms.
[13:33:54.334048] info: [Company]: Added 'UIAutomationProvider'
[13:33:54.336048] info: [Company]: Added 'UIAutomationTypes'
[13:33:54.344046] info: [Company]: Added 'WindowsBase'
[13:33:54.344046] info: [Company]: TypeResolution: type = System.Windows.Forms.Form, TimeTaken = 2 ms.
[13:33:54.345048] info: [Company]: Added 'WindowsFormsIntegration'
[13:33:54.345048] info: [Company]: Added 'Microsoft.Win32.Primitives'
[13:33:54.348046] info: [Company]: TypeResolution: type = System.Windows.Forms.AutoScaleMode, TimeTaken = 0 ms.
[13:33:54.363045] info: TypeResolution: type = System.ComponentModel.Design.IRootDesigner not found, TimeTaken = 0 ms.
[13:33:54.363045] info: TypeResolution: type = System.ComponentModel.Design.IRootDesigner, TimeTaken = 0 ms.
[13:33:54.363045] info: TypeResolution: type = System.Windows.Forms.Design.FormDocumentDesigner not found, TimeTaken = 0 ms.
[13:33:54.363045] info: TypeResolution: type = System.Windows.Forms.Design.FormDocumentDesigner, TimeTaken = 0 ms.
[13:33:54.367046] info: VsDesignerLoader::PerformLoad::LoadCompletionTask - Calling DependentLoadComplete.
[13:33:54.369049] info: [Company]: Added 'netstandard'
[13:33:54.369049] info: [Company]: Added 'System.AppContext'
[13:33:54.369049] info: [Company]: Added 'System.Buffers'
[13:33:54.370048] info: [Company]: Added 'System.ComponentModel.DataAnnotations'
[13:33:54.370048] info: [Company]: Added 'System.Configuration'
[13:33:54.372049] info: [Company]: Added 'System.Core'
[13:33:54.372049] info: [Company]: Added 'System.Data.DataSetExtensions'
[13:33:54.394045] info: InputShield handle created.
[13:33:54.410045] info: [Company]: Added 'System.Data'
[13:33:54.410045] info: [Company]: Added 'System.Diagnostics.Contracts'
[13:33:54.410045] info: [Company]: Added 'System.Diagnostics.Debug'
[13:33:54.410045] info: [Company]: Added 'System.Diagnostics.Tools'
[13:33:54.411049] info: [Company]: Added 'System.Diagnostics.Tracing'
[13:33:54.411049] info: [Company]: Added 'System.Dynamic.Runtime'
[13:33:54.411049] info: [Company]: Added 'System.Globalization.Calendars'
[13:33:54.411049] info: [Company]: Added 'System.Globalization'
[13:33:54.411049] info: [Company]: Added 'System.Globalization.Extensions'
[13:33:54.411049] info: [Company]: Added 'System.IO.Compression.FileSystem'
[13:33:54.411049] info: [Company]: Added 'System.IO'
[13:33:54.411049] info: [Company]: Added 'System.IO.FileSystem'
[13:33:54.411049] info: [Company]: Added 'System.IO.FileSystem.Primitives'
[13:33:54.411049] info: [Company]: Added 'System.IO.Pipes.AccessControl'
[13:33:54.411049] info: [Company]: Added 'System.IO.UnmanagedMemoryStream'
[13:33:54.412047] info: [Company]: Added 'System.Net'
[13:33:54.412047] info: [Company]: Added 'System.Numerics'
[13:33:54.412047] info: [Company]: Added 'System.Numerics.Vectors'
[13:33:54.412047] info: [Company]: Added 'System.Reflection'
[13:33:54.412047] info: [Company]: Added 'System.Reflection.Emit.ILGeneration'
[13:33:54.412047] info: [Company]: Added 'System.Reflection.Emit.Lightweight'
[13:33:54.412047] info: [Company]: Added 'System.Reflection.Extensions'
[13:33:54.412047] info: [Company]: Added 'System.Reflection.Primitives'
[13:33:54.412047] info: [Company]: Added 'System.Resources.Reader'
[13:33:54.412047] info: [Company]: Added 'System.Resources.ResourceManager'
[13:33:54.412047] info: [Company]: Added 'System.Runtime.CompilerServices.Unsafe'
[13:33:54.413049] info: Time taken for server restart and designer reload = 1086 ms.
[13:33:54.413049] info: Enabling designer reload on idle.
[13:33:54.417047] info: [Company]: Added 'System.Runtime'
[13:33:54.417047] info: [Company]: Added 'System.Runtime.Extensions'
[13:33:54.417047] info: [Company]: Added 'System.Runtime.Handles'
[13:33:54.417047] info: [Company]: Added 'System.Runtime.InteropServices.RuntimeInformation'
[13:33:54.417047] info: [Company]: Added 'System.Runtime.Intrinsics'
[13:33:54.417047] info: [Company]: Added 'System.Runtime.Loader'
[13:33:54.419049] info: [Company]: Added 'System.Runtime.Serialization'
[13:33:54.419049] info: [Company]: Added 'System.Runtime.Serialization.Json'
[13:33:54.419049] info: [Company]: Added 'System.Runtime.Serialization.Xml'
[13:33:54.419049] info: [Company]: Added 'System.Security.Cryptography.Algorithms'
[13:33:54.420049] info: [Company]: Added 'System.Security.Cryptography.Cng'
[13:33:54.420049] info: [Company]: Added 'System.Security.Cryptography.Csp'
[13:33:54.420049] info: [Company]: Added 'System.Security.Cryptography.Encoding'
[13:33:54.420049] info: [Company]: Added 'System.Security.Cryptography.OpenSsl'
[13:33:54.420049] info: [Company]: Added 'System.Security.Cryptography.Primitives'
[13:33:54.420049] info: [Company]: Added 'System.Security.Cryptography.X509Certificates'
[13:33:54.421046] info: [Company]: Added 'System.Security'
[13:33:54.421046] info: [Company]: Added 'System.Security.Principal'
[13:33:54.421046] info: [Company]: Added 'System.Security.SecureString'
[13:33:54.432049] info: [Company]: Added 'System.ServiceModel.Web'
[13:33:54.435049] info: [Company]: Added 'System.ServiceProcess'
[13:33:54.435049] info: [Company]: Added 'System.Text.Encoding'
[13:33:54.435049] info: [Company]: Added 'System.Text.Encoding.Extensions'
[13:33:54.435049] info: [Company]: Added 'System.Threading.Overlapped'
[13:33:54.435049] info: [Company]: Added 'System.Threading.Tasks'
[13:33:54.436049] info: [Company]: Added 'System.Threading.Tasks.Extensions'
[13:33:54.436049] info: [Company]: Added 'System.Threading.Thread'
[13:33:54.436049] info: [Company]: Added 'System.Threading.ThreadPool'
[13:33:54.436049] info: [Company]: Added 'System.Threading.Timer'
[13:33:54.436049] info: [Company]: Added 'System.Transactions'
[13:33:54.436049] info: [Company]: Added 'System.ValueTuple'
[13:33:54.436049] info: [Company]: Added 'System.Web'
[13:33:54.436049] info: [Company]: Added 'System.Windows'
[13:33:54.437049] info: [Company]: Added 'System.Xml'
[13:33:54.437049] info: [Company]: Added 'System.Xml.Linq'
[13:33:54.438049] info: [Company]: Added 'System.Xml.ReaderWriter'
[13:33:54.438049] info: [Company]: Added 'System.Xml.Serialization'
[13:33:54.438049] info: [Company]: Added 'System.Xml.XDocument'
[13:33:54.438049] info: [Company]: Added 'System.Xml.XmlDocument'
[13:33:54.438049] info: [Company]: Added 'System.Xml.XmlSerializer'
[13:33:54.438049] info: [Company]: Added 'System.Xml.XPath'
[13:33:54.442048] info: [Company]: Added 'Microsoft.CSharp'
[13:33:54.443049] info: [Company]: Added 'Microsoft.VisualBasic.Core'
[13:33:54.443049] info: [Company]: Added 'Microsoft.Win32.Registry'
[13:33:54.444048] info: [Company]: Added 'System.Collections.Concurrent'
[13:33:54.445045] info: [Company]: Added 'System.Collections'
[13:33:54.451046] info: [Company]: Added 'System.Collections.Immutable'
[13:33:54.451046] info: [Company]: Added 'System.Collections.NonGeneric'
[13:33:54.452045] info: [Company]: Added 'System.Collections.Specialized'
[13:33:54.452045] info: [Company]: Added 'System.ComponentModel.Annotations'
[13:33:54.452045] info: [Company]: Added 'System.Console'
[13:33:54.456045] info: [Company]: Added 'System.Data.Common'
[13:33:54.458046] info: [Company]: Added 'System.Diagnostics.DiagnosticSource'
[13:33:54.458046] info: [Company]: Added 'System.Diagnostics.FileVersionInfo'
[13:33:54.459046] info: [Company]: Added 'System.Diagnostics.Process'
[13:33:54.459046] info: [Company]: Added 'System.Diagnostics.StackTrace'
[13:33:54.459046] info: [Company]: Added 'System.Diagnostics.TextWriterTraceListener'
[13:33:54.459046] info: [Company]: Added 'System.Diagnostics.TraceSource'
[13:33:54.459046] info: [Company]: Added 'System.Formats.Asn1'
[13:33:54.460046] info: [Company]: Added 'System.Formats.Tar'
[13:33:54.460046] info: [Company]: Added 'System.IO.Compression.Brotli'
[13:33:54.461046] info: [Company]: Added 'System.IO.Compression'
[13:33:54.461046] info: [Company]: Added 'System.IO.Compression.ZipFile'
[13:33:54.461046] info: [Company]: Added 'System.IO.FileSystem.AccessControl'
[13:33:54.461046] info: [Company]: Added 'System.IO.FileSystem.DriveInfo'
[13:33:54.462046] info: [Company]: Added 'System.IO.FileSystem.Watcher'
[13:33:54.462046] info: [Company]: Added 'System.IO.IsolatedStorage'
[13:33:54.462046] info: [Company]: Added 'System.IO.MemoryMappedFiles'
[13:33:54.462046] info: [Company]: Added 'System.IO.Pipes'
[13:33:54.463046] info: [Company]: Added 'System.Linq'
[13:33:54.469045] info: [Company]: Added 'System.Linq.Expressions'
[13:33:54.475045] info: [Company]: Added 'System.Linq.Parallel'
[13:33:54.475045] info: [Company]: Added 'System.Linq.Queryable'
[13:33:54.475045] info: [Company]: Added 'System.Memory'
[13:33:54.493048] info: [Company]: Added 'System.Net.Http'
[13:33:54.494046] info: [Company]: Added 'System.Net.Http.Json'
[13:33:54.495045] info: [Company]: Added 'System.Net.HttpListener'
[13:33:54.497045] info: [Company]: Added 'System.Net.Mail'
[13:33:54.497045] info: [Company]: Added 'System.Net.NameResolution'
[13:33:54.498045] info: [Company]: Added 'System.Net.NetworkInformation'
[13:33:54.498045] info: [Company]: Added 'System.Net.Ping'
[13:33:54.499045] info: [Company]: Added 'System.Net.Primitives'
[13:33:54.503044] info: [Company]: Added 'System.Net.Quic'
[13:33:54.504046] info: [Company]: Added 'System.Net.Requests'
[13:33:54.506045] info: [Company]: Added 'System.Net.Security'
[13:33:54.506045] info: [Company]: Added 'System.Net.ServicePoint'
[13:33:54.507045] info: [Company]: Added 'System.Net.Sockets'
[13:33:54.507045] info: [Company]: Added 'System.Net.WebClient'
[13:33:54.507045] info: [Company]: Added 'System.Net.WebHeaderCollection'
[13:33:54.507045] info: [Company]: Added 'System.Net.WebProxy'
[13:33:54.507045] info: [Company]: Added 'System.Net.WebSockets.Client'
[13:33:54.508046] info: [Company]: Added 'System.Net.WebSockets'
[13:33:54.508046] info: [Company]: Added 'System.ObjectModel'
[13:33:54.513044] info: [Company]: Added 'System.Private.DataContractSerialization'
[13:33:54.513044] info: [Company]: Added 'System.Private.Uri'
[13:33:54.531045] info: [Company]: Added 'System.Private.Xml'
[13:33:54.531045] info: [Company]: Added 'System.Private.Xml.Linq'
[13:33:54.532046] info: [Company]: Added 'System.Reflection.DispatchProxy'
[13:33:54.532046] info: [Company]: Added 'System.Reflection.Emit'
[13:33:54.538046] info: [Company]: Added 'System.Reflection.Metadata'
[13:33:54.538046] info: [Company]: Added 'System.Reflection.TypeExtensions'
[13:33:54.538046] info: [Company]: Added 'System.Resources.Writer'
[13:33:54.538046] info: [Company]: Added 'System.Runtime.CompilerServices.VisualC'
[13:33:54.539046] info: [Company]: Added 'System.Runtime.InteropServices'
[13:33:54.540045] info: [Company]: Added 'System.Runtime.InteropServices.JavaScript'
[13:33:54.540045] info: [Company]: Added 'System.Runtime.Numerics'
[13:33:54.541046] info: [Company]: Added 'System.Runtime.Serialization.Formatters'
[13:33:54.541046] info: [Company]: Added 'System.Runtime.Serialization.Primitives'
[13:33:54.541046] info: [Company]: Added 'System.Security.AccessControl'
[13:33:54.541046] info: [Company]: Added 'System.Security.Claims'
[13:33:54.545049] info: [Company]: Added 'System.Security.Cryptography'
[13:33:54.546049] info: [Company]: Added 'System.Security.Principal.Windows'
[13:33:54.547049] info: [Company]: Added 'System.Text.Encoding.CodePages'
[13:33:54.547049] info: [Company]: Added 'System.Text.Encodings.Web'
[13:33:54.550047] info: [Company]: Added 'System.Text.Json'
[13:33:54.552046] info: [Company]: Added 'System.Text.RegularExpressions'
[13:33:54.553046] info: [Company]: Added 'System.Threading.Channels'
[13:33:54.553046] info: [Company]: Added 'System.Threading'
[13:33:54.556046] info: [Company]: Added 'System.Threading.Tasks.Dataflow'
[13:33:54.556046] info: [Company]: Added 'System.Threading.Tasks.Parallel'
[13:33:54.558049] info: [Company]: Added 'System.Transactions.Local'
[13:33:54.559048] info: [Company]: Added 'System.Web.HttpUtility'
[13:33:54.559048] info: [Company]: Added 'System.Xml.XPath.XDocument'
[13:33:54.559048] info: [Company]: Added 'Company'
[13:33:54.559048] info: [Company]: Added 'Company.UserInterface.resources'
[13:33:54.559048] info: [Company]: Added 'Company.UserInterface.Resources.resources'
[13:33:57.588373] info: [Company]: TypeResolution: type = Company.UserInterface.UserControl1, TimeTaken = 0 ms.
[13:33:57.589372] info: [Company]: TypeResolution: type = Company.UserInterface.UserControl1, TimeTaken = 0 ms.
[13:33:57.594373] fail: Request failures: DesignerHosts/CreateComponent.
Microsoft.DotNet.DesignTools.Client.DesignToolsServerException: Could not load type 'Company.UserInterface.Resources.EnumType' from assembly 'Company.UserInterface.resources, Version=1.0.0.0, Culture=de, PublicKeyToken=null'.
For information on how to troubleshoot the designer refer to the guide at https://aka.ms/winforms/designer/troubleshooting.
@Olina-Zhang can you get this copied into the designer repo?
@SteffenSchwaiger I used the solution you provided by dragging and dropping UserControl1.cs from the Toolbox to the form with no exceptions. So want to confirm with you if I got the right point for your problem.
https://github.com/dotnet/winforms/assets/108860782/3393a394-c880-481d-a72c-a4bce66ad7c7
@MandiMan I just downloaded the sample repo again and was able to reproduce the problem with preview 2.0 and 3.0 BUT the fresh preview 4.0 does not seem to have the problem anymore. I will see if the problem reoccurs after some time, and if not, I will close this issue.
Unfortunately, I am still able to reproduce the problem and I am 100% sure that the shadow cache implementation is the problem. In my case, only the following assemblies are present:
You may already see the problem. Company.UserInterface.resources.dll
is missing (notice the small 'r') because it was overwritten (?) by Company.UserInterface.Resources.dll
. Which of the two assemblies "wins" does not seem to be deterministic. Also, the filename case may be incorrect, making it even more difficult to understand what's happening. See the following ILSpy output for what appears to be a main assembly based on the filename (big 'R'), but actually contains localization data and is a satellite assembly.
Extended repro steps:
- Open the provided sample solution
- Open
Form1
- Drag&Drop
UserControl1
This might have already triggered the exception, if not continue:
- Remove the
UserControl1
from the form - Switch the form to
Language: German
- Drag&Drop
UserControl1
An exception should have occurred by now at the latest.
Hacky workaround:
NTFS supports case-sensitive filenames on Windows 10 if you explicitly enable it for certain directories. If I do this for the WinFormsDesigner
directory (e.g. C:\Users\Default\AppData\Local\Microsoft\VisualStudio\17.0_26d18316\WinFormsDesigner
) everything seems to work as expected.
C:\Windows\system32>fsutil.exe file setCaseSensitiveInfo C:\Users\Default\AppData\Local\Microsoft\VisualStudio\17.0_26d18316\WinFormsDesigner enable
The shadow cache directory in this case will contain the missing file.
@SteffenSchwaiger Unfortunately I still can't reproduce your problem on VS 17.10.0 Preview 3.0 and 17.10.0 Preview 4.0.
17.10.0 Preview 3.0:
17.10.0 Preview 4.0:
@MandiMan I have a new way how to reproduce it hopefully.
- download and open the original repro solution
- switch the form language to
German
- change
Enabled
toFalse
- save and close the
Form1
designer tab - open the designer for
Form1
again (German is still active) - reset the language to
(Default)
and save - Rebuild
- close the
Form1
designer tab and reopen it - switch the form language to
German
- reset
Enabled
to its original state (True
) - reset the language to
English
and save - Drag & Drop
UserControl1
=> Exception
@SteffenSchwaiger Ok, I have successfully reproduced your issue based on the steps you provided in your latest update
@merriemcgaw Filed a DT issue: 5937 for this issue.