.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

How can I get the namespace(s) from DLL?

Posted By:      Posted Date: October 07, 2010    Points: 0   Category :Windows Application

I'm looking for the code (hopefully in VB.Net) to extract namespaces from a particular DLL.

to get the other info I need, I'm using:
Dim assem As Assembly =

View Complete Post

More Related Resource Links

Type or namespace error.


A couple of days ago I started getting an unusual behavior when compiling Website projects. I have referenced class libraries added to my bin folder that are also correctely referenced in using statements in my aspx.cs code behind. When I compile, I get the 

Error 4 The type or namespace name 'CommonClassLibrary' could not be found (are you missing a using directive or an assembly reference?) C:\Dev\Fiscal_Portal\Implementation\FMS Portal Site_new\App_Code\BLL\DataTables.cs 1 7 C:\...\FMS Portal Site_new\

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

error message that would typically be received when the dll has not been added as a reference or added in a using statement.

I can eliminate the error by adding an


Basic Instincts: My Namespace Extensions with My Extensibility


In this month's column, learn how to integrate your own My Namespace extension into the Visual Basic development environment using the My Extensibility feature.

Matthew DeVore

MSDN Magazine April 2008

Visual Basic: Navigate The .NET Framework And Your Projects With The My Namespace


The My Namespace is best described as a speed-dial for the .NET Framework. It provides an intuitive navigation hierarchy that exposes existing .NET functionality through easily understood root objects. Here Duncan Mackenzie explains it all.

Duncan Mackenzie

MSDN Magazine Visual Studio 2005 Guided Tour 2006

Visual Basic: Simplify Common Tasks by Customizing the My Namespace


Underlying the My namespace's APIs is a fully extensible architecture you can leverage to customize the behavior of My and to add new services to its hierarchy to adapt to specific application needs. the My namespace is optimized to provide simple solutions to common problems. But if your requirements are different, you can use the My namespace's customization model to modify the behavior of individual My namespace members to meet specific application requirements.

Joe Binder

MSDN Magazine July 2005

Windows Shell: Create Namespace Extensions for Windows Explorer with the .NET Framework


Extending the Windows shell with namespace extensions allows you to create some custom functionality for Windows Explorer. One common use is to enable Explorer to present a list of items that do not exist in one real folder, but actually reside in a number of places. The view on the folder makes it look like these items are in one place, so managing them becomes easier. This article illustrates the process of creating custom shell namespace extensions using C# and the .NET Framework. The author dispels some myths about the difficulty of writing such extensions, and shows that it is easier than it was before .NET. Along the way he outlines undocumented interfaces and describes advanced techniques for consuming them in .NET.

Dave Rensin

MSDN Magazine January 2004

Windows Forms: .NET Framework 1.1 Provides Expanded Namespace, Security, and Language Support for Yo


With the much-anticipated release of the .NET Framework 1.1, developers are eager to know what's been added to their programming bag of tricks. In this article, the author focuses on new developments in Windows Forms, such as namespace additions, support for hosting managed controls in unmanaged clients, and designer support for C++ and J#. Integrated access to the Compact Framework and new mobile code security settings also make this release noteworthy. Along with these features, the author reviews the best ways to handle multiple versions of the common language runtime and highlights some potential pitfalls.

Chris Sells

MSDN Magazine March 2003

Class Templates: Bring the Power of Templates to Your .NET Applications with the CodeDOM Namespace


In the .NET Framework, the CodeDOM object model can represent code in a variety of languages. This article examines how source code templates written with the Framework's System.CodeDom and System.CodeDom.Compiler namespaces allow developers to create reusable boilerplate source code that can be shared between projects. Components designed via templates improve productivity and shorten development time.Here C++-style classes and templates are simulated and code is generated in multiple languages through the creation of CodeDOM object graphs. Compiling object graphs and formatting output code are also explained.

Adam J. Steinert

MSDN Magazine February 2003

Printing: Preview and Print from Your Windows Forms App with the .NET Printing Namespace


