?
Solved

Reference not known after compiling

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

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
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.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
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 …

752 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