PDA

View Full Version : Windows Services and Object in framework 2.0


bchebrou
01-16-2006, 09:13 AM
Hello,

For the first time this week end, i've tried to use windows services with spring. I've no problem with the sample but when i try to develop my class in VB.Net with the framework 2.0 i've always the same error (see below file Spring.Service.Process.log).
If i compile my class with visual studio 2003 and just replace the dll in the bin directory of my service, i've no error...

I've no problem with spring remoting and framework 2.0, any ideas ?



2006-01-16 10:04:03,335 [1876] ERROR DeployManager - Failed deploy of application at D:\Spring\Spring.NET-20051219-1448\examples\Spring\Spring.Examples.WindowsServic e\ServiceFakedInstDir\deploy\test
System.Reflection.TargetInvocationException: Une exception a été levée par la cible d'un appel. ---> Spring.Objects.Factory.ObjectDefinitionStoreExcept ion: Error registering object with name 'server' defined in 'file [D:\Spring\Spring.NET-20051219-1448\examples\Spring\Spring.Examples.WindowsServic e\ServiceFakedInstDir\deploy\test\service.xml] at line 9' : Object class [MyCompany.Server.MyServer, MyCompany.Server] not found.
<object name="server" type="MyCompany.Server.MyServer, MyCompany.Server" init-method="Start" destroy-method="Shu... ---> System.TypeLoadException: Could not load type from string value 'MyCompany.Server.MyServer, MyCompany.Server'.
at Spring.Util.TypeResolver.Resolve(String typeName)
at Spring.Util.CachedTypeResolver.Resolve(String typeName)
at Spring.Objects.ObjectUtils.ResolveType(String typeName)
at Spring.Objects.Factory.Support.DefaultObjectDefini tionFactory.CreateObjectDefinition(String typeName, String parent, ConstructorArgumentValues arguments, MutablePropertyValues properties, AppDomain domain)
at Spring.Objects.Factory.Xml.DefaultXmlObjectDefinit ionParser.ParseObjectDefinition(XmlElement element, String id, XmlResourceReader parser)
--- Fin de la trace de la pile d'exception interne ---
at Spring.Objects.Factory.Xml.XmlResourceReader.Repor tException(XmlNode node, String name, String message, Exception cause)
at Spring.Objects.Factory.Xml.DefaultXmlObjectDefinit ionParser.ParseObjectDefinition(XmlElement element, String id, XmlResourceReader parser)
at Spring.Objects.Factory.Xml.DefaultXmlObjectDefinit ionParser.ParseObjectDefinition(XmlElement element, XmlResourceReader parser)
at Spring.Objects.Factory.Xml.DefaultXmlObjectDefinit ionParser.RegisterObjectDefinition(XmlElement element, XmlResourceReader parser)
at Spring.Objects.Factory.Xml.DefaultXmlObjectDefinit ionParser.ParseElement(XmlElement element, XmlResourceReader parser)
at Spring.Objects.Factory.Xml.XmlResourceReader.Regis terObjectDefinitions(XmlElement root)
at Spring.Objects.Factory.Xml.XmlObjectDefinitionRead er.RegisterObjectDefinitions(XmlElement objectsElement, IResource resource)
at Spring.Objects.Factory.Xml.XmlObjectDefinitionRead er.LoadObjectDefinitions(IResource resource)
at Spring.Objects.Factory.Xml.XmlObjectFactory..ctor( IResource resource, Boolean caseSensitive, IObjectFactory parentFactory)
at Spring.Objects.Factory.Xml.XmlObjectFactory..ctor( IResource resource)
at Spring.Services.WindowsService.Common.Application. DefaultFactory(IApplication application)
at Spring.Services.WindowsService.Common.Application. get_ObjectFactory()
at Spring.Services.WindowsService.Common.ApplicationH ost..ctor(AppDomain domain, IApplication application)
--- Fin de la trace de la pile d'exception interne ---

