Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Reference not known after compiling

Posted on 2015-02-24
5
Medium Priority
?
97 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 2000 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

In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

618 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