Open IrisPeter opened 5 months ago
@IrisPeter Could you please confirm the TargetFramework
of the project - is it targeting .NET or .NET Framework? If it is targeting .NET Framework, are you using any project property which is causing out-of-process designer to be used?
Perhaps sharing your project file contents will help.
Also, is it feasible to use IsAncestorSiteInDesignMode property check around the code which tries to connect to the database? If the code is running in design mode, then probably it doesn't need to connect to the database and hence doesn't require the missing files?
Hi @Shyam-Gupta
The TargetFramework is .NET Framework 4.8
The situation is is that if the <UseWinFormsOutOfProcDesigner>True</UseWinFormsOutOfProcDesigner>
setting has not been generated by Visual Studio, and you double click on certain forms, such as a new blank form. Then the designer loads OK, and its only when you click on a certain number of our Forms that Visual Studio then trigger the prompt to use the Out of Forms designer.
The moment the UseWinFormsOutOfProcDesigner
flag has been set to true, then even a blank form will cause the login code to run.
Unfortunately there is no C# call stack to trace back to when the code is triggered, this is because the product is a mix of C, C++ and C# code and one of the Managed C++ components, triggers the standard C++ DLL with the login code in it.
In the login component I added an assert for when it discovers that it is running under Visual Studio that I can get any sort of call stack before VS2022 times out.
What kind of do I need to look for in the C# to wrap in this IsAncestorSiteInDesignMode
test?
The next item in our call stack is the _DllMainCRTStartup of our C++ DLL
Environment
Microsoft Visual Studio Professional 2022 Version 17.10.0 Preview 4.0 VisualStudio.17.Preview/17.10.0-pre.4.0+34814.14 Microsoft .NET Framework Version 4.8.09037
Installed Version: Professional
Visual C++ 2022 00476-80000-00000-AA711 Microsoft Visual C++ 2022
ASP.NET and Web Tools 17.10.319.52870 ASP.NET and Web Tools
C# Tools 4.10.0-3.24211.4+e482b6e281d7db727fcb086ebbfae44dcba82c6d C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
.NET version
.Net 4.8
Did this work in a previous version of Visual Studio and/or previous .NET release?
Visual Studio 2019
Issue description
We have an assembly that contains a number of Winforms in Visual Studio 2019 if we opened any of these forms they would appear in the designer.
Ever since upgrading to VS2022 with the new out of process designer if we open a form from this assembly then we see a blank form and some loading progress and eventually the designer times out.
Before the designer times out we see a messagebox that comes from one of the other components in our build which indicates that it has attempted to log on to our configured database.
Upon investigation I've found that the Winforms Cache contains many of the files and folders that exist in our Release folder however it is missing an .ini file and 3 xml files that describe how to connect to the database
Winforms Cache Location:
C:\Users\LoggedIn.User\AppData\Local\Microsoft\VisualStudio\17.0_4ef73b8c\WinFormsDesigner\vfsezbfw.g4p
Please provide a method to allow configuring cache to satisfy any special requirements.
If I copy the 3 missing files to the cache folder then the Form loads properly
Steps to reproduce
Diagnostics