Server stack trace:
at System.Reflection.RuntimeConstructorInfo.InternalI nvoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean isBinderDefault)
at System.Reflection.RuntimeConstructorInfo.Invoke(Bi ndingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo)
at System.AppDomain.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityAttributes)
at System.Runtime.Remoting.Messaging.StackBuilderSink .PrivateProcessMessage(MethodBase mb, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink .SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleRe turnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData& msgData, Int32 type)
at System.AppDomain.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityAttributes)
at Spring.Services.WindowsService.Common.ApplicationH ost.CreateInstance(AppDomain domain, IApplication application)
at Spring.Services.WindowsService.Common.Deploy.Separ ateAppDomainHostManager.Start(IApplication application)
at Spring.Services.WindowsService.Common.Deploy.Defau ltDeployer.Deploy(IApplication application)
at Spring.Services.WindowsService.Common.Deploy.Deplo yManager.Deploy(IApplication application)


My version of spring is the daily build : Spring.NET-20051219-1448 (i download it, in order to use AOP on remoting object)


edit : i tried to recompile the sample echo.cs with visual studio 2005 and when i replace the old dll with the new in .net 2.0 i've the same error

0:29:12,308 [3464] ERROR DeployManager - Failed deploy of application at D:\Spring\Spring.NET-20051219-1448\examples\Spring\Spring.Examples.WindowsServic e\ServiceFakedInstDir\deploy\echo
System.Reflection.TargetInvocationException: Une exception a été levée par la cible d'un appel. ---> Spring.Objects.Factory.ObjectDefinitionStoreExcept ion: Error registering object with name 'echo' defined in 'file [D:\Spring\Spring.NET-20051219-1448\examples\Spring\Spring.Examples.WindowsServic e\ServiceFakedInstDir\deploy\echo\service.xml] at line 4' : Object class [Spring.Examples.WindowsService.Echo, Echo] not found.
<object name="echo" type="Spring.Examples.WindowsService.Echo, Echo" init-method="Start" destroy-method="Stop" xmlns="ht... ---> System.TypeLoadException: Could not load type from string value 'Spring.Examples.WindowsService.Echo, Echo'.
at Spring.Util.TypeResolver.Resolve(String typeName) in D:\Spring\Spring.NET-20051219-1448\src\Spring\Spring.Core\Util\TypeResolver.cs:l ine 72
at Spring.Util.CachedTypeResolver.Resolve(String typeName) in D:\Spring\Spring.NET-20051219-1448\src\Spring\Spring.Core\Util\CachedTypeResolve r.cs:line 100
at Spring.Objects.ObjectUtils.ResolveType(String typeName) in D:\Spring\Spring.NET-20051219-1448\src\Spring\Spring.Core\Objects\ObjectUtils.cs :line 307
at Spring.Objects.Factory.Support.DefaultObjectDefini tionFactory.CreateObjectDefinition(String typeName, String parent, ConstructorArgumentValues arguments, MutablePropertyValues properties, AppDomain domain) in D:\Spring\Spring.NET-20051219-1448\src\Spring\Spring.Core\Objects\Factory\Suppor t\DefaultObjectDefinitionFactory.cs:line 82
at Spring.Objects.Factory.Xml.DefaultXmlObjectDefinit ionParser.ParseObjectDefinition(XmlElement element, String id, XmlResourceReader parser) in D:\Spring\Spring.NET-20051219-1448\src\Spring\Spring.Core\Objects\Factory\Xml\De faultXmlObjectDefinitionParser.cs:line 453
--- Fin de la trace de la pile d'exception interne ---
at Spring.Objects.Factory.Xml.XmlResourceReader.Repor tException(XmlNode node, String name, String message, Exception cause) in D:\Spring\Spring.NET-20051219-1448\src\Spring\Spring.Core\Objects\Factory\Xml\Xm lResourceReader.cs:line 325
at Spring.Objects.Factory.Xml.DefaultXmlObjectDefinit ionParser.ParseObjectDefinition(XmlElement element, String id, XmlResourceReader parser) in D:\Spring\Spring.NET-20051219-1448\src\Spring\Spring.Core\Objects\Factory\Xml\De faultXmlObjectDefinitionParser.cs:line 524
at Spring.Objects.Factory.Xml.DefaultXmlObjectDefinit ionParser.ParseObjectDefinition(XmlElement element, XmlResourceReader parser) in D:\Spring\Spring.NET-20051219-1448\src\Spring\Spring.Core\Objects\Factory\Xml\De faultXmlObjectDefinitionParser.cs:line 358
at Spring.Objects.Factory.Xml.DefaultXmlObjectDefinit ionParser.RegisterObjectDefinition(XmlElement element, XmlResourceReader parser) in D:\Spring\Spring.NET-20051219-1448\src\Spring\Spring.Core\Objects\Factory\Xml\De faultXmlObjectDefinitionParser.cs:line 296
at Spring.Objects.Factory.Xml.DefaultXmlObjectDefinit ionParser.ParseElement(XmlElement element, XmlResourceReader parser) in D:\Spring\Spring.NET-20051219-1448\src\Spring\Spring.Core\Objects\Factory\Xml\De faultXmlObjectDefinitionParser.cs:line 156
at Spring.Objects.Factory.Xml.XmlResourceReader.Regis terObjectDefinitions(XmlElement root) in D:\Spring\Spring.NET-20051219-1448\src\Spring\Spring.Core\Objects\Factory\Xml\Xm lResourceReader.cs:line 210
at Spring.Objects.Factory.Xml.XmlObjectDefinitionRead er.RegisterObjectDefinitions(XmlElement objectsElement, IResource resource) in D:\Spring\Spring.NET-20051219-1448\src\Spring\Spring.Core\Objects\Factory\Xml\Xm lObjectDefinitionReader.cs:line 424
at Spring.Objects.Factory.Xml.XmlObjectDefinitionRead er.LoadObjectDefinitions(IResource resource) in D:\Spring\Spring.NET-20051219-1448\src\Spring\Spring.Core\Objects\Factory\Xml\Xm lObjectDefinitionReader.cs:line 273
at Spring.Objects.Factory.Xml.XmlObjectFactory..ctor( IResource resource, Boolean caseSensitive, IObjectFactory parentFactory) in D:\Spring\Spring.NET-20051219-1448\src\Spring\Spring.Core\Objects\Factory\Xml\Xm lObjectFactory.cs:line 129
at Spring.Objects.Factory.Xml.XmlObjectFactory..ctor( IResource resource) in D:\Spring\Spring.NET-20051219-1448\src\Spring\Spring.Core\Objects\Factory\Xml\Xm lObjectFactory.cs:line 75
at Spring.Services.WindowsService.Common.Application. DefaultFactory(IApplication application)
at Spring.Services.WindowsService.Common.Application. get_ObjectFactory()
at Spring.Services.WindowsService.Common.ApplicationH ost..ctor(AppDomain domain, IApplication application)

