• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 328
  • Last Modified:

Compilation Error: My (type/namespace/dll) can't be found?

On my local machine, I use and reference a .dll in my web application [ASP .NET 4.0, VS 2010 C#] and my application loads just fine. However when I load my application onto / into a shared folder on a server that I've been given access to, when I try to run the application, I get a compilation error telling me:

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

What would be some possible causes of this that I can look into?
CompErroForExpExc.jpg
0
Michael Sterling
Asked:
Michael Sterling
  • 3
  • 2
1 Solution
 
Fernando SotoCommented:
It sounds like it can't find the dll IBM.dll, Is this dll located on the server you just loaded to? Most likely the cause of your issue.
0
 
Michael SterlingWeb Applications DeveloperAuthor Commented:
I think you're correct. This is the work around that we came up with. Please let me know if there's anything else I can try. I wound up having to use the CompilerOptions property of the <@ Page @> directive at the top of each of my .aspx pages. I had to set it to the path where the IBM dll lives on the server. I'm new to this project but was told that on each PC, and the web server(s), the dll file lives in the same place. I did find it on my machine but don't have access to the folder where it would live, on the web server.

To test out what would happen, we had our network person drop the IBM dll file into a folder named "bin" on the intranet web server. when he did, my web site worked but it broke every other web site on the web server returning a message that pretty much said, ~"the project was already referencing that dll assembly somewhere else." All the other web sites on that server have that CompilerOption property, with its value set to the path where the IBM dll lives, in the .aspx page. That bin folder was on the same level, in the file structure, as was/is all the other websites on that intranet server. Again, the IBM dll, on that server already lives in a directory that is the path we are having to "hard code" into a the CompilerOptions property of the <@ Page @> directive.

So what do you think we would need to do, to allow each application to use its own local copy of that IBM .dll file? Remove it from that other location, and place it in either that "bin" folder or remove it from that other location and only place it (locally) in each web site? Thoughts?
0
 
Fernando SotoCommented:
Hi mikesExpertExchange;

This is just my opinion but if you place the dll in the bin folder of the application you would probably run into less issues. If it's absolutely necessary for all the programs to access the same dll then the Global Assembly Cache, GAC, would most likely be a next location to use. Please read this article, "How to load an assembly at runtime that is located in a folder that is not the bin folder of the application."
0
 
Michael SterlingWeb Applications DeveloperAuthor Commented:
Thank you.
0
 
Fernando SotoCommented:
Not a problem mikesExpertExchange, glad I was able to help.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now