views:

43

answers:

1

Hello, 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.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] 

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

+1  A: 

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.

Gonzalo
Thanks, I'm working on upgrading some things, although not by much. I'm running Ubuntu 10.04 Lucid Lynx and the Mono project says that 2.4 is the most recent package for that distro. (In all honestly I'm actually running Wubi on a Windows XP x64 Pro install). I'm effectively tri-booting Windows Vista x86, XP x64 Pro, and Ubuntu 10.04 x64. Your answer gave me hope but there is actually that exact statement in my web.config file for mono.
F_C
Oddly enough when I upgraded using Synaptic I got Mono 2.6.7. Anyway, it leads to a different problem which I will be addressing to a different question. Thanks for your help.
F_C
The only other thing is that VB.NET support in mono is not very good. If you can do whatever you're doing in C#, it will probably work. Another alternative is to precompile your site and copy it over to linux. This should work.
Gonzalo
Hmm... the precompile is a good idea. This is a client site written in VB.NET that they want tweaked, not redone. Otherwise I would definitely go C#, I prefer it anyway. This issue is just to prevent me from having to reboot to Windows just because I want to work on their site, then reboot back to Ubuntu. I'm running this on my own personal development server, btw. I'm not running into the 500 error on the production server (which is Windows no doubt). It's now saying "Cannot read from a closed StreamReader" since I updated, btw.
F_C