Solved

Reference not known after compiling

Posted on 2015-02-24
5
94 Views
Last Modified: 2015-02-25
Hello
I have a small testproject on VS2010 using c# (.NET 4.0, OS is WinServer2008R2)
I added a reference to a DLL and I can use the functions from this DLL --> VS2010 knows the functions. :-)

But as soon, as I want to compile my application, the VS2010 does not know the functions any more and I get an compile error (CS0246) :-(

After closing and opening the project, the functions are known again untill the next compiling.

What could be the reason?

Eric
0
Comment
Question by:ICSAutomation
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 34

Expert Comment

by:it_saige
ID: 40628503
What properties do you have set for this DLL?Capture.JPG-saige-
0
 

Author Comment

by:ICSAutomation
ID: 40628888
Here are the properties. Sorry, the VS is in german...
M--prop.jpg
0
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 500 total points
ID: 40628955
This looks like a COM dll, not a .NET dll

Set Interop-Typen einbetten to True and Lokale Kopie to False. This will include the needed portions of the dll in your application, so you do not need the dll itself. This is often the best way to work with COM dlls.

Something else that you might need to check also. Is the dll mentioned in your error message the same as the one you referenced? If not, then it means that the dll that you referenced calls another dll, and this is the one that is missing. This can happen with COM dlls when their dependency is not registered properly.
0
 

Author Closing Comment

by:ICSAutomation
ID: 40630020
The settings of the DLL are correct ("Interop-Typen einbetten" to FALSE and "Lokale Kopie" to TRUE).

The solution was to set the Framework to ".NET Framework 4", is was ".NET Framework 4 Client Profile".

Thanks for the hint to read ALL details of the the error message!! :-)
0
 
LVL 40
ID: 40630121
My comment still holds anyway. Embedding the interop makes it easier because you do not have to distribute and register the dll with your application. Everything is included in your executable.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question