Alex Rivera | Logout

How to resolve this "Resource name is not a valid identifier" compiler warning

Asked 2010-02-16T15:46:54.310
9

I've got a bunch of Warnings in a Visual Studio 2005 project, most of them are warning me that a resource name is not a valid identifier.

example:

The resource name 'MB_ArchiveRestore.cs_11' is not a valid identifier.

MSDN online help indicates that the resource name needs to be strongly typed, and not contain spaces. What does strongly typed exactly mean?

Edit
Report

2 Answers

0

I would have to guess that it's complaining about the _11 at the end, which would make it not a valid C# file, thus, not a valid resource.

answered 2010-02-16T15:52:00.573
0

I guess that you have a resource named "MB ArchiveRestore.cs 11". Since VS 2005 the compiler (or more precisely an add-on tool) will automatically generate access classes for embedded resources. These can be used to retrieve the resources. The class property for your example is probably Properties.Resources.MB_ArchiveRestore.cs_11. These stronlgy typed resource classes also provide a convenient way for localization.

answered 2010-02-16T16:00:16.650

Your Answer