Apache2 System.Web.Compilation.CompilationException上的Mono:VBNC30451:无法解析名称';类型';

Apache2 System.Web.Compilation.CompilationException上的Mono:VBNC30451:无法解析名称';类型';,compilation,mono,apache2,debian,mod-mono,asp.net,Compilation,Mono,Apache2,Debian,Mod Mono,Asp.net,我为运行在Debian 7上的apache2安装了mono和mod_mono 虽然它给了我这个错误: System.Web.Compilation.CompilationException VBNC30451: Could not resolve the name 'Type' Description: Error compiling a resource required to service this request. Review your source file and mod

我为运行在Debian 7上的apache2安装了mono和mod_mono

虽然它给了我这个错误:

System.Web.Compilation.CompilationException
VBNC30451: Could not resolve the name 'Type'

Description: Error compiling a resource required to service this request. Review your     source file and modify it to fix this error.
Details: VBNC30451: Could not resolve the name 'Type'
Error origin: Compiler
Error source file: /tempconvert.asmx
Exception stack trace:
at System.Web.Compilation.AssemblyBuilder.BuildAssembly (System.Web.VirtualPath virtualPath, System.CodeDom.Compiler.CompilerParameters options) [0x0035f] in /home/joaogl/mono-3.4.0/mcs/class/System.Web/System.Web.Compilation/AssemblyBuilder.cs:853 
at System.Web.Compilation.AssemblyBuilder.BuildAssembly (System.Web.VirtualPath virtualPath) [0x00000] in /home/joaogl/mono-3.4.0/mcs/class/System.Web/System.Web.Compilation/AssemblyBuilder.cs:731 
at System.Web.Compilation.BuildManager.GenerateAssembly (System.Web.Compilation.AssemblyBuilder abuilder, System.Web.Compilation.BuildProviderGroup group, System.Web.VirtualPath vp, Boolean debug) [0x00258] in /home/joaogl/mono-3.4.0/mcs/class/System.Web/System.Web.Compilation/BuildManager.cs:846 
at System.Web.Compilation.BuildManager.BuildInner (System.Web.VirtualPath vp, Boolean debug) [0x0011c] in /home/joaogl/mono-3.4.0/mcs/class/System.Web/System.Web.Compilation/BuildManager.cs:469 

我该如何解决这个问题?

如果我了解您问题的本质(我也遇到过同样的问题),那么:

  • 遵循以下()安装说明“Debian上的mod_mono和Apache”
  • 使用此()生成Apache mod_mono配置文件
  • 如果您在
    apache2.conf
    中设置了
    MonoServerPath which”/usr/bin/mod-mono-server2“
    ,请将其删除
  • 然后,您可以测试它是如何工作的

    创建
    index.aspx
    并将其放入
    htdocs
    目录或您如何调用它

    <%@ Page Language="C#" AutoEventWireup="true"%>  
    
    <!DOCTYPE html>        
    <script runat="server">  
        protected void Button1_Click(object sender, System.EventArgs e)  
        {  
            //initialize a datetime variable with current datetime  
            DateTime now = DateTime.Now;  
    
            Label1.Text = "now : " + now.ToString();  
    
            //add 2 minutes to current time  
            DateTime dateAfter2Minutes = now.AddMinutes(2);  
    
            TimeSpan ts = dateAfter2Minutes - now;  
            //total milliseconds difference between two datetime object  
            int milliseconds = (int)ts.TotalMilliseconds;  
    
            Label1.Text += "<br ><br />after two minutes: ";  
            Label1.Text += dateAfter2Minutes.ToString();  
    
            Label1.Text += "<br ><br />smillieconds difference between to datetime object : ";  
            Label1.Text += milliseconds;  
        }  
    </script>        
    
    <html xmlns="http://www.w3.org/1999/xhtml">        
    <head id="Head1" runat="server">        
        <title>c# example - datetime difference in milliseconds</title>        
    </head>        
    <body>        
        <form id="form1" runat="server">        
        <div>        
            <h2 style="color:MidnightBlue; font-style:italic;">        
                c# example - datetime difference in milliseconds  
            </h2>        
            <hr width="550" align="left" color="Gainsboro" />        
            <asp:Label         
                ID="Label1"         
                runat="server"        
                Font-Size="Large"      
                Font-Names="Comic Sans MS"  
                >        
            </asp:Label>        
            <br /><br />      
            <asp:Button         
                ID="Button1"         
                runat="server"         
                Text="get milliseconds difference between two datetime"        
                OnClick="Button1_Click"      
                Height="40"        
                Font-Bold="true"        
                />        
        </div>        
        </form>        
    </body>        
    </html>
    
    
    受保护的无效按钮1\u单击(对象发送者,System.EventArgs e)
    {  
    //使用当前日期时间初始化日期时间变量
    DateTime now=DateTime.now;
    Label1.Text=“现在:”+now.ToString();
    //将2分钟添加到当前时间
    DateTime dateAfter2Minutes=now.AddMinutes(2);
    TimeSpan ts=日期后2分钟-现在;
    //两个datetime对象之间的总毫秒差
    int毫秒=(int)ts.total毫秒;
    标签1.Text+=“

    两分钟后:”; Label1.Text+=dateAfter2Minutes.ToString(); Label1.Text+=“

    到日期时间对象之间的秒差:”; Label1.Text+=毫秒; } c#示例-以毫秒为单位的日期时间差 c#示例-以毫秒为单位的日期时间差