[Mono-list] Cannot find Assembly ASP

Gilles FAVIER gilles.favier2605@wanadoo.fr
Thu, 7 Apr 2005 18:51:00 +0200 (CEST)


Hi,=20

no i am sorry it doesnot work either... I really think that it comes from t=
he library that are not linked or something like that but i have no idea ho=
w to link them or add the path where they are when i am compiling...
I still get the same error message...
I am going to try this MONO_PATH modification...=20


Thanks for your help Mario, if you ever get that dll i am trying to generat=
e....


Well to give you all my code :=20


------ Start AssemblyInfo.cs --------------
using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the followin=
g=20
// set of attributes. Change these attribute values to modify the informati=
on
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]=09=09

//
// Version information for an assembly consists of the following four value=
s:
//
//      Major Version
//      Minor Version=20
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build=
 Numbers=20
// by using the '*' as shown below:

[assembly: AssemblyVersion("1.0.*")]


[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

------ end AssemblyInfo.cs --------------



------ start Global.asax  --------------

using System;
using System.Collections;
using System.ComponentModel;
using System.Web;
using System.Web.SessionState;

namespace WebTest=20
{
=09/// <summary>
=09/// Summary description for Global.
=09/// </summary>
=09public class Global : System.Web.HttpApplication
=09{
=09=09/// <summary>
=09=09/// Required designer variable.
=09=09/// </summary>
=09=09private System.ComponentModel.IContainer components =3D null;

=09=09public Global()
=09=09{
=09=09=09InitializeComponent();
=09=09}=09
=09=09
=09=09protected void Application_Start(Object sender, EventArgs e)
=09=09{

=09=09}
=20
=09=09protected void Session_Start(Object sender, EventArgs e)
=09=09{

=09=09}

=09=09protected void Application_BeginRequest(Object sender, EventArgs e)
=09=09{

=09=09}

=09=09protected void Application_EndRequest(Object sender, EventArgs e)
=09=09{

=09=09}

=09=09protected void Application_AuthenticateRequest(Object sender, EventAr=
gs e)
=09=09{

=09=09}

=09=09protected void Application_Error(Object sender, EventArgs e)
=09=09{

=09=09}

=09=09protected void Session_End(Object sender, EventArgs e)
=09=09{

=09=09}

=09=09protected void Application_End(Object sender, EventArgs e)
=09=09{

=09=09}
=09=09=09
=09=09#region Web Form Designer generated code
=09=09/// <summary>
=09=09/// Required method for Designer support - do not modify
=09=09/// the contents of this method with the code editor.
=09=09/// </summary>
=09=09private void InitializeComponent()
=09=09{   =20
=09=09=09this.components =3D new System.ComponentModel.Container();
=09=09}
=09=09#endregion
=09}
}



------ end Global.asax  --------------


------ start Default.aspx  --------------


<%@ Page language=3D"c#" Codebehind=3D"Default.aspx.cs" AutoEventWireup=3D"=
false" Inherits=3D"WebTest._Default" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
=09<HEAD>
=09=09<title>Default</title>
=09=09<meta name=3D"GENERATOR" Content=3D"Microsoft Visual Studio .NET 7.1"=
>
=09=09<meta name=3D"CODE_LANGUAGE" Content=3D"C#">
=09=09<meta name=3D"vs_defaultClientScript" content=3D"JavaScript">
=09=09<meta name=3D"vs_targetSchema" content=3D"http://schemas.microsoft.co=
m/intellisense/ie5">
=09</HEAD>
=09<body>
=09=09<form id=3D"Form1" method=3D"post" runat=3D"server">
=09=09=09<P>
=09=09=09=09<asp:Label id=3D"LBSQL" runat=3D"server">Label</asp:Label><BR>
=09=09=09=09<asp:Button id=3D"BTGO" runat=3D"server" Text=3D"GO >>"></asp:B=
utton></P>
=09=09=09<P>
=09=09=09=09<asp:Label id=3D"LBResult" runat=3D"server" BackColor=3D"#FFFFC=
0">Label</asp:Label></P>
=09=09</form>
=09</body>
</HTML>

------ end Default.aspx  --------------




------ start Default.aspx.cs  --------------

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.OracleClient;

namespace WebTest
{
=09/// <summary>
=09/// Summary description for _Default.
=09/// </summary>
=09public class _Default : System.Web.UI.Page
=09{
=09=09protected System.Web.UI.WebControls.Button BTGO;
=09=09protected System.Web.UI.WebControls.Label LBResult;
=09=09protected System.Web.UI.WebControls.Label LBSQL;
=09
=09=09private void Page_Load(object sender, System.EventArgs e)
=09=09{
=09=09=09// Put user code to initialize the page here
=09=09}

=09=09#region Web Form Designer generated code
=09=09override protected void OnInit(EventArgs e)
=09=09{
=09=09=09//
=09=09=09// CODEGEN: This call is required by the ASP.NET Web Form Designer=
.
=09=09=09//
=09=09=09InitializeComponent();
=09=09=09base.OnInit(e);
=09=09}
=09=09
=09=09/// <summary>
=09=09/// Required method for Designer support - do not modify
=09=09/// the contents of this method with the code editor.
=09=09/// </summary>
=09=09private void InitializeComponent()
=09=09{   =20
=09=09=09this.BTGO.Click +=3D new System.EventHandler(this.BTGO_Click);
=09=09=09this.Load +=3D new System.EventHandler(this.Page_Load);

=09=09}
=09=09#endregion

=09=09private void BTGO_Click(object sender, System.EventArgs e)
=09=09{
=09=09=09LBResult.Text =3D "";
=09=09=09LBSQL.Text =3D  "SELECT COUNT(*) AS COUNTER FROM T_USER";

=09=09=09string connectionString =3D=20
=09=09=09=09"Data Source=3DXXXXX;User ID=3DXXXXXX;Password=3DXXXXXX;";
=09=09=09OracleConnection dbcon =3D null;
=09=09=09dbcon =3D new OracleConnection (connectionString);
=09=09=09dbcon.Open ();
=09=09=09OracleCommand dbcmd =3D dbcon.CreateCommand ();
=09=09=09string sql =3D LBSQL.Text;
=09=09=09dbcmd.CommandText =3D sql;=09=09=09
=09
=09=09=09OracleDataReader reader =3D dbcmd.ExecuteReader ();
=09=09=09
=09=09=09while(reader.Read())=20
=09=09=09{
=09=09=09=09LBResult.Text +=3D (string) reader["COUNTER"].ToString() + "<BR=
>";
=09=09=09}

=09=09=09reader.Close ();
=09=09=09reader =3D null;
=09=09=09dbcmd.Dispose ();
=09=09=09dbcmd =3D null;
=09=09=09dbcon.Close ();
=09=09=09dbcon =3D null;
=09=09}
=09}
}
=20

------ end Default.aspx.cs  --------------


> Message du 07/04/05 17:37
> De : "Mario Carri=C3=B3n" <mario.carrion@gmail.com>
> A : gilles.favier2605@wanadoo.fr
> Copie &agrave; : mono-list@lists.ximian.com
> Objet : Re: [Mono-list] Cannot find Assembly ASP
>=20
> On Thu, 2005-04-07 at 15:12 +0200, Gilles FAVIER wrote:
> > Hi,
> >=20
> > I am trying to connect to an Oracle database, when i am running my scri=
pt as an exe file, it compiles and then when i execute it works but when i =
try to it through a web page, i cannot compile the pages, i get the followi=
ng error message when i run :=20
> >=20
> > mcs /t:library /out:WebTest.dll -r:System -r:System.Data -r:System.Coll=
ections -r:System.ComponentModel -r:System.Drawing -r:System.Web -r:System.=
Web.SessionState -r:System.Web.UI -r:System.Web.UI.WebControls -r:System.We=
b.UI.HtmlControls -r:System.Data.OracleClient  AssemblyInfo.cs Default.aspx=
.cs Global.asax.cs
> > error CS0006: Cannot find assembly `System.Collections'
> > Log:
> > error CS0006: Cannot find assembly `System.ComponentModel'
> > Log:
> > error CS0006: Cannot find assembly `System.Web.SessionState'
> > Log:
> > error CS0006: Cannot find assembly `System.Web.UI'
> > Log:
> > error CS0006: Cannot find assembly `System.Web.UI.WebControls'
> > Log:
> > error CS0006: Cannot find assembly `System.Web.UI.HtmlControls'
> > Log:
> > Compilation failed: 6 error(s), 0 warnings
> >=20
> Try adding the '.dll' to the '-r's, example:
>=20
> mcs /t:library /out:WebTest.dll -r:System.dll -r:System.Data.dll
> -r:System.Collections.dll -r:System.ComponentModel.dll ....
>=20
> --=20
> Cheers
> ----------
> Mario Carri=C3=B3n
> http://monouml.sourceforge.net
>=20
>=20
>