![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Thread-Topic: Satellites not found for manually loaded assemblies thread-index: AcbSNgFJF2ifpAhkTAqzB4wtfvmExg== X-WBNR-Posting-Host: 81.27.194.73 From: =?Utf-8?B?SmFu?= <Jan (AT) discussions (DOT) microsoft.com Subject: Satellites not found for manually loaded assemblies Date: Wed, 6 Sep 2006 21:28:01 -0700 Lines: 17 Message-ID: <206E86AC-3BFD-43D8-AF6B-3ADFEE5DAA5B (AT) microsoft (DOT) com MIME-Version: 1.0 Content-Type: text/plain; charset="Utf-8" Content-Transfer-Encoding: 7bit X-Newsreader: Microsoft CDO for Windows 2000 Content-Class: urn:content-classes:message Importance: normal Priority: normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830 Newsgroups: microsoft.public.dotnet.internationalization Path: TK2MSFTNGXA01.phx.gbl Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.dotnet.internationalization:2483 NNTP-Posting-Host: TK2MSFTNGXA01.phx.gbl 10.40.2.250 X-Tomcat-NG: microsoft.public.dotnet.internationalization Hi, my application loads assemblies with sub features by Assembly.LoadFrom, depending on what features user chooses to run. Each assembly needs to be localized. I'm using satellite resource assemblies in subfolders. But the satellites are not found by program and defaults are used. FUSLOGVW shows that they are searched only in appbase and private path of the main application but the sub assemblies are not directly there. Is it somehow possible to use the standard resource lookup in this way or do I have to load also resource assemblies with Assembly.LoadFrom and forget help of framework ? I don't want to modify .config of the main application, nothing is known about the sub assemblies in advance. Thanks, Jan |
#3
| |||
| |||
|
|
X-Tomcat-ID: 548411376 References: <206E86AC-3BFD-43D8-AF6B-3ADFEE5DAA5B (AT) microsoft (DOT) com MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit From: aldod (AT) online (DOT) microsoft.com ("Aldo Donetti [MS]") Organization: Microsoft Date: Thu, 12 Oct 2006 22:07:59 GMT Subject: RE: Satellites not found for manually loaded assemblies X-Tomcat-NG: microsoft.public.dotnet.internationalization Message-ID: <olaDirk7GHA.4348 (AT) TK2MSFTNGXA01 (DOT) phx.gbl Newsgroups: microsoft.public.dotnet.internationalization Lines: 59 Path: TK2MSFTNGXA01.phx.gbl Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.dotnet.internationalization:2518 NNTP-Posting-Host: tomcatimport2.phx.gbl 10.201.218.182 Hi Jan, I have tried and in my test the proper resources were loaded for the sub features' assemblies, regardless if they were in a different folder. Are you just testing the resource loading by setting the CurrentUICulture on the main application? In this case, the CurrentUICulture does not propagate to different threads or child apps you might load with LoadFrom and might be the reason why the sub features' resources are not loaded. thanks, Aldo -- This posting is provided "AS IS" with no warranties, and confers no rights. -------------------- | Thread-Topic: Satellites not found for manually loaded assemblies | thread-index: AcbSNgFJF2ifpAhkTAqzB4wtfvmExg== | X-WBNR-Posting-Host: 81.27.194.73 | From: =?Utf-8?B?SmFu?= <Jan (AT) discussions (DOT) microsoft.com | Subject: Satellites not found for manually loaded assemblies | Date: Wed, 6 Sep 2006 21:28:01 -0700 | Lines: 17 | Message-ID: <206E86AC-3BFD-43D8-AF6B-3ADFEE5DAA5B (AT) microsoft (DOT) com | MIME-Version: 1.0 | Content-Type: text/plain; | charset="Utf-8" | Content-Transfer-Encoding: 7bit | X-Newsreader: Microsoft CDO for Windows 2000 | Content-Class: urn:content-classes:message | Importance: normal | Priority: normal | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830 | Newsgroups: microsoft.public.dotnet.internationalization | Path: TK2MSFTNGXA01.phx.gbl | Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.dotnet.internationalization:2483 | NNTP-Posting-Host: TK2MSFTNGXA01.phx.gbl 10.40.2.250 | X-Tomcat-NG: microsoft.public.dotnet.internationalization | | Hi, | my application loads assemblies with sub features by Assembly.LoadFrom, | depending on what features user chooses to run. | | Each assembly needs to be localized. I'm using satellite resource assemblies | in subfolders. But the satellites are not found by program and defaults are | used. FUSLOGVW shows that they are searched only in appbase and private path | of the main application but the sub assemblies are not directly there. | | Is it somehow possible to use the standard resource lookup in this way or do | I have to load also resource assemblies with Assembly.LoadFrom and forget | help of framework ? | I don't want to modify .config of the main application, nothing is known | about the sub assemblies in advance. | | Thanks, | Jan | |
#4
| |||
| |||
|
|
Hi again Jan, during a second test I have noticed that the assembly that you load with LoadFrom is actually getting the same Thread.CurrentThread.CurrentUICulture object as the main application and it's loading resources appropriately. So I'm not sure what's happening in your case. From the main assembly I have invoked the sub DLL as follows Thread.CurrentThread.CurrentUICulture = new CultureInfo("it"); Assembly c = Assembly.LoadFrom(@"C:\Test\D\D\bin\Debug\D.dll"); Object o = c.CreateInstance("D.Class1", true); MethodInfo m = c.GetType("D.Class1").GetMethods()[0]; Object o2 = m.Invoke(o,null); the main assembly is in a different location than the sub DLL and they both load their appropriate resources from their respective locations (the sub DLL loads its Italian resources) Aldo -- This posting is provided "AS IS" with no warranties, and confers no rights. -------------------- | X-Tomcat-ID: 548411376 | References: <206E86AC-3BFD-43D8-AF6B-3ADFEE5DAA5B (AT) microsoft (DOT) com | MIME-Version: 1.0 | Content-Type: text/plain | Content-Transfer-Encoding: 7bit | From: aldod (AT) online (DOT) microsoft.com ("Aldo Donetti [MS]") | Organization: Microsoft | Date: Thu, 12 Oct 2006 22:07:59 GMT | Subject: RE: Satellites not found for manually loaded assemblies | X-Tomcat-NG: microsoft.public.dotnet.internationalization | Message-ID: <olaDirk7GHA.4348 (AT) TK2MSFTNGXA01 (DOT) phx.gbl | Newsgroups: microsoft.public.dotnet.internationalization | Lines: 59 | Path: TK2MSFTNGXA01.phx.gbl | Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.dotnet.internationalization:2518 | NNTP-Posting-Host: tomcatimport2.phx.gbl 10.201.218.182 | | Hi Jan, | I have tried and in my test the proper resources were loaded for the sub features' assemblies, regardless if they were in a different folder. | Are you just testing the resource loading by setting the CurrentUICulture on the main application? In this case, the CurrentUICulture does not propagate to different threads or child apps you might load with | LoadFrom and might be the reason why the sub features' resources are not loaded. | | thanks, | Aldo | | | -- This posting is provided "AS IS" with no warranties, and confers no rights. | | | -------------------- | | Thread-Topic: Satellites not found for manually loaded assemblies | | thread-index: AcbSNgFJF2ifpAhkTAqzB4wtfvmExg== | | X-WBNR-Posting-Host: 81.27.194.73 | | From: =?Utf-8?B?SmFu?= <Jan (AT) discussions (DOT) microsoft.com | | Subject: Satellites not found for manually loaded assemblies | | Date: Wed, 6 Sep 2006 21:28:01 -0700 | | Lines: 17 | | Message-ID: <206E86AC-3BFD-43D8-AF6B-3ADFEE5DAA5B (AT) microsoft (DOT) com | | MIME-Version: 1.0 | | Content-Type: text/plain; | | charset="Utf-8" | | Content-Transfer-Encoding: 7bit | | X-Newsreader: Microsoft CDO for Windows 2000 | | Content-Class: urn:content-classes:message | | Importance: normal | | Priority: normal | | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830 | | Newsgroups: microsoft.public.dotnet.internationalization | | Path: TK2MSFTNGXA01.phx.gbl | | Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.dotnet.internationalization:2483 | | NNTP-Posting-Host: TK2MSFTNGXA01.phx.gbl 10.40.2.250 | | X-Tomcat-NG: microsoft.public.dotnet.internationalization | | | | Hi, | | my application loads assemblies with sub features by Assembly.LoadFrom, | | depending on what features user chooses to run. | | | | Each assembly needs to be localized. I'm using satellite resource assemblies | | in subfolders. But the satellites are not found by program and defaults are | | used. FUSLOGVW shows that they are searched only in appbase and private path | | of the main application but the sub assemblies are not directly there. | | | | Is it somehow possible to use the standard resource lookup in this way or do | | I have to load also resource assemblies with Assembly.LoadFrom and forget | | help of framework ? | | I don't want to modify .config of the main application, nothing is known | | about the sub assemblies in advance. | | | | Thanks, | | Jan | | | | | |
#5
| |||
| |||
|
|
Thread-Topic: Satellites not found for manually loaded assemblies thread-index: AcbusUhsYyfUXZiBTqux93bt0FnAOQ== X-WBNR-Posting-Host: 212.111.31.254 From: =?Utf-8?B?SmFu?= <Jan (AT) discussions (DOT) microsoft.com References: <206E86AC-3BFD-43D8-AF6B-3ADFEE5DAA5B (AT) microsoft (DOT) com> <olaDirk7GHA.4348 (AT) TK2MSFTNGXA01 (DOT) phx.gbl> <pwyWP6k7GHA.4348 (AT) TK2MSFTNGXA01 (DOT) phx.gbl Subject: RE: Satellites not found for manually loaded assemblies Date: Fri, 13 Oct 2006 03:21:01 -0700 Lines: 123 Message-ID: <A3934409-0993-4158-9611-68630E7FBA21 (AT) microsoft (DOT) com MIME-Version: 1.0 Content-Type: text/plain; charset="Utf-8" Content-Transfer-Encoding: 7bit X-Newsreader: Microsoft CDO for Windows 2000 Content-Class: urn:content-classes:message Importance: normal Priority: normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830 Newsgroups: microsoft.public.dotnet.internationalization Path: TK2MSFTNGXA01.phx.gbl Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.dotnet.internationalization:2523 NNTP-Posting-Host: TK2MSFTNGXA01.phx.gbl 10.40.2.250 X-Tomcat-NG: microsoft.public.dotnet.internationalization Hi Aldo, thanks for answer. I need to read localized strings. The dll project contains embedded resource.resx with English texts and resource.cs.resx with Czech ones. Build creates localized *.resources.dll in subfolder "cs". I try to load strings in the program like this: System.Threading.Thread.CurrentThread.CurrentUICul ture = new System.Globalization.CultureInfo("cs"); System.Resources.ResourceManager resourceManager = new System.Resources.ResourceManager("namespace.resour ce", this.GetType().Assembly); string txt = resourceManager.GetString("stringID"); FUSLOGVW shows that the resource manager searches for the cs resource dll in subforlers of the main application, not at the dll location. Should I do it in different way ? Regards, Jan ""Aldo Donetti [MS]"" wrote: Hi again Jan, during a second test I have noticed that the assembly that you load with LoadFrom is actually getting the same Thread.CurrentThread.CurrentUICulture object as the main application and it's loading resources appropriately. So I'm not sure what's happening in your case. From the main assembly I have invoked the sub DLL as follows Thread.CurrentThread.CurrentUICulture = new CultureInfo("it"); Assembly c = Assembly.LoadFrom(@"C:\Test\D\D\bin\Debug\D.dll"); Object o = c.CreateInstance("D.Class1", true); MethodInfo m = c.GetType("D.Class1").GetMethods()[0]; Object o2 = m.Invoke(o,null); the main assembly is in a different location than the sub DLL and they both load their appropriate resources from their respective locations (the sub DLL loads its Italian resources) Aldo -- This posting is provided "AS IS" with no warranties, and confers no rights. -------------------- | X-Tomcat-ID: 548411376 | References: <206E86AC-3BFD-43D8-AF6B-3ADFEE5DAA5B (AT) microsoft (DOT) com | MIME-Version: 1.0 | Content-Type: text/plain | Content-Transfer-Encoding: 7bit | From: aldod (AT) online (DOT) microsoft.com ("Aldo Donetti [MS]") | Organization: Microsoft | Date: Thu, 12 Oct 2006 22:07:59 GMT | Subject: RE: Satellites not found for manually loaded assemblies | X-Tomcat-NG: microsoft.public.dotnet.internationalization | Message-ID: <olaDirk7GHA.4348 (AT) TK2MSFTNGXA01 (DOT) phx.gbl | Newsgroups: microsoft.public.dotnet.internationalization | Lines: 59 | Path: TK2MSFTNGXA01.phx.gbl | Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.dotnet.internationalization:2518 | NNTP-Posting-Host: tomcatimport2.phx.gbl 10.201.218.182 | | Hi Jan, | I have tried and in my test the proper resources were loaded for the sub features' assemblies, regardless if they were in a different folder. | Are you just testing the resource loading by setting the CurrentUICulture on the main application? In this case, the CurrentUICulture does not propagate to different threads or child apps you might load with | LoadFrom and might be the reason why the sub features' resources are not loaded. | | thanks, | Aldo | | | -- This posting is provided "AS IS" with no warranties, and confers no rights. | | | -------------------- | | Thread-Topic: Satellites not found for manually loaded assemblies | | thread-index: AcbSNgFJF2ifpAhkTAqzB4wtfvmExg== | | X-WBNR-Posting-Host: 81.27.194.73 | | From: =?Utf-8?B?SmFu?= <Jan (AT) discussions (DOT) microsoft.com | | Subject: Satellites not found for manually loaded assemblies | | Date: Wed, 6 Sep 2006 21:28:01 -0700 | | Lines: 17 | | Message-ID: <206E86AC-3BFD-43D8-AF6B-3ADFEE5DAA5B (AT) microsoft (DOT) com | | MIME-Version: 1.0 | | Content-Type: text/plain; | | charset="Utf-8" | | Content-Transfer-Encoding: 7bit | | X-Newsreader: Microsoft CDO for Windows 2000 | | Content-Class: urn:content-classes:message | | Importance: normal | | Priority: normal | | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830 | | Newsgroups: microsoft.public.dotnet.internationalization | | Path: TK2MSFTNGXA01.phx.gbl | | Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.dotnet.internationalization:2483 | | NNTP-Posting-Host: TK2MSFTNGXA01.phx.gbl 10.40.2.250 | | X-Tomcat-NG: microsoft.public.dotnet.internationalization | | | | Hi, | | my application loads assemblies with sub features by Assembly.LoadFrom, | | depending on what features user chooses to run. | | | | Each assembly needs to be localized. I'm using satellite resource assemblies | | in subfolders. But the satellites are not found by program and defaults are | | used. FUSLOGVW shows that they are searched only in appbase and private path | | of the main application but the sub assemblies are not directly there. | | | | Is it somehow possible to use the standard resource lookup in this way or do | | I have to load also resource assemblies with Assembly.LoadFrom and forget | | help of framework ? | | I don't want to modify .config of the main application, nothing is known | | about the sub assemblies in advance. | | | | Thanks, | | Jan | | | | | |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |