473,465 Members | 1,405 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

@assembly directive questions

I am attempting to use the IBM DB2Connection class in my .aspx web
page.

Using Visual Web Developer 2005 express, I cant figure out how to add a
reference to a project. heck, I cant figure out how to open a project!
so I am trying to use the @assembly directive to point directly to the
assembly .DLL that contains the DB2 namespace:

<%@ Assembly src="\db2_f11\ibm.data.db2.dll" %>

where db2_f11 is a virtual path that is mapped to C:\Program
Files\IBM\SQLLIB\BIN\netf11

When I point IE to my .aspx file I get an error, "no build provider
registered for the extension '.dll' " Which makes no sense to me. Why
do I have to build a DLL? Isnt it already built?

The question is: how do I reference this assembly in my .aspx web page?

thanks,

-Steve

Parser Error Message: There is no build provider registered for the
extension '.dll'. You can register one in the
<compilation><buildProviders> section in machine.config or web.config.
Make sure the appliesTo attribute includes the value 'Web' or 'All'.

Source Error:

Line 1: <!-- DemoPage.aspx : demonstration web page -->
Line 2: <%@ Page Language="C#" %>
Line 3: <%@ Assembly src="/db2_f11/ibm.data.db2.dll" %>
Line 4: <%@ Import Namespace="IBM.Data.DB2" %>
Line 5: <%@ Import Namespace="System.Data" %>

Nov 19 '05 #1
7 3108
You should either add a reference by copying the dependent DLLs into your
~/bin directory, or if the DLLs you need are in the GAC then you can use
the @assembly by specifying the assembly's fully qualified name:

<%@ Assembly Name="SomeAssemblyNameWithOutTheDLLExtension, Culture=neutral,
Version=1.2.0.0, PublicKeyToken=38218fe715288aac" %>

The Version and PublicKeyToken you should gte from looking in the GAC (which
is c:\windows\assembly).

-Brock
DevelopMentor
http://staff.develop.com/ballen
I am attempting to use the IBM DB2Connection class in my .aspx web
page.

Using Visual Web Developer 2005 express, I cant figure out how to add
a reference to a project. heck, I cant figure out how to open a
project!

so I am trying to use the @assembly directive to point directly to the
assembly .DLL that contains the DB2 namespace:

<%@ Assembly src="\db2_f11\ibm.data.db2.dll" %>

where db2_f11 is a virtual path that is mapped to C:\Program
Files\IBM\SQLLIB\BIN\netf11

When I point IE to my .aspx file I get an error, "no build provider
registered for the extension '.dll' " Which makes no sense to me.
Why do I have to build a DLL? Isnt it already built?

The question is: how do I reference this assembly in my .aspx web
page?

thanks,

-Steve

Parser Error Message: There is no build provider registered for the
extension '.dll'. You can register one in the
<compilation><buildProviders> section in machine.config or web.config.
Make sure the appliesTo attribute includes the value 'Web' or 'All'.

Source Error:

Line 1: <!-- DemoPage.aspx : demonstration web page -->
Line 2: <%@ Page Language="C#" %>
Line 3: <%@ Assembly src="/db2_f11/ibm.data.db2.dll" %>
Line 4: <%@ Import Namespace="IBM.Data.DB2" %>
Line 5: <%@ Import Namespace="System.Data" %>


Nov 19 '05 #2

Brock Allen wrote:
You should either add a reference by copying the dependent DLLs into your ~/bin directory, or if the DLLs you need are in the GAC then you can use the @assembly by specifying the assembly's fully qualified name:

<%@ Assembly Name="SomeAssemblyNameWithOutTheDLLExtension, Culture=neutral, Version=1.2.0.0, PublicKeyToken=38218fe715288aac" %>

The Version and PublicKeyToken you should gte from looking in the GAC (which is c:\windows\assembly).


there is an entry for IBM.Data.DB2 in the GAC.

I add this stmt to my .aspx file:
<%@ Assembly Name="IBM.Data.DB2" %>

( version= and PublicKeyToken= are not allowed )

I get a "not found" error message. I dont want to copy the assembly dll
from where it was installed, that does not seem to be a good idea in
this case.

thanks,
-Steve

Parser Error Message: File or assembly name 'IBM.Data.DB2', or one of
its dependencies, was not found.

Source Error:

Line 2: <%@ Page Language="C#" %>
Line 3: <!-- xxx Assembly src="/db2_f11/ibm.data.db2.dll" %> -->
Line 4: <%@ Assembly Name="IBM.Data.DB2" %>
Line 5: <%@ Import Namespace="IBM.Data.DB2" %>
Line 6: <%@ Import Namespace="System.Data" %>

