adeline
06-13-2007, 09:04 AM
I am having problem to run the example, eg. TxQuickStart, DataQuickStart. Can anyone provide step by step to make any of them workable? I am confuse there are 2 projects in the solution. Basically I want to connect to MSSQL. Below are what i was trying to do, perhaps u can help to point out area that I did wrong.
1. Build the solution (which project? with test or without test folder?) and get the dll. The xml (for database setting and etc) shall come together with this dll.
2. Create a new web application, add the dll built from step 1 into reference.
3. add "using <reference>" in the c# file.
4. add web.config as below:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="spring">
<section name="context" type="Spring.Context.Support.ContextHandler, Spring.Core"/>
<section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core" />
<section name="parsers" type="Spring.Context.Support.ConfigParsersSectionHandler , Spring.Core"/>
<section name="resources" type="Spring.Context.Support.ResourcesSectionHandler, Spring.Core"/>
<section name="typeAliases" type="Spring.Context.Support.TypeAliasesSectionHandler, Spring.Core"/>
<section name="typeConverters" type="Spring.Context.Support.TypeConvertersSectionHandle r, Spring.Core"/>
</sectionGroup>
</configSections>
<spring>
<parsers>
<parser type="Spring.Data.DatabaseConfigParser, Spring.Data" />
</parsers>
</spring>
<system.web>
<compilation debug="true">
<assemblies>
<add assembly="System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<authentication mode="Windows"/>
<!--
The following needs to be configured in order to enable Spring.NET Web Framework features
-->
<httpHandlers>
<add verb="*" path="*.aspx" type="Spring.Web.Support.PageHandlerFactory, Spring.Web"/>
</httpHandlers>
</system.web>
</configuration>
5. Add below in default.aspx
XmlParserRegistry.RegisterParser(typeof(DatabaseCo nfigParser));
IApplicationContext ctx =
new XmlApplicationContext("assembly://Spring.TxQuickStart/Spring.TxQuickStart/DTCAppContext.xml");
I am getting numerous different errors eg. "'TestObjectDao' node cannot be resolved for the specified root context.", "Could not load file or assembly 'Spring.Data, Version=1.1.0.2, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)", "InputStream is null from Resource = [assembly [Spring.TxQuickStart, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null], resource [Spring.TxQuickStart.DTCAppContext.xml]]" along the try n error but yet still cannot get it works.
Your help would be very much appreciated.
1. Build the solution (which project? with test or without test folder?) and get the dll. The xml (for database setting and etc) shall come together with this dll.
2. Create a new web application, add the dll built from step 1 into reference.
3. add "using <reference>" in the c# file.
4. add web.config as below:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="spring">
<section name="context" type="Spring.Context.Support.ContextHandler, Spring.Core"/>
<section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core" />
<section name="parsers" type="Spring.Context.Support.ConfigParsersSectionHandler , Spring.Core"/>
<section name="resources" type="Spring.Context.Support.ResourcesSectionHandler, Spring.Core"/>
<section name="typeAliases" type="Spring.Context.Support.TypeAliasesSectionHandler, Spring.Core"/>
<section name="typeConverters" type="Spring.Context.Support.TypeConvertersSectionHandle r, Spring.Core"/>
</sectionGroup>
</configSections>
<spring>
<parsers>
<parser type="Spring.Data.DatabaseConfigParser, Spring.Data" />
</parsers>
</spring>
<system.web>
<compilation debug="true">
<assemblies>
<add assembly="System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<authentication mode="Windows"/>
<!--
The following needs to be configured in order to enable Spring.NET Web Framework features
-->
<httpHandlers>
<add verb="*" path="*.aspx" type="Spring.Web.Support.PageHandlerFactory, Spring.Web"/>
</httpHandlers>
</system.web>
</configuration>
5. Add below in default.aspx
XmlParserRegistry.RegisterParser(typeof(DatabaseCo nfigParser));
IApplicationContext ctx =
new XmlApplicationContext("assembly://Spring.TxQuickStart/Spring.TxQuickStart/DTCAppContext.xml");
I am getting numerous different errors eg. "'TestObjectDao' node cannot be resolved for the specified root context.", "Could not load file or assembly 'Spring.Data, Version=1.1.0.2, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)", "InputStream is null from Resource = [assembly [Spring.TxQuickStart, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null], resource [Spring.TxQuickStart.DTCAppContext.xml]]" along the try n error but yet still cannot get it works.
Your help would be very much appreciated.