PDA

View Full Version : EnterpriseServices: Exported object not finding dependent assembly


dturkel
06-29-2007, 04:26 PM
Sorry if this is the wrong forum to post it... it was the closest match.

I have an assembly, "FeedStreamProcessWorker", that I'm trying to export as COM+. This assembly depends on "PublishingCoordinatorCommon".

At runtime initialization of the ApplicationContext (configuration at bottom of this message) throws the following exception:

Error creating object with name 'MyComponentExporter' defined in 'config [objects]' : Initialization of object failed : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information


After much painful introspection w/ VS2005, I located the proper inner exception and found that one of the references for my exported component isn't being located (or something it depends on) during the registration process:

"Could not load file or assembly 'PublishingCoordinatorCommon, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)":"PublishingCoordinatorCommon, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"} System.Exception {System.IO.FileLoadException}
Is there a way through Spring.NET's configuration to make sure that the dependent assembly can be located, or a means through VS2005 to build my main assembly so it's somehow "includes" my dependency.

I'm a bit of a .NET noob, especially when it comes to COM/COM+-- so please be easy on me.

<spring>
<context>
<resource uri="config://spring/objects"/>
</context>
<objects xmlns="http://www.springframework.net">
<description>XXXXX</description>
<object name="FeedPublishingStreamWorker" type="Publishing.Workers.FeedPublishingStreamWorker, FeedPublishingStreamWorker">
<property name="CmsDataSourceConnectionString"
value="Data Source=XXXXX;Initial Catalog=XXXXX;User ID=xxxx;Password=xxxx;Connect Timeout=5"/>
<property name="XsltLocation" value=".\xslt\x.xslt"/>
</object>

<object id="MyApp.EnterpriseServices.FeedPublishingStreamWorke r" type="Spring.EnterpriseServices.ServicedComponentExporte r, Spring.Services">
<property name="TargetName" value="FeedPublishingStreamWorker"/>
<property name="TypeAttributes">
<list>
<object type="System.EnterpriseServices.TransactionAttribute, System.EnterpriseServices"/>
</list>
</property>
<property name="MemberAttributes">
<dictionary>
<entry key="*">
<list>
<object type="System.EnterpriseServices.AutoCompleteAttribute, System.EnterpriseServices"/>
</list>
</entry>
</dictionary>
</property>
</object>

<object id="MyComponentExporter" type="Spring.EnterpriseServices.EnterpriseServicesExport er, Spring.Services">
<property name="ApplicationName" value="My COM+ Application"/>
<property name="Description" value="My enterprise services application."/>
<property name="AccessControl">
<object type="System.EnterpriseServices.ApplicationAccessControl Attribute, System.EnterpriseServices">
<property name="AccessChecksLevel" value="ApplicationComponent"/>
</object>
</property>
<property name="Roles">
<list>
<value>Admin : Administrator role</value>
<value>User : User role</value>
<value>Manager : Administrator role</value>
</list>
</property>
<property name="Components">
<list>
<ref object="MyApp.EnterpriseServices.FeedPublishingStreamWorke r"/>
</list>
</property>
<property name="Assembly" value="MyComPlusApp"/>
</object>

</objects>
</spring>
Help and advice will be appreciated.

Dave

dturkel
06-29-2007, 06:52 PM
So I read the error message, and decided to give signing my Common assembly. Once I did that, everything ran fine.

I would just seem preferably not to have to do that? Am I wrong in my thinking?

Thanks,

Dave

Bruno Baia
07-07-2007, 12:50 AM
Hi,

it must be strongly signed to get a unique identification.

Cheers,
Bruno

dturkel
07-08-2007, 04:34 AM
Thanks Bruno. I'll give that a try and post if it was successful. On a separate note, I did discover the requirement for strong signing on a different software project I started w/ Spring.NET to do remoting. I didn't apply it to this one yet.

Dave

Bruno Baia
07-12-2007, 11:42 AM
Hi,

Thanks Bruno. I'll give that a try and post if it was successful. On a separate note, I did discover the requirement for strong signing on a different software project I started w/ Spring.NET to do remoting. I didn't apply it to this one yet.

Dave
You don't need strong signing with remoting.

Bruno