开发者

mod_mono question: Could not resolve the name 'ConfigurationManager'

I'm running mod_mono 2.4.4 on Ubuntu and I'm finding that I've had to go through my VB files and add "imports System.Configuration" to all of them to resolve the name error. This was not necessary in mod_aspdotnet on the Windows side.

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


    System.Web.Compilation.Com开发者_StackOverflow中文版pilationException: 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] 

Is this the result of a missed step or incorrect configuration that I have to keep adding this import?


Somewhere, probably /etc/mono/2.0/web.config, there's a default configuration file. Verify that it contains something like this:

             <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>

Which is the default. That should take care of adding the default imports.

Btw, mod_mono 2.4.4 is a bit old these days. Try getting newer packages.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