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 

Wrong Target Directory for ASP.NET Projects

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



Joined: 12 Nov 2008
Posts: 18

PostPosted: Tue Nov 10, 2009 6:41 am    Post subject: Wrong Target Directory for ASP.NET Projects Reply with quote

I have a ASP.NET project to translate. Scanning and translating the project works fine, just as expected.
But when I build the project from Globalizer.NET with option "Deployed (Binary) Localization", only the localized dll files are written to the deploy directory. The localiced resx files are written to the source path.

This is a bug in my opinion. Everything should go to the path I decide and not being splitted.
Can you agree with that?
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Tue Nov 10, 2009 9:59 pm    Post subject: Reply with quote

I can replicate this issue with Resx Files marked as "Content" (ie not Embedded Resources). Is the case you have?

We will get a fix out for this ASAP.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Daniel



Joined: 12 Nov 2008
Posts: 18

PostPosted: Wed Nov 11, 2009 6:08 am    Post subject: Reply with quote

Yes it is set to "Content". I've never set or changed any of those properties, so it must be the default.
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Wed Nov 11, 2009 6:21 am    Post subject: Reply with quote

Normally for localization you would set the "Build Action" to "Embedded Resources" so that the resources get compiled into the satellite assemblies and you can access them through the resource manager. In addition you would normally set the Custom Tool to "ResXFileCodeGenerator" so that Visual Studio will automatically generate a typesafe wrapper class to allow you to get the resources programmatically.

How are you accessing the resources in your application?
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Daniel



Joined: 12 Nov 2008
Posts: 18

PostPosted: Wed Nov 11, 2009 6:29 am    Post subject: Reply with quote

I wrote my own method which is in a base class (derived from Page) from which I derive all my pages:
Code:
protected string GetResourceString( string resourceName )
{
    return HttpContext.GetLocalResourceObject( AppRelativeVirtualPath, resourceName ) as string;
}

I use it like this:
Code:
MessageLabel.Text = GetResourceString( "Error_InvalidLoginInformation" );
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Wed Nov 11, 2009 6:33 am    Post subject: Reply with quote

Sorry - I was incorrect for ASP.NET applications using Content resx files is normal. We will look at fixing the problem in any case.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Wed Nov 11, 2009 6:39 am    Post subject: Reply with quote

You can however use EmbeddedResource resx files with ASP.NET which (if you set the Custom Tool to "ResXFileCodeGenerator") have the advantage of having a typesafe wrapper class to access them. Someone may have developed a custom tool that generates wrapper classes for Content resx files - but I haven't been able to find one.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Daniel



Joined: 12 Nov 2008
Posts: 18

PostPosted: Wed Nov 11, 2009 6:46 am    Post subject: Reply with quote

Why would I need another tool? I've Globalizer.NET - a great tool. (And why am I telling you that Rolling Eyes ?)
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Mon Nov 16, 2009 3:24 am    Post subject: Reply with quote

The issue with the Deploy Build of Content Resx files being built in the incorrect location has now been fixed in Version 2.0.3
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Daniel



Joined: 12 Nov 2008
Posts: 18

PostPosted: Wed Nov 18, 2009 7:19 am    Post subject: Reply with quote

I downloaded and installed release 2.0.3 and wanted to test the update regarding this issue. Unfortunately, it seams not to work as I think it should.

When you add a ASP.NET VS project to the Globalizer workspace, Globlizer adds a "<project path>\bin\" folder to the "Assembly Search Path". When you build the project to the "Deployed (Binary) Location" Globalizer creates the path by concatenating the "Deploy Directory" plus the "Assembly Search Path" plus folder "App_LocalResources". This includes the "bin" folder which is wrong IMO. VS puts the "App_LocalResources" folder at the root of the application path - so at the same level as the "bin" folder. If you have subfolders that include local resources the appropriate "App_LocalResources" folders are also directly under those folders, not under another bin folder.

I hope you understand my explanations. Can you agree with this?
Back to top
View user's profile Send private message
Daniel



Joined: 12 Nov 2008
Posts: 18

PostPosted: Wed Nov 18, 2009 7:26 am    Post subject: Reply with quote

Addendum to my last post:

When building the localized resx files, Globalizer looks for the invariant resx file in the path described above and can't find them (because of the "bin" part). It generates error E001.
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Wed Nov 18, 2009 9:11 am    Post subject: Reply with quote

I think the problem may be that your project target does not have the correct "Deploy Directory" and "Deployed Assembly Directory" set for your Project target. The defaults for these (for ASP.NET projects) were not set correctly prior to 2.0.3.

The "Deploy Directory" should specify the root directory of your ASP.NET app (ie where the web.config file is). Prior to 2.0.3 it was set by default incorrectly to the bin directory. The "Deployed Assembly Directory" should be "bin". This is the path to the bin directory relative to the root directory.

If I have misunderstood and fixing these does not resolve your issue then maybe send us a sample project/workspace that illustrates the problem.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Daniel



Joined: 12 Nov 2008
Posts: 18

PostPosted: Wed Nov 18, 2009 10:03 am    Post subject: Reply with quote

That was the problem. I took out the bin folder from the "Deploy Directory" to and moved it to the "Deployed Assembly Directory".

Thanks for your help!
Back to top
View user's profile Send private message
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