I have a simple Spring.NET demo, and I’m trying to have a shared object file that would reside on a shared drive. This works if I pass in the UNC path as a resource file to the constructor, but if use an <import resource construct it interprets it as relative, which is not supported. Is there a way I can use the import statement with a UNC path?
Works:
<context>
<resource uri="config://spring/objects"/>
<resource uri="\\server\share\folder\SpringConfig.xml"/>
</context>
Doesn’t work:
<import resource="\\server\share\folder\SpringConfig.xml"></import>
Error message:
System.Configuration.ConfigurationErrorsException: Error creating context ‘spring.root’: ConfigSectionResource does not support relative resources. Please use fully qualified resource name. —> Spring.Objects.Factory.ObjectDefinitionStoreException: Error registering object defined in ‘config [C:\Users\user\documents\visual studio 2010\Projects\SpringExample\SpringExample\bin\Debug\SpringExample.vshost.exe.Config#spring/objects] at line 1’ : Failed parsing element
—> System.NotSupportedException: ConfigSectionResource does not support relative resources. Please use fully qualified resource name.
Use the fully qualified resource string and use forward slashes throughout:
Note that file: protocol identifier is followed by four slashes, two belong to the protocol and two to the server location.
Worked on my machine :). This also works: