MissingManifestResourceException error with MenuStrip and how to fix it

100 Views Asked by At

I am trying to migrate old project (game editor) from visual studio 2008 with net 2.0 seems like to vs 2022 with net 4.8, sadly i am badly familiar with dotnet and got stuck with error during editor launch.

System.Resources.MissingManifestResourceException: 'Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "editor.window_ide.resources" was correctly embedded or linked into assembly "editor" at compile time, or that all the satellite assemblies required are loadable and fully signed.'

Problem in last line:

resources->ApplyResources(this->menuStrip, L"menuStrip"); this->menuStrip->Name = L"menuStrip";

Basicly seems all is created standart way with default editor namespace.. resources declared accordingly:

using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;

namespace editor {

    public ref class window_ide : public System::Windows::Forms::Form
    {
        typedef Form    super;
    public:
        window_ide( editor_world& world ) :
            m_editor_world          ( world )
        {
            InitializeComponent();
            //
            //TODO: Add the constructor code here
            //
            in_constructor  ( );
        }

    protected:
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        ~window_ide()
        {
            if (components)
            {
                delete components;
            }

            custom_finalize ( );
        }

private:
    /// <summary>
    /// Required designer variable.
    /// </summary>
    System::ComponentModel::Container^ components;

private: System::Windows::Forms::MenuStrip^  menuStrip;

#pragma region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        void InitializeComponent(void)
        {
                  System::ComponentModel::ComponentResourceManager^  resources = (gcnew System::ComponentModel::ComponentResourceManager(window_ide::typeid));

               // other declared components

          this->menuStrip = (gcnew System::Windows::Forms::MenuStrip());

          this->menuStrip->SuspendLayout();

          this->SuspendLayout();

            // menuStrip
this->menuStrip->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(5) {this->FileMenuItem, this->EditMenuItem, this->ViewMenuItem, this->ToolsMenuItem, this->HelpMenuItem});
            this->menuStrip->SuspendLayout();
            resources->ApplyResources(this->menuStrip, L"menuStrip");
            this->menuStrip->Name = L"menuStrip";
        }
#pragma endregion
};
} // namespace editor

I tried to edit resx file and change menuStrip.Name value to something like System.Windows.Forms.MenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 or just create MenuStrip string in resx and add the same thing to it.. though it didn't help, how this can be fixed? Sorry, i guess it could be dumb question.

1

There are 1 best solutions below

0
taburetka On

Figured this out, you need to check "Resource Logical Name" for .resx and set it manually or better create root namespace in macro for each project and also add it to .resx "logical name", something like: $(RootNamespace).%(Filename).resources.