Errors

Dec 22, 2010 at 8:45 AM

Hi, it's me again, sorry :-)

Do you have any hints regarding the following errors?

...\Local Settings\Temp\mvrv7y7c.0.cs(35,17) : error CS0103: The name 'RememberMessages' does not exist in the current context
...\Local Settings\Temp\mvrv7y7c.0.cs(135,17) : error CS0103: The name 'RememberMessages' does not exist in the current context
...\Local Settings\Temp\mvrv7y7c.0.cs(230,17) : error CS0103: The name 'RememberMessages' does not exist in the current context
...\Local Settings\Temp\mvrv7y7c.0.cs(273,17) : error CS0103: The name 'RememberMessages' does not exist in the current context
...\Local Settings\Temp\mvrv7y7c.0.cs(326,13) : error CS1502: The best overloaded method match for 'NLocalizer.Translation.SetText(string, string, string, string)' has some invalid arguments
...\Local Settings\Temp\mvrv7y7c.0.cs(326,76) : error CS1503: Argument '4': cannot convert from 'object' to 'string'
...\Local Settings\Temp\mvrv7y7c.0.cs(369,17) : error CS0103: The name 'RememberMessages' does not exist in the current context
...\Local Settings\Temp\mvrv7y7c.0.cs(461,13) : error CS0103: The name 'TranslateMessages' does not exist in the current context
...\Local Settings\Temp\mvrv7y7c.0.cs(471,13) : error CS0103: The name 'RememberMessages' does not exist in the current context
...\Local Settings\Temp\mvrv7y7c.0.cs(481,13) : error CS0103: The name 'RestoreMessages' does not exist in the current context

I do have a static Messages class. Is it possible to keep the temporary cs-file for further investigation?

Regards, Tom

Coordinator
Dec 22, 2010 at 9:07 AM
Edited Dec 22, 2010 at 9:58 AM

Please add one message variable into Messages class and into *.lang files. Look at my example:

Messages.vb:

Public Class Messages
Public Shared MyFirstMessage As String = "My first message"
End Class

*.lang files:

...
(Messages)MyFirstMessage = text of first message
...

You can always debug classes produced by NLocalizer in runtime mode :) For example, You can trap 'return str;' of method ToCSharpCode from file RunTimeCompiler.cs and see variable str. You can also look at file used by compiler: (Your profile directory)\Local Settings\Temp\mvrv7y7c.0.cs (file name from Your example).

I see, next version of NLocalizer must have more friendly error messages and Messages class must be not required.

Dec 22, 2010 at 12:09 PM

Ok it works.

The Messages string needs to be present in every lang file, not only the one I just try to use.

Thank you.

Coordinator
Sep 2, 2011 at 3:17 PM
Edited Sep 2, 2011 at 3:18 PM

NLocalizer 1.7+ don't need any special static class like Messages. I implemented better error detection, friendly error messages and additional feature - diagnostic.