Forum: Multi-Language Add-In for Visual Studio

MLString module causing problem

Hello there.

I just tried the add-in for the first time (trial version for Visual Studio 2005) and I must say, it is pretty impresive.

I ran 2 test with it :
- I ran the add-in to a Window Form project. The project contains about 150 forms in it. Even if I went into some problems with the environement (some out of memory crash), I finally succeeded setting up the project for traduction. Well done.

- Then I ran the add-in to a Web project. Everything seems to work well except that I can't build my web project anymore. The MLString module gives me an error at this line :

Public ResMgr as ResourceManager = Resources.MultiLang.ResourceManager

It can't seem to be able to recognize the keyword Resources.

Here is the error description : "Resources is ambiguous, imported from the namespaces or types "System.Web", "System"".

Is there any workaround for this?

Thx!

Germany

Hi,

I had forgotten about this problem and it took me a little while to figure it out! In this case Resources refers to a Namespace within your project, but until you have created any resources, it is an undefined reference.

To fix it, all you have to do is to export texts to the resource files. You can do this easily using the Add-In. Click on the runtime support symbol Image on the toolbar and select the command Store resources for web projects from the dropdown menu, as shown below.

Image

After that you should be able to build the project again.

Visual Studio 2008 generates one or more code files defining namespace Resources. Visual Studio 2005 doesn't appear to add any extra .vb or .cs files to the project, so it is not really clear where this namespace is defined.

I will try to find a way to hide this problem. The most stupid way would be to add a comment to the template file, explaining what to do. A better method might be to add this code later, or to add a resource file earlier. I'll have to think about it.

By the way, if you have problems scanning the project with 150 forms, you might find it better to select the option to scan controls via source code instead of via designer windows. I think that the memory problems are due to opening the designer window for each form. The Add-In always closes the designer windows (unless they were already open), but there still seems to be a net rise in the memory usage. Scanning via source code avoids this effect.

Finally, if you have problems logging back into the forum, let me know by email. I can fix it by resetting your password, but I havn't figured out the real cause yet.

Phil


Thanks a lot for your help. It did solve my problem :-).