Nov 19 '05 #3
> I add this stmt to my .aspx file:
<%@ Assembly Name="IBM.Data.DB2" %>
( version= and PublicKeyToken= are not allowed )
Why are version and public key token not allowed? How else are you going
to tell ASP.NET which version you want? Those are required, in fact.
I dont want to copy the assembly
dll from where it was installed, that does not seem to be a good idea
in this case.


Probabaly not.

-Brock
DevelopMentor
http://staff.develop.com/ballen


Nov 19 '05 #4
Also I should have mentioned that you can do this in web.config. The benefit
is that you don't have to touch every ASPX page with the @Assembly directive.
Here are the docs:

http://msdn.microsoft.com/library/de...assemblies.asp

-Brock
DevelopMentor
http://staff.develop.com/ballen
I add this stmt to my .aspx file:
<%@ Assembly Name="IBM.Data.DB2" %>
( version= and PublicKeyToken= are not allowed )

Why are version and public key token not allowed? How else are you
going to tell ASP.NET which version you want? Those are required, in
fact.
I dont want to copy the assembly
dll from where it was installed, that does not seem to be a good idea
in this case.

Probabaly not.

-Brock
DevelopMentor
http://staff.develop.com/ballen


Nov 19 '05 #5

Brock Allen wrote:
I add this stmt to my .aspx file:
<%@ Assembly Name="IBM.Data.DB2" %>
( version= and PublicKeyToken= are not allowed )
Why are version and public key token not allowed? How else are you

going to tell ASP.NET which version you want? Those are required, in fact.
I dont doubt you Brock, I am just a totally confused newbie!

http://msdn.microsoft.com/library/en...asp?frame=true
I dont want to copy the assembly
dll from where it was installed, that does not seem to be a good idea in this case.


Probabaly not.

-Brock
DevelopMentor
http://staff.develop.com/ballen


Nov 19 '05 #6
> I dont doubt you Brock, I am just a totally confused newbie!

http://msdn.microsoft.com/library/en...conassembly.as
p?frame=true


Yeah, the docs are misleading. I posted a few minutes ago with the web.config
approach -- I'd suggest doing it that way.

-Brock
DevelopMentor
http://staff.develop.com/ballen

Nov 19 '05 #7

Brock Allen wrote:
I add this stmt to my .aspx file:
<%@ Assembly Name="IBM.Data.DB2" %>
( version= and PublicKeyToken= are not allowed )
Why are version and public key token not allowed? How else are you

going to tell ASP.NET which version you want? Those are required, in fact.
your right Brock. This stmt worked for me:

<%@ Assembly Name="IBM.Data.DB2, Culture=neutral,
Version=8.1.2.1, PublicKeyToken=7c307b91aa13d208" %>

( why the Visual Web Developer did not like it when I first entered it
but now has no problem with it, who knows! )

thanks for your help,

-Steve
I dont want to copy the assembly
dll from where it was installed, that does not seem to be a good idea in this case.


Probabaly not.

-Brock
DevelopMentor
http://staff.develop.com/ballen


Nov 19 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Jim Heavey | last post by:
Is the Page directive only go on ".aspx" pages? I think the answer is yes, but I am not positive. I am trying to figure out why a called class can not be found and I was wondering if I should...
1
by: Jim Heavey | last post by:
I am trying to figure out the @Assembly directive. I have an application which uses "codebehind" and only uses source code, so I am using the "src=" option of the @Page directive. So I have...
4
by: Bruce W. Roeser | last post by:
All, I'm reading a book by Charles Petzold (Programming VS.Net). Pretty good content but am confused about the difference. From the text: ...
5
by: Sharon Tal | last post by:
Compiler Error Message: CS0234: The type or namespace name 'Http' does not exist in the class or namespace 'System.Runtime.Remoting.Channels' (are you missing an assembly reference?) Source...
2
by: G Dean Blake | last post by:
I wrote and deployed a control with the assembly name of GP to the GAC of another dev box via drag and drop. a web page using this control has: <%@ Register TagPrefix="cc1" Namespace="GP"...
4
by: DELESTRE Christophe | last post by:
I’m sorry to disturb you but I have a problem on .NET development, and I’m need some help to resolve it if it’s possible. I have an aspx page with src property (no dll for my web...
7
by: Steve Richter | last post by:
When I build a C# class and install it in the GAC, my code works as it should, my .aspx code finds the DLL and can run a static method: <%@ Assembly Name="AutoCoder, Culture=neutral,...
3
by: Jim | last post by:
Hi, I have an assembly and it's satellite in my GAC. I have referenced the DLLs in my project (from the same location where I added it to the GAC). CopyLocal is set false. When I run the...
2
by: Andy Fish | last post by:
Hi, I have a single-file aspx file (no codebehind). when I try to do this: <%@ Import Namespace="MySql.Data.MySqlClient" %> I get this: CS0246: The type or namespace name 'MySql' could...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.