Perpetual program reopens error: The type or namespace name 'Properties' does not exist in the namespace 'xxx' (you are missing an assembly reference?). Suppose there is a namespace space xxx how to declare how to use attributes and resources, for example: global :: xxx.Properties.Resources.sys_h;

Dani AI

Generated

Short diagnosis: that compiler message normally means the auto‑generated Resources type the code expects cannot be resolved. Common root causes are a missing or misgenerated Designer file for the .resx, a namespace mismatch between the generated class and the code that references it, the resource class having internal visibility while being accessed from another assembly, or the project with the resources not being referenced.

Practical checklist to diagnose and fix:

  • Inspect the project’s Resources.resx and its generated Resources.Designer.cs. Confirm the Designer file exists and its declared namespace matches the namespace used by the calling code.
  • Verify the resource key actually exists in the .resx and is spelled/cased exactly as referenced.
  • For cross‑project access, ensure the producing project is referenced by the consumer and that the generated Resources class is public. One way to make the generated class public is to use the PublicResXFileCodeGenerator as the resx Custom Tool.
  • If leaving the class internal is preferred, add an assembly-level InternalsVisibleTo entry in the resource assembly so another assembly can access it:
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("ConsumerAssemblyName")]
  • As an alternative, load the resource via ResourceManager from the producing assembly:
var rm = new System.Resources.ResourceManager("ProjectRoot.Properties.Resources", typeof(SomeTypeInThatAssembly).Assembly);
string s = rm.GetString("sys_h");

Other useful checks: search the solution for any user-defined type or namespace named Properties that could shadow the generated one; delete bin/obj and perform a full Clean + Rebuild; if the Designer file is missing, run the resx Custom Tool or re-save the .resx to force regeneration. These steps expand on ’ and ’s quick suggestions and target the typical underlying causes (namespace, visibility, or generation problems).

Recommended Answers

All 4 Replies

It sounds like you are missing the 'using' statement for the required class at the top of the code file.
So, if you have the class Properties inside a namespace XXX you would add

using XXX.Properties;

at the top of any other class that intended on using it.
This may also require you adding the reference to the project, as you may have done when adding System libraries.

I also did the way you instructed but still error: The type or namespace name 'Properties' does not exist in the namespace 'xxx' (are you missing an assembly reference?)

This is likely to not fix it but I had it happen and it did. Mind you that the code looked right but I had to use the Clean then Rebuild options in the menu of Visual Studio. Remember I don't claim this will fix it as folk have a lot of bugs on their new app but this one did happen to me and it helped.

These fields you said that I've try all but not

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.