2

I have an issue with loading XML propertie file in my solution. in this function:

public ApplicationSettings readApplicationSettings ()
    {
        if (isDeserialized)
            return settings;
        XmlSerializer serializer = new XmlSerializer (typeof(ApplicationSettings));
        using (FileStream inputFileStream = 
               new FileStream(AppDomain.CurrentDomain.BaseDirectory + "ApplicationSettings.xml", FileMode.Open)) 
        {
            this.settings = (ApplicationSettings) serializer.Deserialize(inputFileStream);
        }
        isDeserialized = true;
        return settings;
    }

When run from the monoDeveloper, the solution runs perfectly well. When run from the release folder, application displays "could not lode file... ApplicationSettings.xml" error. Although when running the same built application from linux terminal, it runs without errors.

I've tried changing permissions for the application and it didn't help.

Help please.

  • Have you check this answer? This may help you: http://stackoverflow.com/questions/8669833/why-appdomain-currentdomain-basedirectory-not-contains-bin-in-asp-net-app – lpaloub Aug 02 '13 at 11:59

0 Answers0