Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7504065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T21:26:41+00:00 2026-05-29T21:26:41+00:00

I have a Spring.NET program with a configuration file. To smooth the transition from

  • 0

I have a Spring.NET program with a configuration file. To smooth the transition from test to prod I’d like to have an environment variable that gives the path to a shared config file, and use that to import a resource, however it appears the <import resource="path"/> is not being resolved. For example if I try to load the file <import resource="\\server\share\${computername}\SpringConfig.xml"/> I get a file not found exception as below:

System.Configuration.ConfigurationErrorsException: Error creating context ‘spring.root’: file [\server\share\${computername}\SpringConfig.xml] cannot be resolved to local file path – resource does not use ‘file:’ protocol. —> Spring.Objects.Factory.ObjectDefinitionStoreException: IOException parsing XML document from file [\server\share\${computername}\SpringConfig.xml] —> System.IO.FileNotFoundException: file [\server\share\${computername}\SpringConfig.xml] cannot be resolved to local file path – resource does not use ‘file:’ protocol.

Is there a way I can have a dynamic import path in Spring.NET, preferably without writing code?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T21:26:42+00:00Added an answer on May 29, 2026 at 9:26 pm

    You can do that anyway with some extra code:

    • Create your own FileSystemResource that will replace placeholders in the resource name. Start from overriding the existing FileSystemResource (In Spring.Core.IO namespace)

    • Register your new IResource implementation in the container using your own protocol name (ex: myfile://) See ref docs here for an example :

      1. In .NET configuration file (app.config/web.config)
        http://www.springframework.net/doc-latest/reference/html/resources.html#d4e2911
      2. In Spring configuration files
        http://www.springframework.net/doc-latest/reference/html/objects.html#context-custom-resourcehandler
    • Use it!
      resource=”myfile://\server\share\${computername}\SpringConfig.xml”

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a program written in VB.NET which stops a service that uses file
I have a VB.net program that I have reading a text file, what is
I have a windows .net program that (among other things) will display image files.
I have an ASP.NET program that sends a confirmation email with the following code:
I would like use from Spring.NET Aspect library Logging aspect together with log4Net. I
I am using vb.net 2010 and I have created a program that uses sockets
I have written a program that reads in a File object (really an XML
I'm using Spring.net with NHiberante (HibernateTemplate) to implement my DAO's. I also have some
Say I have a .NET class like so: public class Person { public string
I come from an ASP .Net background. I am now writing a Java program

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.