Thanks for your help.

bchebrou
01-16-2006, 10:29 AM
I've downloaded the last nightlybuild today (Spring.NET-20060114-2203), i've the same error, but the trace is not exactly the same. If it could be helpful, I can post it.

Rick Evans
01-16-2006, 11:42 AM
Hi bchebrou

Yes if you could post it (the new stack trace) it would be good.

One of the issues I've encountered with .NET 2.0 and Spring is that the use of the full assembly name with all of the assembly information (public key, version, culture, etc) has been promoted as best practice.... the old style of configuration where one just specifies the has been deprecated.

This is a bit of a pain when developing though... can you try specifying the full unexpurgated type name (http://www.springframework.net/doc/reference/html/objects.html#ftn.d0e603) with all of the relevant assembly information in your configuration file?

Cheers
Rick

bchebrou
01-16-2006, 12:53 PM
Ok, i'm gonna try it !

here is the log file with the last nightly build. I've juste recompile the echo.cs file with visual studio 2005 and replace the dll in the bin directory

thanks for your quick answer :)

2006-01-16 13:46:07,623 [4004] ERROR DeployManager - Failed deploy of application at D:\Spring\Spring.NET-20060114-2203\examples\Spring\Spring.Examples.WindowsServic e\ServiceFakedInstDir\deploy\echo
System.Reflection.TargetInvocationException: Une exception a été levée par la cible d'un appel. ---> System.Configuration.ConfigurationException: Error instantiating context. ---> Spring.Objects.FatalObjectException: Cannot instantiate Type [Spring.Context.Support.XmlApplicationContext] using ctor [Void .ctor(Boolean, System.String[])] : 'Une exception a été levée par la cible d'un appel.' ---> System.Reflection.TargetInvocationException: Une exception a été levée par la cible d'un appel. ---> Spring.Objects.Factory.ObjectDefinitionStoreExcept ion: Error registering object with name 'echo' defined in 'file [D:\Spring\Spring.NET-20060114-2203\examples\Spring\Spring.Examples.WindowsServic e\ServiceFakedInstDir\deploy\echo\service.xml] at line 7' : Object class [Spring.Examples.WindowsService.Echo, Echo] not found.
<object name="echo" type="Spring.Examples.WindowsService.Echo, Echo" init-method="Start" destroy-method="Stop" xmlns="ht... ---> System.TypeLoadException: Could not load type from string value 'Spring.Examples.WindowsService.Echo, Echo'.
at Spring.Util.TypeResolver.Resolve(String typeName) in D:\Spring\Spring.NET-20060114-2203\src\Spring\Spring.Core\Util\TypeResolver.cs:l ine 72
at Spring.Util.CachedTypeResolver.Resolve(String typeName) in D:\Spring\Spring.NET-20060114-2203\src\Spring\Spring.Core\Util\CachedTypeResolve r.cs:line 100
at Spring.Objects.ObjectUtils.ResolveType(String typeName) in D:\Spring\Spring.NET-20060114-2203\src\Spring\Spring.Core\Objects\ObjectUtils.cs :line 307
at Spring.Objects.Factory.Support.DefaultObjectDefini tionFactory.CreateObjectDefinition(String typeName, String parent, ConstructorArgumentValues arguments, MutablePropertyValues properties, AppDomain domain) in D:\Spring\Spring.NET-20060114-2203\src\Spring\Spring.Core\Objects\Factory\Suppor t\DefaultObjectDefinitionFactory.cs:line 82
at Spring.Objects.Factory.Xml.DefaultXmlObjectDefinit ionParser.ParseObjectDefinition(XmlElement element, String id, XmlResourceReader parser) in D:\Spring\Spring.NET-20060114-2203\src\Spring\Spring.Core\Objects\Factory\Xml\De faultXmlObjectDefinitionParser.cs:line 453
--- Fin de la trace de la pile d'exception interne ---
at Spring.Objects.Factory.Xml.XmlResourceReader.Repor tException(XmlNode node, String name, String message, Exception cause) in D:\Spring\Spring.NET-20060114-2203\src\Spring\Spring.Core\Objects\Factory\Xml\Xm lResourceReader.cs:line 325
at Spring.Objects.Factory.Xml.DefaultXmlObjectDefinit ionParser.ParseObjectDefinition(XmlElement element, String id, XmlResourceReader parser) in D:\Spring\Spring.NET-20060114-2203\src\Spring\Spring.Core\Objects\Factory\Xml\De faultXmlObjectDefinitionParser.cs:line 524
at Spring.Objects.Factory.Xml.DefaultXmlObjectDefinit ionParser.ParseObjectDefinition(XmlElement element, XmlResourceReader parser) in D:\Spring\Spring.NET-20060114-2203\src\Spring\Spring.Core\Objects\Factory\Xml\De faultXmlObjectDefinitionParser.cs:line 358
at Spring.Objects.Factory.Xml.DefaultXmlObjectDefinit ionParser.RegisterObjectDefinition(XmlElement element, XmlResourceReader parser) in D:\Spring\Spring.NET-20060114-2203\src\Spring\Spring.Core\Objects\Factory\Xml\De faultXmlObjectDefinitionParser.cs:line 296
at Spring.Objects.Factory.Xml.DefaultXmlObjectDefinit ionParser.ParseElement(XmlElement element, XmlResourceReader parser) in D:\Spring\Spring.NET-20060114-2203\src\Spring\Spring.Core\Objects\Factory\Xml\De faultXmlObjectDefinitionParser.cs:line 156
at Spring.Objects.Factory.Xml.XmlResourceReader.Regis terObjectDefinitions(XmlElement root) in D:\Spring\Spring.NET-20060114-2203\src\Spring\Spring.Core\Objects\Factory\Xml\Xm lResourceReader.cs:line 210
at Spring.Objects.Factory.Xml.XmlObjectDefinitionRead er.RegisterObjectDefinitions(XmlElement objectsElement, IResource resource) in D:\Spring\Spring.NET-20060114-2203\src\Spring\Spring.Core\Objects\Factory\Xml\Xm lObjectDefinitionReader.cs:line 424
at Spring.Objects.Factory.Xml.XmlObjectDefinitionRead er.LoadObjectDefinitions(IResource resource) in D:\Spring\Spring.NET-20060114-2203\src\Spring\Spring.Core\Objects\Factory\Xml\Xm lObjectDefinitionReader.cs:line 273
at Spring.Context.Support.AbstractXmlApplicationConte xt.LoadObjectDefinitions(XmlObjectDefinitionReader objectDefinitionReader) in D:\Spring\Spring.NET-20060114-2203\src\Spring\Spring.Core\Context\Support\Abstra ctXmlApplicationContext.cs:line 206
at Spring.Context.Support.AbstractXmlApplicationConte xt.RefreshObjectFactory() in D:\Spring\Spring.NET-20060114-2203\src\Spring\Spring.Core\Context\Support\Abstra ctXmlApplicationContext.cs:line 121
at Spring.Context.Support.AbstractApplicationContext. Refresh() in D:\Spring\Spring.NET-20060114-2203\src\Spring\Spring.Core\Context\Support\Abstra ctApplicationContext.cs:line 761
at Spring.Context.Support.XmlApplicationContext..ctor (Boolean caseSensitive, IApplicationContext parentContext, String[] configurationLocations) in D:\Spring\Spring.NET-20060114-2203\src\Spring\Spring.Core\Context\Support\XmlApp licationContext.cs:line 145
at Spring.Context.Support.XmlApplicationContext..ctor (Boolean caseSensitive, String[] configurationLocations) in D:\Spring\Spring.NET-20060114-2203\src\Spring\Spring.Core\Context\Support\XmlApp licationContext.cs:line 106
--- Fin de la trace de la pile d'exception interne ---
at System.Reflection.RuntimeConstructorInfo.InternalI nvoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean isBinderDefault)
at System.Reflection.RuntimeConstructorInfo.Invoke(Bi ndingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.ConstructorInfo.Invoke(Object[] parameters)
at Spring.Objects.ObjectUtils.InstantiateType(Constru ctorInfo constructor, Object[] arguments) in D:\Spring\Spring.NET-20060114-2203\src\Spring\Spring.Core\Objects\ObjectUtils.cs :line 162
--- Fin de la trace de la pile d'exception interne ---
at Spring.Objects.ObjectUtils.InstantiateType(Constru ctorInfo constructor, Object[] arguments) in D:\Spring\Spring.NET-20060114-2203\src\Spring\Spring.Core\Objects\ObjectUtils.cs :line 167
at Spring.Context.Support.RootContextInstantiator.Inv okeContextConstructor(ConstructorInfo ctor) in D:\Spring\Spring.NET-20060114-2203\src\Spring\Spring.Core\Context\Support\Contex tHandler.cs:line 459
at Spring.Context.Support.ContextInstantiator.Instant iateContext() in D:\Spring\Spring.NET-20060114-2203\src\Spring\Spring.Core\Context\Support\Contex tHandler.cs:line 392
--- Fin de la trace de la pile d'exception interne ---
at Spring.Context.Support.ContextInstantiator.Instant iateContext() in D:\Spring\Spring.NET-20060114-2203\src\Spring\Spring.Core\Context\Support\Contex tHandler.cs:line 403
at Spring.Context.Support.ContextHandler.Create(Objec t parent, Object configContext, XmlNode section) in D:\Spring\Spring.NET-20060114-2203\src\Spring\Spring.Core\Context\Support\Contex tHandler.cs:line 266
at System.Configuration.ConfigurationRecord.EvaluateR ecursive(IConfigurationSectionHandler factory, Object config, String[] keys, Int32 iKey, XmlTextReader reader)
at System.Configuration.ConfigurationRecord.EvaluateR ecursive(IConfigurationSectionHandler factory, Object config, String[] keys, Int32 iKey, XmlTextReader reader)
at System.Configuration.ConfigurationRecord.Evaluate( String configKey)
at System.Configuration.ConfigurationRecord.ResolveCo nfig(String configKey)
at System.Configuration.ConfigurationRecord.GetConfig (String configKey)
at System.Configuration.DefaultConfigurationSystem.Sy stem.Configuration.IConfigurationSystem.GetConfig( String configKey)
at System.Configuration.ConfigurationSettings.GetConf ig(String sectionName)
at Spring.Context.Support.ContextRegistry.CreateRootC ontextIfNeeded() in D:\Spring\Spring.NET-20060114-2203\src\Spring\Spring.Core\Context\Support\Contex tRegistry.cs:line 184
at Spring.Context.Support.ContextRegistry.GetContext( ) in D:\Spring\Spring.NET-20060114-2203\src\Spring\Spring.Core\Context\Support\Contex tRegistry.cs:line 170
at Spring.Services.WindowsService.Common.Application. DefaultFactory(IApplication application)
at Spring.Services.WindowsService.Common.Application. get_ObjectFactory()
at Spring.Services.WindowsService.Common.ApplicationH ost..ctor(AppDomain domain, IApplication application)
--- Fin de la trace de la pile d'exception interne ---

Server stack trace:
at System.Reflection.RuntimeConstructorInfo.InternalI nvoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean isBinderDefault)
at System.Reflection.RuntimeConstructorInfo.Invoke(Bi ndingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo)
at System.AppDomain.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityAttributes)
at System.Runtime.Remoting.Messaging.StackBuilderSink .PrivateProcessMessage(MethodBase mb, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink .SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleRe turnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData& msgData, Int32 type)
at System.AppDomain.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityAttributes)
at Spring.Services.WindowsService.Common.ApplicationH ost.CreateInstance(AppDomain domain, IApplication application) in D:\Spring\Spring.NET-20060114-2203\src\Spring\Spring.Services\WindowsService\Com mon\ApplicationHost.cs:line 73
at Spring.Services.WindowsService.Common.Deploy.Separ ateAppDomainHostManager.CreateHostHandle(AppDomain domain, IApplication application) in D:\Spring\Spring.NET-20060114-2203\src\Spring\Spring.Services\WindowsService\Com mon\Deploy\SeparateAppDomainHostManager.cs:line 64
at Spring.Services.WindowsService.Common.Deploy.Separ ateAppDomainHostManager.Start(IApplication application) in D:\Spring\Spring.NET-20060114-2203\src\Spring\Spring.Services\WindowsService\Com mon\Deploy\SeparateAppDomainHostManager.cs:line 41
at Spring.Services.WindowsService.Common.Deploy.Defau ltDeployer.Deploy(IApplication application) in D:\Spring\Spring.NET-20060114-2203\src\Spring\Spring.Services\WindowsService\Com mon\Deploy\DefaultDeployer.cs:line 63
at Spring.Services.WindowsService.Common.Deploy.Deplo yManager.Deploy(IApplication application) in D:\Spring\Spring.NET-20060114-2203\src\Spring\Spring.Services\WindowsService\Com mon\Deploy\DeployManager.cs:line 238

