shanecarr
01-04-2006, 05:17 PM
I am relatively new to the spring framework so appologies if I'm missing something too obvious here.
I have configured an app.exe.config file in such a way that I can successfully use springs object factory, provided that the call to the C# code is not made through COMInterop.
Calling via COMInterop results in an 'Error instantiating context' error. An error message of this nature is usually the result of the 'objects' xml file not being in the application run folder. I have ruled this out as being the source of the problem by putting the objects in the app.exe.config file (as opposed to referencing a separate file). As I've said, I have tested this successfully by NOT calling through COMInterop.
Testing through COMInterop has revealed that the app.config.exe file is visible and can be accessed from my C# code. It's the spring framework that appears to have visibility issues to the config file, and I assume at the call to Spring.Core's 'GetContext'.
Does anyone have any idea what might be causing this and how I might fix the problem. I haven't read any reports of a similar issue and have put in nearly 12 hrs trying to research and resolve it. My best guess is it might be some kind of permissions issue but I'm not that familiar with 'permissions' and how they are implemented in this context, etc.
Snippets from the app.exe.config file I'm using are as follows:
<sectionGroup name="spring">
<section name="context" type="Spring.Context.Support.ContextHandler, Spring.Core"/>
<section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core" />
</sectionGroup>
<spring>
<context>
<resource uri="config://spring/objects"/>
</context>
<objects xmlns="http://www.springframework.net">
<object id="AggregationSection" factory-method="Instance" singleton="true" type="GED.EnerPrise.ETRM.Aggregation.Configuration.Aggre gationSection, GED.EnerPrise.ETRM.Aggregation" />
</objects>
</spring>
Hope someone can help, this is a show stopper for me.
Thanks
Shane
I have configured an app.exe.config file in such a way that I can successfully use springs object factory, provided that the call to the C# code is not made through COMInterop.
Calling via COMInterop results in an 'Error instantiating context' error. An error message of this nature is usually the result of the 'objects' xml file not being in the application run folder. I have ruled this out as being the source of the problem by putting the objects in the app.exe.config file (as opposed to referencing a separate file). As I've said, I have tested this successfully by NOT calling through COMInterop.
Testing through COMInterop has revealed that the app.config.exe file is visible and can be accessed from my C# code. It's the spring framework that appears to have visibility issues to the config file, and I assume at the call to Spring.Core's 'GetContext'.
Does anyone have any idea what might be causing this and how I might fix the problem. I haven't read any reports of a similar issue and have put in nearly 12 hrs trying to research and resolve it. My best guess is it might be some kind of permissions issue but I'm not that familiar with 'permissions' and how they are implemented in this context, etc.
Snippets from the app.exe.config file I'm using are as follows:
<sectionGroup name="spring">
<section name="context" type="Spring.Context.Support.ContextHandler, Spring.Core"/>
<section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core" />
</sectionGroup>
<spring>
<context>
<resource uri="config://spring/objects"/>
</context>
<objects xmlns="http://www.springframework.net">
<object id="AggregationSection" factory-method="Instance" singleton="true" type="GED.EnerPrise.ETRM.Aggregation.Configuration.Aggre gationSection, GED.EnerPrise.ETRM.Aggregation" />
</objects>
</spring>
Hope someone can help, this is a show stopper for me.
Thanks
Shane