I have added a reference to an external of my project and solution .dll
file, I can see it under the References
node in the Solution Explorer window, but it can't find it when I try to use it in the statement using dllfilename
, so I basically can't use the library.
When I go to the Object Browser - I find the Namespace of the project and it's classes/methods but I can't see the referenced library or at least its namespace or whatever...
Asked
Active
Viewed 1.6k times
5

Syspect
- 921
- 7
- 22
- 50
-
1please post the solution tree[image] in Visual Studio – Parimal Raj Apr 23 '13 at 12:48
-
3Shouldn't you use the namespace rather than the filename? – bash.d Apr 23 '13 at 12:48
-
What kind of dll is it? Is it a CLI assembly at all? Also, you need to specify the namespace instead of the dll name. – Botz3000 Apr 23 '13 at 12:48
-
1restart computer , using is namespace name not dll name. – Nahum Apr 23 '13 at 12:49
-
Please post screenshot of `dll`'s available namespaces opened in *Object Browser*. – Andrii Kalytiiuk Apr 23 '13 at 12:50
-
1I like Nahum Litvin's advice. Restarting your computer is the solution to everything when using Windows. – Lee White Apr 23 '13 at 12:51
-
@ArnoSluismans, as if the same couldn't be applied to ANY operating system ^^ – walther Apr 23 '13 at 12:57
-
There was no problem at all with the referencing or whatever. I just restarted the Visual Studio and I was already able to see the namespace of the `.dll` file. Thanks anyway. – Syspect Apr 23 '13 at 13:00
3 Answers
5
You don't need to use using dllfilename
. The correct usage is using NamespaceThatIsAccessibleFromDll;
. Once you do that, you can use the public classes that appear in this namespace.

Lee White
- 3,649
- 8
- 37
- 62
-
okey, I opened the `.dll` file's code and the namespace is `dk.ms_it` but it's the same problem - it can't find the namespace, so I can't include it in the `using` statement – Syspect Apr 23 '13 at 12:53
-
1
-
There was no problem at all with the referencing or whatever. I just restarted the Visual Studio and I was already able to see the namespace of the `.dll` file. Thanks anyway. – Syspect Apr 23 '13 at 13:00
5
There is a bug in VS2010. The solution is easy: Project -> Properties -> Application tab -> change Target Framework to ".NET Framework 4" instead of the Client Profile that is selected by default.

Milkncookiez
- 6,817
- 10
- 57
- 96
-
1Actually this isn't a bug. The *Client Profile* is a subset of the .NET Framework 4 assemblies. If the referenced assembly is linked against the whole .NET Framework 4, it cannot be referenced from a project, linked against the *Client Profile*, since it could be that it uses some assemblies the *Client Profile* doesn't contain. – Carsten Apr 23 '13 at 13:30
1
Try project, properties; in the application tab under target framework if you have .NET Framework 4 (Client Profile) (or 4.5 Client Profile) then change it to the appropriate version without the client profile. This has caught me out a few times - and I'm not alone -