Click here to Skip to main content
15,891,597 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everyone, thanks for reading.

I'll jump straight in.

Circumstance: I'm a beginner and I have a small, single form project in VB 2010 Premium.
I ran code analysis (ALL Rules) on it because I want to keep it in good shape, meet good coding practices, and learn along the way.
When first run, I initially had over 70 warnings. A lot, but not all, of those 70 are text strings (CA1303) being pulled from the 'strings' resource. Anyway, I got those down to just 2. it took a good hour or so. I'm quite happy with that number, 2, bearing in mind the complexity of my little app. One of the 2 is signing, which I will have no problem when the time is right and the other is a cyclomatic complexity problem (37 instead of 25). Again, I'll tackle those in due course.

PROBLEM: I adjusted all problem text strings to come from the strings resource table (now down to 43 of them) and save the project and it runs fine. When close the project and come back to it another time, I run the analysis and all the text strings are back to warnings again! the resources table is still as i left it, but the analysis is not picking up the strings resources table for some reason?

Here is a sample error I am getting:

"CA1303 : Microsoft.Globalization : Method 'Form1.InitializeComponent()' passes a literal string as parameter 'value' of a call to 'ButtonBase.Text.Set(String)'. Retrieve the following string(s) from a resource table instead: "Show how many"

It's getting really annoying because I have to spend about 40 minutes going through them all to correct them, only to find they have not saved. Grr.


Actions: I have tried (and failed to resolve the issue):
I deleted the following from the debug folder. it didn't make a difference.
- .exe
- .pdb
- .vshost.exe
- .vshost.exe.manifest
- .xml

I tried adding a custom dictionary for a couple of the strings (unrecognised names) that doesn't seem to have worked either because it doesn't like the spelling of my initials! But the custom dictionary is an aside. - It didn't make a difference either.


I wonder, where does the "Form1.InitializeComponent" take it's values? All my labels and buttons have the text in them in their 'properties' so that I can see the text at design time.

Anybody have any idea what I can do? or how to resolve this issue please?

Many thanks for reading and any advice.

Rob
Posted

1 solution

Try to understand more of your problem by reading this one. Hope it helps!

http://msdn.microsoft.com/en-us/library/ms182187.aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900