Printing is an integral part of every complete Windows-based application. Providing robust printing capabilities in these applications has often proved to be a tedious chore. Now, printing from Windows Forms with the .NET Framework means you must adopt a document-centric approach, resulting in cleaner and more manageable code. While the System.Windows.Forms namespace provides seamless integration with all the standard print dialogs (such as Print Preview, Page Setup, and Print), the System.Drawing.Printing namespace offers numerous classes for extensibility and customization. These classes, and how they provide access to printing capabilities, are covered here. Other useful techniques, such as printing in the background to allow the user to continue other tasks, is also explained.

Alex Calvo

MSDN Magazine February 2003

Razor View Engine and Add Namespace in Web.Config Problem



I am working on a MVC project with Razor view engine and I have the following:


This only works if I have on the same view the following:

  @using SquishIt.Framework;

However, on my Web.Config I have the following:


      <!-- Namespaces -->
        <add namespace="System"/>
        <add namespace="System.Web.Mvc"/>
        <add namespace="System.Web.Mvc.Ajax"/>
        <add namespace="System.Web.Mvc.Html"/>
        <add namespace="System.Web.Routing"/>
        <add namespace="Microsoft.Web.Mvc"/>
        <add namespace="SquishIt.Framework"/>


So if "SquishIt.Framework" namespace is added on Web.Config why do I need to have the @using on the view?

dbml namespace


Dear all,


I have the program as below file folder. Before dbml namespace is OK. But later when I added tables and some stored procedures to the dbml file. The using "SAP.DataContect" cannot be compiled in user.cs due to error: "The type or namespace name 'DataContext' does not exist in the namespace 'SAP.SAP' (are you missing an assembly reference?) "


\Entities\User.cs  // In which I have using SAP.DataContext which should refer to the dbml. 

Fix: The type or namespace name 'EntityDataSource' does not exist

Today's stupid mistake had me going in circles in my Web application project. The error message was: The type or namespace name 'EntityDataSource' does not exist. As the rest of the error message suggests, I must be missing an assembly reference. Nope, I'd already added in the references to Entity : System.Data.Entity System.Data.Entity.Design After much frustration until after 1 a.m., I gave up and went to bed. This morning I realized that what it wanted was the WEB Entity! System. Web .Entity System...(read more)

Web Part Namespace & Deployment Question



I have a web part deployment and development question. Probably newbie questions..

For web parts which will only be used in certain web applications, I can definitely see creating custom CAS policies etc.. and deploying the dll only to the Bin of the Web Application, but what is the best practice for deploying a Farm wide web part that everyone will use?

I assume it goes in the GAC, and additionally, are there any best practices as far as the namespaces for web parts when they are going into the GAC?

For example, if I go into the Assembly folder and look at all the assemblies in the GAC, is it "okay" to have various globally deployed web part assemblies in there? Like, "MyCustomWebPart" sitting in there with the other sharepoint assemblies? Seems messy to me, but if these are "one-off" web parts that won't have a bunch of classes within a single namespace, it seems like what needs to be done.

Hopefully that was clear enough!

How do I find the file path from a namespace.class name?


I'm programatically looking ito a .aspx file and getting the file class name declared in its CodeBehind. For example, when analyzing myFile.aspx I read in its Page Directive and found its CodeBehind equals "myApplication\myPage.aspx.vb". Then I use the code below:


Dim Assm As System.Reflection.Assembly = System.Reflection.Assembly.LoadFrom("myApplication\bin\myApplication.dll")
Dim ClassType As Type = Assm.GetType("myApplication\myPage.aspx.vb")
' myBaseType = "myApplication.Forms.BasePage"
Dim myBaseType As System.Type = ClassType.BaseType


Now I want to read the BaseFile (class = myApplication.Forms.BasePage). However, to read in this file, I need I need to get its full path instead of its namespace.class hiearchy. In this case, the BasePage is wrapped in a different namespace declaration thus I cannot just change the '.' to '\' in order to get the path.

How can I get the path of BasePage so I can read it? Thank you - Frank

Namespace Question


I have googled this question, but it is pretty specific and hard to find an anwser. I currently follow the MyCompanyName.Namespace pattern for namespaces. The question is this, how does one determine visually that one namespace is a library and the other is an application. For example:

Library of Web Controls: MyCompanyName.Web.UI.WebControls

ASP.Net Application: MyCompanyName.ApplicationName.UI

How does everyone else do this?

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend