Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem with subdirectories in the Visual Studio tree

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Globalizer Support
View previous topic :: View next topic  

Anyone else modify the default namespace given for classes in subdirectories?
Yes
0%
 0%  [ 0 ]
No
0%
 0%  [ 0 ]
Huh?
0%
 0%  [ 0 ]
Total Votes : 0

Author Message
TomClement



Joined: 22 Oct 2009
Posts: 8

PostPosted: Thu Oct 22, 2009 11:59 pm    Post subject: Problem with subdirectories in the Visual Studio tree Reply with quote

Hi,
To organize our controls and forms in our very large solution, we created subdirectories under each project with names like' "Controls",
"Forms", "Editors", or "Utilities" etc. Since all these files are in fact in the same namespace (let's say Serena.Framework), we've changed the default namespaces given to them from (e.g.) Serena.Framework.Controls to Serena.Framework. When I try to preview a form, I get an error E205, saying, for example:

"E205: Unable to locate the type (Serena.Framework.Controls.MyControl) in the compiled assembly Serena.Framework. Check that the Resx Resource Name matches the fully qualified type name of the associated control."

So apparently, unlike Visual Studio, Globalizer.NET makes the assumption that the namespace of an item corresponds to the project name and directory structure. Is there any way to correct this problem?

Currently, I have an in-house developed (i.e. I wrote it) utility that does some of what Globalizer.NET does, and I was really hoping I could dump it in favor of your product. To resolve the corresponding problem in that code, I parsed the corresponding .cs file to obtain the namespace of the file and that seemed to do the trick. Any chance you're considering a modification of your product to do the same? Without a workaround that doesn't involve changing hundreds of files in our solution, I don't think I'll be able to use it.

Thanks for your help.
Tom Clement[/code]
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Fri Oct 23, 2009 7:28 am    Post subject: Reply with quote

Globalizer.NET determines the default resource name based on the default namespace for the project and the folder. This is the same as what Visual Studio will do by default when you add a new control to a sub-folder. This will by default set the namespace to include the folder name. To change this you have to modify the generated code in the designer as well as the control/form code.

It's OK to do this (as you have) but then Globalizer won't get the resource name right by default. You can however open the properties tab in Globalizer.NET, select the control target then change the Resource Name to remove the folder name. I realise that if you have a lot of controls this could be a bit of a pain - but you only need to do it once. Given that Globalizer.NET stores the workspace data in plain text XML file you could do this much quicker using a text editor and search and replace.

We will also consider your suggestion of parsing the file for the namespace - but if you need a quick solution I would suggest the above.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
TomClement



Joined: 22 Oct 2009
Posts: 8

PostPosted: Fri Oct 23, 2009 3:18 pm    Post subject: Reply with quote

Thanks for the quick reply. Yep it will be a pain, but it's great that you have a way around this one.
Tom
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Tue Dec 01, 2009 5:42 am    Post subject: Reply with quote

Version 2.0.4 of Globalizer.NET has just been released and includes a fix for this issue. When scanning adding new resources for C# forms and controls to a project Globalizer.NET now checks the associated code file to determine the default resource name.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Globalizer Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group