I got below violation in FxCop. when I hard code the string in Console.WriteLine("Service Started");
Method 'method()' passes a literal string as parameter 'value' of a call to 'Console.WriteLine(string)'. Retrieve the following string(s) from a resource table instead: "Service Started"
So I changed the code like below type.
ResourceManager rm = new ResourceManager("Service Started", Assembly.GetExecutingAssembly());
string start = rm.GetString("Service Started");
Console.WriteLine(start);
Now I do not get the FxCop violation. But I got the below exception in the line string start = rm.GetString("Service Started");
How can I fix this exception?
Additional information: Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Service Started.resources" was correctly embedded or linked into assembly "namespace name" at compile time, or that all the satellite assemblies required are loadable and fully signed.