Problem running a Jeff Prosise example

R

Richard Lionheart

Hi All,

I'm trying to run the third example in Chap. 8 (Custom Controls) of
Prosise's "Programming Microsoft .NET". He provided a directory Hello1
containing two files
- Hello1.aspx
- Hello1.cs
and a "bin" directory containing Hello.dll.

I copied the Hello1 directory to www.root, renamed it
TestCustomControl_Hello1 to and ran
http://localhost/TestCustomControl_Hello1/Hello1.aspx in Firefox and IE
browsers. They returned identical results error messages shown below,
apparently indicating the browser couldn't find the assembly referenced on
line 2. But the Hello.dll in the bin directory is indeed an assembly if
ILDASM.exe is to be believed.

Any ideas about what's wrong?
--
Thanks in Advance,
Richard

================= Error Message ===================

Description: An error occurred during the parsing of a resource required to
service this request. Please review the following specific parse error
details and modify your source file appropriately.

Parser Error Message: File or assembly name HelloControl, or one of its
dependencies, was not found.

Source File: f:\inetpub\wwwroot\TestCustomControl_Hello1\Hello1.aspx
Line: 1

Assembly Load Trace: The following information can be helpful to determine
why the assembly 'HelloControl' could not be loaded.


=== Pre-bind state information ===
LOG: DisplayName = HelloControl
(Partial)
LOG: Appbase = file:///f:/inetpub/wwwroot
LOG: Initial PrivatePath = bin
Calling assembly : (Unknown).
===

[snip]
 
R

Richard Lionheart

Hi All,

Here's more detail that may help you figure out what my problem is ... if
you're up to it :)

The subject example is taken from the CD accompanying Jeff Prosise's
"Programming Microsoft .NET", specifically the directory
Samples\Chap08\Hello1, which includes the following three files as shown
below.

I hope this helps in assessing the cause of my problem.

Regards,
Richard

============= Hello1.aspx =========
<%@ Register TagPrefix="win" Namespace="Wintellect"
Assembly="HelloControl" %>

<html>
<body>
<form runat="server">
<win:Hello RunAt="server" />
</form>
</body>
</html>

============= Hello1.cs=========
using System;
using System.Web.UI;

namespace Wintellect
{
public class Hello : Control
{
protected override void Render (HtmlTextWriter writer)
{
writer.Write ("Hello, world");
}
}
}

=========== bin/Hello.dll ===========
**** M A N I F E S T ****
..assembly extern /*23000001*/ System.Web
{
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) //
..?_....:
.ver 1:0:3300:0
}
..assembly extern /*23000002*/ mscorlib
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) //
..z\V.4..
.ver 1:0:3300:0
}
..assembly /*20000001*/ HelloControl
{
// --- The following custom attribute is added automatically, do not
uncomment -------
// .custom /*0C000001:0A000001*/ instance void [mscorlib/* 23000002
*/]System.Diagnostics.DebuggableAttribute/* 01000003 */::.ctor(bool,
//
bool) /* 0A000001 */ = ( 01 00 00 01 00 00 )
.hash algorithm 0x00008004
.ver 0:0:0:0
}
..module HelloControl.dll
// MVID: {4489FE53-7F7A-4131-AC09-769E7B04B3D3}
..imagebase 0x00400000
..subsystem 0x00000003
..file alignment 512
..corflags 0x00000001
// Image base: 0x03060000

**** **** Wintellect | Hello | .class public auto ansi beforefieldinit****
..class /*02000002*/ public auto ansi beforefieldinit Hello
extends [System.Web/* 23000001 */]System.Web.UI.Control/* 01000001 */
{
} // end of class Hello


**** **** Wintellect | Hello | extends [System.Web]System.Web.UI.Control
****


**** **** Wintellect | Hello | method.ctor : void() ****
..method /*06000002*/ public hidebysig specialname rtspecialname
instance void .ctor() cil managed
// SIG: 20 00 01
{
// Method begins at RVA 0x2068
// Code size 7 (0x7)
.maxstack 1
IL_0000: /* 02 | */ ldarg.0
IL_0001: /* 28 | (0A)000003 */ call instance void
[System.Web/* 23000001 */]System.Web.UI.Control/* 01000001 */::.ctor() /*
0A000003 */
IL_0006: /* 2A | */ ret
} // end of method Hello::.ctor


**** **** Wintellect | Hello | method Render : void(class
[System.Web]System.Web.UI.HtmlTextWriter ****
..method /*06000001*/ family hidebysig virtual
instance void Render(class [System.Web/* 23000001
*/]System.Web.UI.HtmlTextWriter/* 01000002 */ writer) cil managed
// SIG: 20 01 01 12 09
{
// Method begins at RVA 0x2050
// Code size 12 (0xc)
.maxstack 2
IL_0000: /* 03 | */ ldarg.1
IL_0001: /* 72 | (70)000001 */ ldstr "Hello, world" /*
70000001 */
IL_0006: /* 6F | (0A)000002 */ callvirt instance void
[mscorlib/* 23000002 */]System.IO.TextWriter/* 01000004 */::Write(string) /*
0A000002 */
IL_000b: /* 2A | */ ret
} // end of method Hello::Render
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top