Reputation: 5212
Try to add new resource file, get this error immediately after adding
Try to add a new item into existing file, no error, but it doesn't run the custom tool
The properties of the resource file, which had been working all the while until yesterday's update
When I try to use the entry in my page, the newly added entry doesn't exist.
Microsoft Visual Studio Community 2022 Version 17.11.0 VisualStudio.17.Release/17.11.0+35208.52 Microsoft .NET Framework Version 4.8.09032
Installed Version: Community
ASP.NET and Web Tools 17.11.230.51983 ASP.NET and Web Tools
C# Tools 4.11.0-3.24374.1+f99bb16a395e48a05520ba7af1549b20bfdeee36 C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Razor (ASP.NET Core) 17.11.3.2436904+f07c7bb8e623ebcc1e1028cf11d101f866c77a79 Provides languages services for ASP.NET Core Razor.
Visual Studio IntelliCode 2.2 AI-assisted development for Visual Studio.
Answering my own question.
Temporary work around.
Some how it works for me.
Don't ask me way.
Upvotes: 3
Views: 3780
Reputation: 71
The new resource editor is indeed a proverbial pain in the backside. Even after a few more updates (currently on 7.11.5) its still buggy as f***.
Currently for me its even causing my entire Visual Studio to crash, loosing code in the proces.
For now my workaround is to open them trough right click -> open with and select Managed Resource Editor (Legacy). Just select this option and press the Default button to revert back to the classic editor as a default till Microsoft can wrap its head around and fix it.
Perhaps Microsoft can also learn to release features like this after a more extensive testing phase as should be done with all software development?
Upvotes: 7
Reputation: 61
I am developing the Resource Explorer there. Stumbled upon this question from here: https://developercommunity.visualstudio.com/t/Resource-file-cant-access-byte/10727183
I suspect the issue was that the Resource Explorer was adding your file as a System.String instead of a System.Byte[]. We have changed that, differentiating between a text file (System.String) and a file (System.Byte[]).
If you want to give it a try, the fix should be soon in the VS preview version (https://visualstudio.microsoft.com/vs/preview/#download-preview).
As for the old experience, it is still available through: Solution Explorer > right click the resource file > Open With... > Managed Resource Editor (Legacy). Hope this unblocks you!
If you have any other feedback on that experience, please consider opening feedback tickets at https://developercommunity.visualstudio.com/VisualStudio, mentioning "Resource Explorer" should come my way :) thanks!
Upvotes: 5
Reputation: 41
I also had problems with the resource file after updating to VS2022 ver 7.11.0
In my case, WPF desktop App, .Net 6.
I have a file Byte[] previously imported to the resource, that I later write out to disk using "WriteAllBytes()". If I use the original Byte[] file previously imported before update, all works fine. But if I replace the file using the new resource interface, the WriteAllBytes() function fails with the following:
System.MissingMethodException: 'Constructor on type 'System.Byte[]' not found.'
Similar problem occurs if I use WriteAllText() on a newly imported string file, (but works on previously imported strings file)
My solution was to rollback the update until a workaround or help on solving this can be found. RollBack can be done via the VS Installer.
Upvotes: 1