4 messaggi dal 29 marzo 2006
I'm trying to use a compiled custom server control.

I followed instructions found on MSDN:

1. add a reference to the dll into bin folder

2. put the @register directive in a web form

3. put the <uc:webgrid ... > directive into the web form to call the control

Here is the code:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="prova.aspx.cs" Inherits="prova" %>

<%@ Register TagPrefix="uc" Namespace="Inva.WebControls2" Assembly="bin/InvaWebControls2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<uc:webgrid id="wg1" runat="server"></uc:webgrid>
</div>
</form>
</body>
</html>

I got the error listed inthe title at IDE time and I cannto get rid of it despite many trials:
The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)

If I try the Register this way (without bin/):
<%@ Register TagPrefix="uc" Namespace="Inva.WebControls2" Assembly="bin/InvaWebControls2" %>

I get another error:
Could not load file or assembly 'System, Version=2.0.50727,Culture=neutral'or one of its dependencies. Unable to find specified file

I also tried to recompile the source and use the fresh generated dll without success.

Please give me a hint!

Thanks a lot.

Lucio Fassio
lfassio wrote:
I'm trying to use a compiled custom server control.

qui parliamo italiano, il minimo che tu possa fare è fare lo sforzo di parlare la nostra lingua.

Please give me a hint!

che non si mette "bin/", ma solo il nome dell'assembly, che poi viene cercato in automatico tra le directory utilizzate come reference in fare di compilazione, tra cui c'è anche /bin/

Daniele Bochicchio | ASPItalia.com | Libri
Chief Operating Officer@iCubed
Microsoft Regional Director & MVP
4 messaggi dal 29 marzo 2006
Daniele,

mi spiace, non pensavo di offendere dato che l'inglese in questo lavoro è la lingua universale.

Purtroppo come ho scritto nel post se non indico "bin/" nel path il messaggio che ottengo dice che la dll non viene trovata. Il Dependency Walker dice che non ci sono riferimenti mancanti (ma funzionerà con .Net?).

Ho anche provato a fare un progetto vuoto, solo con la dll e prendo sempre lo stesso errore.

Dove sto sbagliando ?

Grazie.

Lucio Fassio.

Daniele Bochicchio ha scritto:
lfassio wrote:
I'm trying to use a compiled custom server control.

qui parliamo italiano, il minimo che tu possa fare è fare lo sforzo di parlare la nostra lingua.

Please give me a hint!

che non si mette "bin/", ma solo il nome dell'assembly, che poi viene cercato in automatico tra le directory utilizzate come reference in fare di compilazione, tra cui c'è anche /bin/

Torna al forum | Feed RSS

ASPItalia.com non è responsabile per il contenuto dei messaggi presenti su questo servizio, non avendo nessun controllo sui messaggi postati nei propri forum, che rappresentano l'espressione del pensiero degli autori.