Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 5th, 2011, 09:29 AM
Registered User
 
Join Date: May 2010
Posts: 8
Thanks: 3
Thanked 0 Times in 0 Posts
Default DLL Reference

Working my way through your book but can't seem to find how to properly install and reference a dll. Assume I have this structure:

/folder1/folder2/page.aspx
and I want to reference myDll.dll. I believe I have to put the dll in a bin directory. Do I put the bin directory at the root or at
/folder1/folder2/bin?

Also, I have referenced the dll in Solutions Explorer/Properties Pages/References. Is there anywhere else I should "reference or register" the dll?

While my app works fine in the development environment, I keep getting this error when used remotely:BC30002: Type 'MyDll.ProjectFile' is not defined.

Thanks.

John
 
Old March 6th, 2011, 08:53 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,
Quote:
Do I put the bin directory at the root or at
/folder1/folder2/bin?
It depends. If folder1/folder2 are just "flders", then you should place them in the root flder's Bin folder. If one of them is marked as an Application in IIS, you should put it in the Bin for the folder that's marked as an app.

Quote:
I keep getting this error when used remotely:BC30002: Type 'MyDll.ProjectFile' is not defined.
That seems to indicate that your remote server has a different configuration that yours. Maybe one of your subfolders is an application in IIS?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old March 6th, 2011, 09:27 AM
Registered User
 
Join Date: May 2010
Posts: 8
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Hi Imar,

Thanks for the reply. The aspx page called has VB code behind that is executed by the OnPageLoad event. I have tried putting the dll in a bin folder both off the root and off "folder2" without success.

The hosting provider tells me theirs is a "medium trust" environment. Not sure what this means or if there should be any specific web.config entries to accommodate this security level. Could that be the issue and do you have any ideas on how to resolve it?
 
Old March 6th, 2011, 10:29 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Maybe this helps? http://social.msdn.microsoft.com/For...8-faadd92ecbb3

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
johnzonie (March 7th, 2011)
 
Old March 7th, 2011, 12:52 PM
Registered User
 
Join Date: May 2010
Posts: 8
Thanks: 3
Thanked 0 Times in 0 Posts
Default

It turns out the dll was apparently not built for a medium trust environment. According to hosting support, their advice on how to build for a medium trust environment consists of:

adding the line [assembly: AllowPartiallyTrustedCallers] to the AssemblyInfo.cs and recompile the dll.

I have passed this on to the software provider in hopes of getting a compliant dll.

Thanks for the pointers.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic Reference to VB6 DLL webnet .NET Framework 2.0 3 October 4th, 2007 11:41 AM
Reference to a DLL costaaa C# 0 August 5th, 2006 03:07 PM
How to reference a .dll file? ohChuck C# 4 April 20th, 2006 10:32 AM
Reference lib or .dll in application? [email protected] C# 1 February 11th, 2005 02:25 PM
DLL & Excel - keep having to reset DLL reference! James Diamond Pro VB 6 2 May 25th, 2004 03:37 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.