[Mono-list] Web service cannot find assembly when placed tosubfolder

Andrus Moor kobruleht2 at hot.ee
Fri Jun 5 17:13:15 EDT 2009


Robert,

> Try to remove "htdocs/bin" so that mod_mono does not detect
> the virtual path "/" as an application. Also remove
> htdocs/web.config and htdocs/global.asax, if any.

Thank you.  I removed those files and put whole application only to
htdocs/demo directory tree.
This works OK.

htdocs/demo/web.config contains application settings automatically added by
VWD2008:

<configuration>
....
 <applicationSettings>
  <MyApp.Service.Properties.Settings>
   <setting name="Password" serializeAs="String">
    <value>xxxxxxxx</value>
   </setting>
   <setting name="Server" serializeAs="String">
    <value>myserver.com</value>
   </setting>
  </MyApp.Service.Properties.Settings>
 </applicationSettings>
</configuration>

I tried to retrieve Server property value using

MyApp.Service.Properties.Settings.Default.Server

which references to autogenerated code below.
This returns default value (localhost) instead of correct value 
(myserver.com) from
web.config file.

If application is running from VWD2008 Express under ASP.NET development
server, Server property returns expected value.

How to read application settings in Mono web application ?
Should I create separate conf file or is it possible to read from web.config 
?

Andrus.

namespace MyApp.Service.Properties {

    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator",
"9.0.0.0")]
    internal sealed partial class Settings :
global::System.Configuration.ApplicationSettingsBase {

        private static Settings defaultInstance =
((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new
Settings())));

        public static Settings Default {
            get {
                return defaultInstance;
            }
        }

        [global::System.Configuration.ApplicationScopedSettingAttribute()]
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.Configuration.DefaultSettingValueAttribute("localhost")]
        public string Server {
            get {
                return ((string)(this["Server"]));
            }
        }
    }
}



More information about the Mono-list mailing list