473,752 Members | 5,017 Online
Bytes | Software Development & Data Engineering Community
+ 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\i bm.data.db2.dll " %>

where db2_f11 is a virtual path that is mapped to C:\Program
Files\IBM\SQLLI B\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><b uildProviders> 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.dl l" %>
Line 4: <%@ Import Namespace="IBM. Data.DB2" %>
Line 5: <%@ Import Namespace="Syst em.Data" %>

Nov 19 '05 #1
7 3126
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="SomeAssem blyNameWithOutT heDLLExtension, Culture=neutral ,
Version=1.2.0.0 , PublicKeyToken= 38218fe715288aa c" %>

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

-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\i bm.data.db2.dll " %>

where db2_f11 is a virtual path that is mapped to C:\Program
Files\IBM\SQLLI B\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><b uildProviders> 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.dl l" %>
Line 4: <%@ Import Namespace="IBM. Data.DB2" %>
Line 5: <%@ Import Namespace="Syst em.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="SomeAssem blyNameWithOutT heDLLExtension, Culture=neutral , Version=1.2.0.0 , PublicKeyToken= 38218fe715288aa c" %>

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


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.dl l" %> -->
Line 4: <%@ Assembly Name="IBM.Data. DB2" %>
Line 5: <%@ Import Namespace="IBM. Data.DB2" %>
Line 6: <%@ Import Namespace="Syst em.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= 7c307b91aa13d20 8" %>

( 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
1440
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 place a page directive on the class which I am trying to call. In my situation I have "MyPage.aspx" which has code behind page called "MyPage.aspx.vb" and "MyPage.aspx.vb" instatiates "Myclass.vb" and the "MyClass.vb" can not be found. All my...
1
1640
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 something that looks like the following: ASPX Files ASPX.VB Files Page1.aspx Page1.aspx.vb
4
6110
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: ---------------------------------------------------------------------------------------------------------------------------------------------------------- The @ Import Directive Next to @ Page, the directive that ASP.NET programmers use the most is @ Import. The @ Import directive is ASP.NET's...
5
2041
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 Error: Line 2: <%@ Import Namespace="System.Runtime.Remoting" %> Line 3: <%@ Import Namespace="System.Runtime.Remoting.Channels" %> Line 4: <%@ Import Namespace="System.Runtime.Remoting.Channels.Http" %>
2
1378
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" Assembly="GP" %> The docs and books I have say that this should be enough for the page to find the assembly in the GAC at run time but it does not find it. I am having to put a copy of my GP.dll in the ASP.NET application Bin directory for it to work....
4
1600
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 application, all pages are JIT compiled on request), and I want link a assembly with the “src” attribute, like <%@ Assembly Src=”/MyWebApplication/Common/MyAssemblyClass.cs” %>
7
1722
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, Version=1.0.1922.22245, PublicKeyToken=0a4067d718757385" %> <%@ Import Namespace="AutoCoder" %> Trace.Write( "AutoCoder", AutoCoder.Common.GetConnectionString( )) ; But I cant locate the assembly in its directory using the src= property.
3
5251
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 project I get our old friend: Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error
2
4063
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 not be found (are you missing a using directive or an assembly reference?)
0
8861
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9423
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9371
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9279
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6830
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 presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4726
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4910
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3340
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 we have to send another system
3
2237
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.