mod_mono问题:无法解析名称'ConfigurationManager'

时间:2010-09-21 07:00:15

标签: apache ubuntu configurationmanager mod-mono

我正在Ubuntu上运行mod_mono 2.4.4并且我发现我必须浏览我的VB文件并为所有这些文件添加“import System.Configuration”以解决名称错误。这在Windows端的mod_aspdotnet中不是必需的。

 I have, however, run into one error of which I can't find the source:


    System.Web.Compilation.CompilationException: VBNC30451: Could not resolve the name 'ConfigurationManager'
  at System.Web.Compilation.AssemblyBuilder.BuildAssembly (System.Web.VirtualPath virtualPath, System.CodeDom.Compiler.CompilerParameters options) [0x00000] 
  at System.Web.Compilation.AssemblyBuilder.BuildAssembly (System.Web.VirtualPath virtualPath) [0x00000] 
  at System.Web.Compilation.BuildManager.GenerateAssembly (System.Web.Compilation.AssemblyBuilder abuilder, System.Collections.Generic.List`1 buildItems, System.Web.VirtualPath virtualPath, BuildKind buildKind) [0x00000] 
  at System.Web.Compilation.BuildManager.BuildAssembly (System.Web.VirtualPath virtualPath) [0x00000] 

这是错误步骤或错误配置的结果,我必须继续添加此导入吗?

1 个答案:

答案 0 :(得分:1)

某处,可能是 /etc/mono/2.0/web.config ,有一个默认的配置文件。验证它包含以下内容:

             <pages>
                    <namespaces>
                            <add namespace="System" />
                            <add namespace="System.Collections" />
                            <add namespace="System.Collections.Specialized" />
                            <add namespace="System.Configuration" />
                            <add namespace="System.Text" />
                            <add namespace="System.Text.RegularExpressions" />
                            <add namespace="System.Web" />
                            <add namespace="System.Web.Caching" />
                            <add namespace="System.Web.SessionState" />
                            <add namespace="System.Web.Security" />
                            <add namespace="System.Web.Profile" />
                            <add namespace="System.Web.UI" />
                            <add namespace="System.Web.UI.WebControls" />
                            <!-- <add namespace="System.Web.UI.WebControls.WebParts" /> -->
                            <add namespace="System.Web.UI.HtmlControls" />
                    </namespaces>
            </pages>

这是默认值。这应该注意添加默认导入。

顺便说一句,mod_mono 2.4.4这些天有点老了。尝试获取更新的包。