我们不能再在Designer中打开WinForms表单,因为我们从. NET 7切换到. NET 8的几天.它似乎与VS 2022版本无关,因为我的同事对比我的17.9.3更老的版本有同样的问题.修复没有帮助.我们正在编译"AnyCPU".
以下排除Windows Defender也没有帮助.
Add-MpPreference -ExclusionProcess 'devenv.exe'
Add-MpPreference -ExclusionProcess 'DesignToolsServer.exe'
没有设置Switch.System.IO.UseLegacyPathHandling
.
"Windows窗体输出"显示以下内容:
[12:35:28.990802] warn: [NWWMain]: Encountered an additional TypeRoutingDefinition for 'Infragistics.Win.UltraWinGrid.GridControlCodeDomSerializer'
[12:35:28.999814] fail: [NWWMain]: Failed to launch design tools server process process
System.InvalidOperationException: Multiple instances of 'ICollectionEditorFactory' exported with the name 'SeriesCollectionEditor'.
at Microsoft.DotNet.DesignTools.Factories.ObjectFactoryManager`2.AddFactories(IEnumerable`1 factories, Boolean throwOnDuplicates)
at Microsoft.DotNet.DesignTools.Factories.ObjectFactoryManager`2..ctor(IEnumerable`1 factories)
at lambda_method1203(Closure, LifetimeContext, CompositionOperation)
at System.Composition.Hosting.Core.LifetimeContext.GetOrCreate(Int32 sharingId, CompositionOperation operation, CompositeActivator creator)
at System.Composition.TypedParts.ActivationFeatures.LifetimeFeature.<>c__DisplayClass1_0.<RewriteActivator>b__0(LifetimeContext c, CompositionOperation o)
at System.Composition.Hosting.Core.CompositionOperation.Run(LifetimeContext outermostLifetimeContext, CompositeActivator compositionRootActivator)
at System.Composition.Hosting.Core.LifetimeContext.TryGetExport(CompositionContract contract, Object& export)
at System.Composition.Hosting.CompositionHost.TryGetExport(CompositionContract contract, Object& export)
at System.Composition.CompositionContext.GetExport(CompositionContract contract)
at System.Composition.CompositionContext.GetExport(Type exportType, String contractName)
at System.Composition.CompositionContext.GetExport[TExport](String contractName)
at System.Composition.CompositionContext.GetExport[TExport]()
at Microsoft.WinForms.Utilities.Shared.Mef.CompositionHostExtensions.GetRequiredExport[TExport](CompositionHost compositionHost)
at Microsoft.DotNet.DesignTools.Server.DesignToolsServer.<StartUpAsync>g__AddMefServiceToContainer|48_0[T]()
at Microsoft.DotNet.DesignTools.Server.DesignToolsServer.StartUpAsync(Boolean testMode, CancellationToken cancellationToken)
at Microsoft.DotNet.DesignTools.Server.DesignToolsServer.StartListeningAsync(Stream stream, TraceListener traceListener)
at Microsoft.DotNet.DesignTools.Server.Program.<>c__DisplayClass2_0.<<Main>b__1>d.MoveNext()
For information on how to troubleshoot the designer refer to the guide at https://aka.ms/winforms/designer/troubleshooting.
[12:35:29.004803] fail: Microsoft.DotNet.DesignTools.Client.ServerException: Failed to launch the design tools server process.
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Threading.TplExtensions.<WithTimeout>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.DotNet.DesignTools.Client.Host.ServerProcess.<LaunchAsync>d__28.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.DotNet.DesignTools.Client.Host.ServerHostFactory.<CreateHostAsync>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.DotNet.DesignTools.Client.DesignToolsClientLoader.<CreateClientAsync>d__29.MoveNext()
For information on how to troubleshoot the designer refer to the guide at https://aka.ms/winforms/designer/troubleshooting.
[12:35:29.023802] warn: Cannot update selection in server process as Session is not connected.
[12:35:59.643728] warn: Cannot update selection in server process as Session is not connected.