Stu
Stu

Reputation: 15769

WinForms designer error (cannot load resources)

I have a central DLL with all of our resources, automatically generated.

I have a UserControl that sets some of its properties from that DLL in its constructor. This UserControl loads in the designer just fine.

When I put the UserControl on a form, I cannot open that form in the designer. I get errors such as

Could not load type 'MyResourceType' from assembly 'MyResourceAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
Instances of this error (1)

  1. Hide Call Stack
    at MyUserControl..ctor()

Upvotes: 2

Views: 3421

Answers (3)

user3727875
user3727875

Reputation: 49

I Had the same problem. And i found out that I have old Dll on this folder.

C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE folder.

Soo delete them and it should fix the problem.

Upvotes: 1

Stu
Stu

Reputation: 15769

It turns out there was an old version of the resource DLL in the C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE folder. Deleting it and its PDB solved the issue.

Upvotes: 2

Ravi Gadag
Ravi Gadag

Reputation: 15851

reason for this problem:

A project is referencing either a class library project or a .dll with its .pdb available. When the debugger starts another version of the .dll that is referenced is being chosen. possible solutions, as i also experienced once,

i did like this

  • under VS -> tools/options/debugging/symbols you clear the cache. (Cache symbols in this directory line)
  • if you PDB with your dll's, you can copy to the dll location.

may be this will help you.

Upvotes: 1

Related Questions