Solved

Reference not known after compiling

Posted on 2015-02-24
5
89 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
  • 2
  • 2
5 Comments
 
LVL 32

Expert Comment

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

Author Comment

by:ICSAutomation
Comment Utility
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
Comment Utility
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
Comment Utility
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

Expert Comment

by:Jacques Bourgeois (James Burger)
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

728 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now