Robert Jordan a écrit :

Nicolas,

You have 2 choices:

1. remove the Src-attribute and precompile the code-behind file
   with mcs:

   <%@ Application language="C#" Inherits="Everquest2.Global" %>

   You may also rename Src to Codebehind. This way the code remains
   compatible with VS.NET.

2. don't precompile the code-behind file and remove the Everquest2
   assembly from bin:

   <%@ Application language="C#" Src="global.asax.cs" %>


Robert

Robert Jordan a écrit :

Nicolas,

Bin directory contain: everquest2-fr.dll and Npgsql.dll
If i run XSP on the website directory i get this error:


   /Compilation Error/

*Description: *Error compiling a resource required to service this request. Review your source file and modify it to fix this error.

*Error message: */tmp/root-temp-aspnet-0/ab3f0828/26794.0.cs(26,27) : error CS0433: The imported type `Everquest2.Global' is defined multiple times




You have shared the *source code* of the type Everquest2.Global
with everquest2-fr.dll and one of your pages. That kind of source
code "include" is not allowed in C#.

Robert

_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list


------------------------------------------------------------------------------------------
Global.asax.cs
------------------------------------------------------------------------------------------ <%@ Application language="C#" Src="global.asax.cs" Inherits="Everquest2.Global" %>

-------------------------------------------------------------------------------------------
Global.asax.cs
------------------------------------------------------------------------------------------
using System;
using System.Collections;
using System.ComponentModel;
using System.Web;
using System.Web.SessionState;

namespace Everquest2
{
    /// <summary>
    /// Summary description for Global.
    /// </summary>
    public class Global : System.Web.HttpApplication
    {
          /*public Global()
          {
                InitializeComponent();
} */ protected void Application_Start(Object sender, EventArgs e)
          {

          }

          protected void Session_Start(Object sender, EventArgs e)
          {                              Response.Write("123");
          }

protected void Application_BeginRequest(Object sender, EventArgs e)
          {


          }

protected void Application_EndRequest(Object sender, EventArgs e)
          {

          }

protected void Application_AuthenticateRequest(Object sender, EventArgs e)
          {


          }

          protected void Application_Error(Object sender, EventArgs e)
          {


          }

          protected void Session_End(Object sender, EventArgs e)
          {

          }

          protected void Application_End(Object sender, EventArgs e)
          {

          }

          #region Web Form Designer generated code
          /// <summary>
          /// Required method for Designer support - do not modify
          /// the contents of this method with the code editor.
          /// </summary>
          private void InitializeComponent()
          {             }
          #endregion
    }
}

------------------------------------------------------------------------------------------------------------- mcs -t:library *.cs -out:bin/Everquest2.dll -r:System.Web.dll -r:System.Data -r:System.Drawing.dll -r:Npgsql -------------------------------------------------------------------------------------------------------------

I don't understand why

In advance thanks,

CN
_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list


_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list

Thanks a lot for your answers.

My question is how do i use Global object in the case of i don't precompil my project. I did delete the library in bin but it seem 123 is never printed.

protected void Session_Start(Object sender, EventArgs e)
         {                              Response.Write("123");
         }

I use the solution with precompilation with Codebehind instaed of Src and it work fine.

Thanks a lot.

CN
_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to