473,763 Members | 1,883 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Importing an assembly?

Hi All

I am trying to get access to an assembly in an ASPX project. I have added
the assembly to GAC using gacutil and added an "%@Import namespace =
"MyNamespac e" %" to the .aspx file but this is seemingly not enough since
the using directive in the .aspx.cs file gives the error:

"The type or namespace name "MyNamespac e" could not be found (are you
missing a using directive or an assembly reference?)"

Erm, it's the using directive is there. It just fails to compile - and what
on earth is an assembly reference?

More generally, where (and how) can I find the information on how to do
this?

BTW, is your opinion on the Visual Studio help system as low as mine? I find
it virtually impossible to find any information on how to do tasks. Google
is usually much better although in this case it has failed me as well.

Ebbe
Nov 14 '06 #1
2 1679
Hi,

Ebbe Kristensen wrote:
Hi All

I am trying to get access to an assembly in an ASPX project. I have added
the assembly to GAC using gacutil and added an "%@Import namespace =
"MyNamespac e" %" to the .aspx file but this is seemingly not enough since
the using directive in the .aspx.cs file gives the error:

"The type or namespace name "MyNamespac e" could not be found (are you
missing a using directive or an assembly reference?)"

Erm, it's the using directive is there. It just fails to compile - and what
on earth is an assembly reference?

More generally, where (and how) can I find the information on how to do
this?
Placing an assembly in the GAC is not enough to make it available in
your project. You must add an assembly reference in the Solution
explorer: Right click on the "References " folder, choose "Add
reference", and then select your assembly. Since you added it to the
GAC, it should be available from the .NET tab. Other possibilities are
COM components, Projects in the same solution, Browse for a DLL, or
Recently used libraries.

Adding an assembly reference gives you access to the namespaces. If you
have code behind, you want to add a "using" directive (C#) or Import
(VB.NET) to avoid having to retype the full type name everytime you want
to use the class.
BTW, is your opinion on the Visual Studio help system as low as mine? I find
it virtually impossible to find any information on how to do tasks. Google
is usually much better although in this case it has failed me as well.
I find the Help system OK, but it's not enough to learn programming I
think. It won't tell you what an assembly reference is, probably. But I
don't think it's its role either. For tutorials, I like the web and
books better. For references (class libraries), I find MSDN good enough.

Ebbe
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch
Nov 14 '06 #2
Laurent Bugnion wrote:
Placing an assembly in the GAC is not enough to make it available in
your project. You must add an assembly reference in the Solution
explorer: Right click on the "References " folder, choose "Add
reference", and then select your assembly. Since you added it to the
GAC, it should be available from the .NET tab. Other possibilities are
COM components, Projects in the same solution, Browse for a DLL, or
Recently used libraries.
Thanks. That did it.

Ebbe
Nov 14 '06 #3

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

Similar topics

3
2384
by: xleyba | last post by:
Hi I'm new to .Net world. I need to develope an application for Diva BR ISDN card (CAPI programming) and I want to make it with C#. Diva API documentation comes with VBasic Net examples but I imagine I could tranlate it to C# in an easy way.
0
956
by: Ivan Lam | last post by:
Hi All, Thanks for reading my question. I am a newbie of VC .Net, and I am facing a problem about importing DLL. I have searched from the web and I download a simple sample. And the code is as follow:
5
1575
by: Alex | last post by:
Hi, I have an aspx file that creates a custom class object and calls a method which should return a DataSet. It throws a: Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.
29
4227
by: Natan | last post by:
When you create and aspx page, this is generated by default: using System; using System.Collections; using System.Collections.Specialized; using System.Configuration; using System.Text; using System.Text.RegularExpressions; using System.Web; using System.Web.Caching;
4
1291
by: al | last post by:
Hi, I tried to import Drawing namespace and then declare one of its classes, but this seems does not work with me. Imports System.Drawing Dim gr as Graphics = MyForm.CreateGraphics 'This give error; Type expected
0
777
by: Scott Meddows | last post by:
Has anyone had any luck importing Microsoft's IE control into an Assembly so I can sign the darn thing?!?!? Command line for TblImp or link to the assembly I can download would be appreciated. Thanks.
0
489
by: Alun Jones | last post by:
I'm getting the above error in a dialog box from Visual Studio 2005 when trying to sign an assembly using a PFX file, and would like to know how to resolve the problem. Background: The PFX file has been used for code-signing before (to sign an InfoPath form), so therefore the file contains a valid code-signing key. I have the correct password to the PFX file (because I get a different error
0
182
by: norseman | last post by:
mercado mercado wrote: =================================== I started to import a module using its path and now see what you mean. Python is missing the concept: Programmer dictates what machine does. (I come from assembly. If the hardware can do it, so can I.) sys.path can be modified to switch between file sets (prod/test). if a global is set one way, use the normal paths,
1
1556
by: poldoga | last post by:
Good day sirs, I am currently working on creating windows GUI software for a hardware device. The hardware's functions are stored in a DLL. Here is the structure for a function I need to import CustomType CustomFunction (CustomType1, CustomType2) I use DLLImport to import functions. It seems to work as long as the functions all use default types like int, char and others. My question is how will I go around importing functions which...
0
9389
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
10149
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10003
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
9943
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,...
1
7370
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
6643
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5271
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
5410
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2797
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.