Solved

Reference not known after compiling

Posted on 2015-02-24
5
92 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 33

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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Hey Audio! 3 30
2 questions 10 25
How do I subtract date and time within a same column in SQL 4 39
Database Connections Not being returned to Connection Pool 7 27
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

825 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