bchebrou
01-16-2006, 01:40 PM
So, i've tried, and i have always the same error :(

Here my service.xml file


<object name="echo"
type="Spring.Examples.WindowsService.Echo, Echo, Version=1.0.0.0"
init-method="Start" destroy-method="Stop">

<property name="port"><value>${port}</value></property>
<property name="welcomeMessage" value="This is echo running at [${spring.services.application.fullpath}]"/>
</object>

I'm pretty sure of that is correct (i checked assembly information with Reflector)

Others tests of service.xml file with the same error :


<object name="echo"
type="Spring.Examples.WindowsService.Echo, Echo, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
init-method="Start" destroy-method="Stop">

<property name="port"><value>${port}</value></property>
<property name="welcomeMessage" value="This is echo running at [${spring.services.application.fullpath}]"/>
</object>



<object name="echo"
type="Spring.Examples.WindowsService.Echo, Echo, Version=1.0.0.0, Culture=neutral"
init-method="Start" destroy-method="Stop">

<property name="port"><value>${port}</value></property>
<property name="welcomeMessage" value="This is echo running at [${spring.services.application.fullpath}]"/>
</object>

bchebrou
01-16-2006, 05:23 PM
OK, it's my mistake... it was a bit confusing.

In this case it's Spring.Services.WindowsService.Process.exe which launches the process. So it's an application in 1.1 .net framework and in this context an assembly in 2.0 can't be load : BadImageFormatException.

I recompile Spring.Services.WindowsService.Process.exe and it's dependencies in 2.0 and now it's ok!

In an other application in 2.0, i used spring without recompiling and all was ok! But in this case the application was a windows form.

In conclusion an application in 2.0 can ask to a dll in 1.1 to load an dll in 2.0 but an application in 1.1 can't load an dll in 2.0

So, my question is : When a version of spring in 2.0 ? :wink: