Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding Namespace to web.config

Status
Not open for further replies.

Turkbear

Technical User
Mar 22, 2002
8,631
US
Hi,
I have created a namespace containing several classes..( Compliled into a library .DLL)
( IIS 6, Win Server 2003, .Net 2)
This works fine when placed in the bin subdirectory of the application root that will use it (with a <%@ Import namespace="HrGeneral" %> tag)...

I would like to add it to the namespaces listed in the site's web.config file so that all applications on that site can use it..I added it and placed the .DLL in the '\WINDOWS\Microsoft.NET\Framework\v2.0.50727' directory ( where the other ones seem to reside), but I obviously missed something, since it does not work- error indicates that the class is not being found)...

Did a miss a step ( like registering the .DLL, maybe) or have I missed a bigger concept here?

Thanks for helping a new .NET person...



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
The dll still needs to go into the bin folder in the root of the site. Then you can add the namespace to the namespaces group of the pages section in the web.config file
Code:
<pages 
			<namespaces>
				<clear/>
				<add namespace="Your.Namespace.Here"/>
				<add namespace="System"/>
				<add namespace="System.Collections"/>
				<add namespace="System.Collections.Generic"/>
				<add namespace="System.Collections.Specialized"/>
				<add namespace="System.Configuration"/>
				<add namespace="System.Text"/>
				<add namespace="System.Text.RegularExpressions"/>
				<add namespace="System.Web"/>
				<add namespace="System.Web.Caching"/>
				<add namespace="System.Web.SessionState"/>
				<add namespace="System.Web.Security"/>
				<add namespace="System.Web.Profile"/>
				<add namespace="System.Web.UI"/>
				<add namespace="System.Web.UI.WebControls"/>
				<add namespace="System.Web.UI.WebControls.WebParts"/>
				<add namespace="System.Web.UI.HtmlControls"/>
			</namespaces>
		</pages>

[blue]_______________________________________[/blue]
Business Logic:"AND when tweetle beetles battle with paddles in a puddle, they call it a tweetle beetle puddle paddle battle AND..." - Dr. Suess
 
Hi,
Thanks..
Would that eliminate the need for the IMPORTS tag?

[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Hi,
Answered my own question..Yes it does..

Thanks again..



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top