Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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
Reply With Quote
  #2 (permalink)  
Old March 6th, 2011, 08:53 AM
Imar's Avatar
Wrox Author
Points: 72,022, Level: 100
Points: 72,022, Level: 100 Points: 72,022, Level: 100 Points: 72,022, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,076
Thanks: 80
Thanked 1,587 Times in 1,563 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!
Reply With Quote
  #3 (permalink)  
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?
Reply With Quote
  #4 (permalink)  
Old March 6th, 2011, 10:29 AM
Imar's Avatar
Wrox Author
Points: 72,022, Level: 100
Points: 72,022, Level: 100 Points: 72,022, Level: 100 Points: 72,022, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,076
Thanks: 80
Thanked 1,587 Times in 1,563 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!
Reply With Quote
The Following User Says Thank You to Imar For This Useful Post:
johnzonie (March 7th, 2011)
  #5 (permalink)  
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.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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? MMahaney@wcinfo.com 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



All times are GMT -4. The time now is 10:12 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.