.NET Forum / .NET Framework / Distributed Applications / July 2007
Enterprise Library and Serviced Component (COM+)
|
|
Thread rating:  |
Abel Chan - 09 Jun 2005 20:41 GMT Hi all,
I did some study on the Enterprise Library Data Access Application Block. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/daab.asp
Could someone tell me how I can use it to build a COM+ Serviced Component?
The Enterprise Library requires App.config and Web.config. I would like the Enterprise Library for .DLL projects, which I can deploy it as a COM+ application.
I can't use App.config or Web.config with .DLL projects to feed in the connection string and other config info.
So how could I modify the Enterprise Library to support this? Any sample/blog/suggestion?
Thanks a lot.
Abel Chan
[MSFT] - 10 Jun 2005 02:51 GMT Hello Alel,
To set an app.config for COM+ application:
If you are using Windows 2000, and your COM+ app is a server one, your app.config should be called dllhost.exe.config and must be in the same directory as dllhost.exe (which is %SystemRoot%\System32).
If you are using Windows 2003, you can go to the Activation tab of the COM+app properties and set the Application Root Directory property to point to a location of your preference, and, in that directory, you must place a file called application.config (with your config settings) and another file caller application.manifest with the content shown bellow
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> </assembly>
Luke
Abel Chan - 10 Jun 2005 08:18 GMT Hi Luke,
Thanks to your quick response and I will try it out.
BTW, Data Access Application Block comes with 3 DLLs:
Microsoft.Practices.EnterpriseLibrary.Data.dll Microsoft.Practices.EnterpriseLibrary.Common.dll Microsoft.Practices.EnterpriseLibrary.Configuration.dll
I put all three in GAC (gacutil) but I only created ONE Serviced component (COM+ server application) on Microsoft.Practices.EnterpriseLibrary.Data.dll with regsvcs.
Am I correct or do I need to create the other two as Serviced Components too?
Thanks Luke.
Abel Chan
> Hello Alel, > [quoted text clipped - 15 lines] > > Luke [MSFT] - 13 Jun 2005 02:36 GMT Hello Abel,
I think you are correct on this issue, Microsoft.Practices.EnterpriseLibrary.Data.dll can call the other two even they are not Serviced component.
Luke
Alfredo Barrientos - 18 Jun 2005 19:36 GMT Hi Abel,
Could you tell me how do you assign a snk file the to enterprise library's assemblies?
Thanks
Alfredo
Alfredo Barrientos - 18 Jun 2005 20:50 GMT Hi Abel,
I have a second question, how do you use the application.config file in you development enviroment? I dont know how to reference the application.config file using a path function or pointing a Application Root Directory from Activation Tab if my application is still developing.
Help me pls!
Thanks
Alfredo
Lakshmi Majeti - 17 Nov 2005 11:58 GMT Hello,
If I'm using Windows XP, How to use Enterprise Library Data Access Application block in COM+ Application.
Could any give me clear description and tutorial on this.
Luke: How to use Enterprise Library Data Access Application block in COM+ Application in Windows XP.
Regards Lakshmi Majeti
Andrés Giraldo - 13 Feb 2006 22:56 GMT Hi!
I'm working with the Enterprise Library June 2005, and I can work with the Data, Configuration and Common dll's OK as they come in the originall source code.
However, I need to create a COM+ component to use the Enterprise Library Data, and I need that those dll's are signed with strong names and registered in the Assembly Cache, when I do that, my application crashes...
Enterprise Library can be signed with strong names? anyone could give me any example of that?
Thanks!
Michael Nemtsev - 14 Feb 2006 21:13 GMT Hello Andris,
The enterprise library ships with source code. If you want to add a strong name, simply recompile with the signing key of your choice.
AG> I'm working with the Enterprise Library June 2005, and I can work AG> with the Data, Configuration and Common dll's OK as they come in the AG> originall source code. AG> AG> However, I need to create a COM+ component to use the Enterprise AG> Library Data, and I need that those dll's are signed with strong AG> names and registered in the Assembly Cache, when I do that, my AG> application crashes... AG> AG> Enterprise Library can be signed with strong names? anyone could AG> give me any example of that? --- WBR, Michael Nemtsev :: blog: http://spaces.msn.com/laflour
"At times one remains faithful to a cause only because its opponents do not cease to be insipid." (c) Friedrich Nietzsche
Klaus H. Probst - 15 Feb 2006 04:05 GMT Yes, but you need to provide your own key. As a matter of policy Microsoft does not distribute signed binaries for tools/projects that also include source code. Just generate your key with sn.exe, add the [assembly: AssemblyKeyFile("<file>")] attribute to the GlobalAssemblyInfo.cs file shared by all the projects with the path to your key, and recompile. Then add the assemblies to the GAC manually with gacutil or the fusion shell extension (under %WINDIR%\Assembly).
 Signature Klaus H. Probst, MVP http://www.simulplex.net/
