Got another problem. I had almost finished my project but felt like I had to change the namespace of the project. But instead of using refactor --> rename , I selected my namespace, edit --> find and replace and replaced my whole solution with a different namespace (so everywhere in the solution where for example the namespace or text "name1" exists, is now changed into "name2").
But now I get around 16 errors all saying the same thing: "The type or namespace "resources" does not exist in namespace name1".
this.centerPanel.BackgroundImage = global::login_DragDrop.Properties.Resources.oeftest;
So for example in this line of code (mainly in the designer.cs) resources is colored red?
Any hints on how to fix this?
You need to run the code generation on the resource file to get the correct namespace there as well.
Follow these steps:
This runs the code generation for the resource files again. The generated code makes that you have strongly typed access to the values in your resource strings.
Run Custom Tool did not work for me. But I found if I added a resource the problem fixed itself.
Follow these steps:
Late (very) response I know but there you go.
In my case the Resource.Designer.cs
file was somehow excluded from project... Clicked on show hidden files (show all files), included it in project with a right-click and it was fixed. Phew..
You most likely have tried to add another resource file with the same name as an already existing resource. To fix this simply delete the corresponding line in the Resources.resx file, for example you will see two lines that have the same "Data name" :
<data name="button" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\button.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With