Asked by:
ASP.net web site unable to reference dll

Question
-
User-468333257 posted
I could add reference to one of my custom made dlls in ConsoleApp, and Web application(Add reference)
But when I added reference to WebSite, and tried to import namespace, it complains the following:
The type of namespace xxxx could not be found. (are you missing a directive or assembly reference)?
Wednesday, February 14, 2018 7:28 AM
All replies
-
User409696431 posted
In a website, put the dll in the Bin folder. Add a using statement in the code behind.
Thursday, February 15, 2018 2:53 AM -
User-468333257 posted
It didnt work
using xxx doesnt detect the namespace
This only has problems in website
Web application and console app are fineThursday, February 15, 2018 4:18 AM -
User409696431 posted
Is the Bin folder right under the root of the site? And I have no idea what "xxx" means. I assure you that it works - I have several asp.net websites that are not applications. You have not posted any code so there is not much more anyone can tell you.
Thursday, February 15, 2018 4:42 AM -
User-468333257 posted
The dll is a custom dll i built from a console app built into class lib, not any kind of open source dll you get from downloading online.
xxx is the namespace but somehow after i click project->add reference ->select these dll and add
It still cant detect
I didnt have this problems for web app and console app, only for web sitesThursday, February 15, 2018 3:59 PM -
User409696431 posted
You don't need to "add reference" for a website for code you are putting in the Bin yourself. Again, since I have no visibility to what you are doing, I can't tell what is wrong.
Thursday, February 15, 2018 7:13 PM -
User-468333257 posted
Yes, the dlls are already in the bin folder, yet still same issue<br>
<br>
<br>
Is there some kind of vs logs in vs2015 that i can refer to , to see what is wrong with vs not detecting my dll?
Whats the use of providing code when it cant detect my dll
using namespace; already gives errorTuesday, February 20, 2018 9:07 AM -
User1400794712 posted
Hi z080236,
How about installing it into the global assembly cache?
(Note:Each computer where the common language runtime is installed has this machine-wide code cache. The global assembly cache stores assemblies specifically designated to be shared by several applications on the computer.)
Add the file to GCA
gacutil.exe /i MyFile.dll
Then you can get the version and
gacutil /l MyFile
For more details, please refer to the following articles:
https://stackoverflow.com/a/23480805
Best Regards,
Daisy
Saturday, February 24, 2018 7:23 AM