Reputation: 1
I am very new to programming in C#. I do have some experience in objective C. I want to import an dll file that is in my references in Microsoft visual C#. is therea function like #import to import the dll file in my console application?
Upvotes: 0
Views: 7056
Reputation: 416149
In C#, you reference assemblies (dlls) and import namespaces.
An assembly reference lives in the project/solution file for your program, and sometimes later on the in the .config file for the program. You won't see it anywhere in your source code. If you already have a reference for the assembly, there is likely a namespace (or possibly multiple namespaces) in the assembly that you must then include in your source code with an import
directive. You can see examples at the top of most any C# source file.
The distinction is that sometimes a namespace may be implemented across several different assemblies/dlls.
Upvotes: 2
Reputation: 101
What do you mean by import? linked at run time?
if not you can simply add a reference to your DLL in your C# project.
http://msdn.microsoft.com/en-us/library/wkze6zky(v=vs.80).aspx
Upvotes: 1