C# missing refernces
I have a C# 2010 application that is getting the error message, "missing references" when I try to compile (build) the application. Thus can you tell me how to find the missing references and fix the problem so the application builds with no errors?
VulpesPosted Oct 31, 2012, 7:34 AM
COM dlls are typically unmanaged dlls written in C++ or VB6 which .NET applications can consume via COM interop. COM is short for the Component Object Model. They include stuff such as the Microsoft Office libraries.
These are more complicated than ordinary .NET dlls and there has been a major change in how they are dealt with from Visual Studio 2010 onwards - basically, you can now embed the types you need rather than referencing the whole assembly. I'd therefore worry about these when you get one :)
dcPosted Oct 30, 2012, 8:59 PM
VulpesPosted Oct 30, 2012, 3:02 PM
C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PublicAssemblies
It should then appear under the .NET tab in the Add References dialog.
2. You should add a reference to common.logging.dll to each project that needs it.
3. Already answered in #1 above.
dcPosted Oct 30, 2012, 2:20 PM
1. To point a reference to the download directory for where I obtain the common.logging file initially is fine with me. However, wouldn't I need to save this download somewhere where the solution file can access it at a later point in time? If so, where should I place this file at?
2. For the most 'used' project file in this solution, it needs to reference 3 other project files. One of the project files is a 'proxy' for calling a web service.
For the three project files to compile (build) clean, they also need the common.logging.dll. Thus can you tell me the best way to setup a reference to each of these project files when they are referencing the common.logging.dll?
3. Should I add the common.logging.dll to either tab under the references that point to com or .net? If so, can you tell me the following:
a. Which tab would I save this file to and why would I pick that tab?
b. How should I add this common.logging.dll file to that tab for the references to utilize?
VulpesPosted Oct 30, 2012, 11:57 AM
2. Having donwloaded it, I'd open up the Add Reference dialog as before but use the Browse tab (rather than the .NET or COM tabs) to navigate to the download directory.
dcPosted Oct 30, 2012, 11:48 AM
Thanks so far! I have the additional questions to ask you which are the following:
1. How would I know what download is for visual studio 2008?
2. If I do download one of those files, can you tell me how to add the download to my solution file and have the references section know where the common.logging dll is located at?
VulpesPosted Oct 30, 2012, 11:38 AM
On googling it, I came up with two possibilities:
1. That it's part of Spring.NET - see:
http://stackoverflow.com/questions/7014731/where-to-download-spring-net-binary-files
http://www.springframework.net/download.html
2. That it's part of this Source Forge, Common Logging Framework:
http://systemexplorer.net/file-database/file/common.logging-dll/1281871
http://netcommon.sourceforge.net/
I don't know whether either of these rings any bells but I wouldn't download anything until you're sure what it is that you need.
dcPosted Oct 30, 2012, 11:10 AM
Thus basically my question is about the common.logging.dll so I can add it to my references which are:
1. Where do can I find the common.logging.dll? it is part of the .net framework? If so, how can I attach my code to access this file so the references would be aware of this file?
2. If this file is not part of the .net framework, can you tell me where I would locate the file to download it, incorporate it in my solution file, and make the references be aware where the common.logging is located at?
VulpesPosted Oct 30, 2012, 10:37 AM
In general, you can find the project's output path by right clicking on the project name in Solution Explorer and selecting Properties from the drop-down. The output path is shown under the Build tab and is the directory to which the project will be compiled.
2. There are no tabs under Solution Explorer itself, just in the Add Reference dialog box.
In Solution Explorer, under References, there is just a list of the dlls that have been added (sometimes automatically) to the project. You need to click on the dll's name to show its Properties Box.
dcPosted Oct 29, 2012, 11:21 PM
Here are my questions:
1. Where is the project's output path? I do not know where this is located at. Is that in the bin directory?
2. Your statement, "If you click on the dll under References in Solution Explorer, this will open up the Properties box for the assembly which should show Copy Local as true. " To find the "the dll under References in Solution Explorer", is this under the com or .net tabs? If not, where would I find the dlls?
VulpesPosted Oct 29, 2012, 4:50 PM
Otherwise, I'd copy the dll to the project's output path so that it can be found at runtime. In fact, if it's not installed in the GAC, then this should be the default. If you click on the dll under References in Solution Explorer, this will open up the Properties box for the assembly which should show Copy Local as true. This means that the reference will be automatically copied to the project's output path.
dcPosted Oct 29, 2012, 3:43 PM
In other words I mean like the DLL is not in the same place in my checked out folder as it is in the original one. Are there any other items I need to be aware of? If so, what are these items and how do I resolve the issues that my arise from these new items I need to be made aware of?
VulpesPosted Oct 29, 2012, 2:44 PM
1. Right click on References in Solution Explorer and select Add Reference from the drop-down.
2. In the Add Reference dialog box, select the dll you need - usually under the .NET or COM tabs and click OK.
If you expand it, you should then see the dll listed under the References node in Solution Explorer.
dcPosted Oct 29, 2012, 2:18 PM
Also I want to mention from what I have seen on the internet about this software, the only way to clear up this error message is to manually figure out where the reference problems are and to fix them. After that point, check to code into anksvn and the problem will go away.
I do have the version of the solution file before i checked it into anksvn to know where the original references were located at.
My problem is I do not know how to make the references point to the correct dll file or other ways to fix this problem. Can you tell me and/or show me in code how to resolve this issue?
VulpesPosted Oct 29, 2012, 1:13 PM
If so and you can tell us what it is, then we should be able to tell you which reference and namespace are needed.
Sandeep Singh ShekhawatPosted Oct 29, 2012, 1:10 PM
http://support.microsoft.com/default.aspx?kbid=304656&wa=wsignin1.0
dcPosted Oct 29, 2012, 10:34 AM
Sandeep Singh ShekhawatPosted Oct 29, 2012, 9:51 AM
As per my understanding you are build application on one palace and reference added from other location where dll is not updating.
Thanks
Sandeep
Vithal WadjePosted Oct 29, 2012, 8:38 AM