> Hi! > [quoted text clipped - 13 lines] > > *** Sent via Developersdex http://www.developersdex.com *** Andrés Giraldo - 15 Feb 2006 14:14 GMT Thanks for your help, my problem was: Using the Enterprise Library Configuration, It can't load the .Data assembly when it's compiled with strong name, and if I let it like that, it puts a version and a token of the .Data dll, and of course I was referencing another (the signed one)... so... the solution for me was to edit the dataConfiguration.config, and eliminate manually the version and the token, in this way the .Data assembly loads ok...
However, I've got a new problem with that now...
When I'm working without COM+, it works fine... but when I use the same version of the project but, with COM+, the client gives me the following error: 'System.Configuration.ConfigurationException' en mscorlib.dll There are multiple root elements. Line 26, position 2.
The solution is the same, I've got to projects that uses EnterpriseLibrary.Data, the only difference between then are, the one is a servicedcomponent, and the other don't. The client consumes from the not COM+ and works OK, but when I use the COM+ project... the system gives me that error.
Any idea? the project is the same, the client has the dataConfiguration.config in both cases, the ServicedComponent is installed, and it has impersonation and packagen call level authentication, also it doesn't demand check access for this application.
Thanks for your help!
Niek Bakker - 17 Aug 2006 15:50 GMT Luke,
i found this post while searching for dllhost.exe.config. Using WinXp on my development pc the only way to configure com+ components was to use the dllhost.exe.config. But after making a .Net 2.0 version of the same component, this doesn't work anymore. The .Net 2.0 COM+ component cannot find the configuration-settings anymore.
How should I solve this problem on WinXP?
gr. Niek
> Hello Alel, > [quoted text clipped - 15 lines] > > Luke Mauricio C Vidotto - 25 Oct 2006 21:49 GMT Hi Luke...
The application mentioned is the name of my COM+ application (package)?
Mauricio
> Hello Alel, > [quoted text clipped - 15 lines] > > Luke Mauricio C Vidotto - 10 Jul 2007 20:42 GMT No... the name is "application"...
> Hi Luke... > [quoted text clipped - 21 lines] > > > > Luke jagberg - 10 Jul 2007 14:12 GMT I have an application that uses COM+, a Service Agent, Business Layer, Data Layer and UI Layer. I successfully used the Caching Block in the Service Agent, using Web.config and cachingconfiguration.config. It didnt solve one of my issues so I moved it to my Business Layer(In COM+).
I created dllhost.exe.config in ..\system32 with the same settings as my web.config file and I copied the cachingconfiguration.config file to that folder as well. When my I run Dim m_primitivesCache As CacheManager = CacheFactory.GetCacheManager()
I get the following error A first chance exception of type 'System.TypeInitializationException' occurred in mscorlib.dll
Additional information: The type initializer for "Microsoft.Practices.EnterpriseLibrary.Caching.CacheFactory" threw an exception.
Do you know what I am doing wrong. Ive tried a few different variations of the config files with no luck.
> Hello Alel, > [quoted text clipped - 15 lines] > > Luke jagberg - 11 Jul 2007 07:44 GMT When I mention same settings as web.config, it doesnt include the web settings, just the cache settings.
> I have an application that uses COM+, a Service Agent, Business Layer, Data > Layer and UI Layer. I successfully used the Caching Block in the Service [quoted text clipped - 36 lines] > > > > Luke
Free MagazinesGet these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...
|
|
|