none
C# build error RRS feed

  • Question

  • Problem: missing a reference or a namespace directive

    Cause: My problem is due to checking some C# 2008 and C# 2010 applications into anksvn (version control) software and rechecking out the code to work on. This is the first time I checked the code into  anksvn (open source version control software specifically for visual studio). This problem is only occuring in one solution file.
     
     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?

    Monday, October 29, 2012 6:27 PM

Answers

  • It is looking for the common.logging.dll. Do you know how I can fiind this dll? If so, can you tell me how locate the common.logging.dll and/or add this dll to the solution file?

    I believe that the common.logging.dll is an open source  project which bills itself as "Common Infrastructure Libraries for .NET" on source forge (link) which allows for a general way to log. It can be installed via Visual Studio's Nu-get Package installer or as a HTML download in the download section in the link provided.

    See How to: Add or Remove References By Using the Add Reference Dialog Box as to your other question.

    Also, I suggest that you create a seperate directory in anksvn which would contain all the third party dlls which your project(s) needs and can be easily acquired during the check out/get phase. So this doesn't happen in the future to the next developer who needs an add-in installed in before being able to work; just like you ran into.

    See Ian's answer on StackOverflow to the question TFS, VS2008: How to deal with external assemblies or the sort of dry version as (just focus on the Common folder location in the source control and not TFS) as found at patterns & practices: Team Development with Visual Studio Team Foundation Server.


    William Wegerson (www.OmegaCoder.Com)




    Tuesday, October 30, 2012 12:43 PM
    Moderator

All replies

  • In the Solution Explorer window, you can open up the Project's "References" section, and there should be an error icon over all references that are missing.

    You'll need to figure out how you want to handle this.  If the references are local, you need to make sure the assemblies (DLLs) are available when you check out the project.  There are various approaches here, from using common paths, including the references in your source control, etc.


    Reed Copsey, Jr. - http://reedcopsey.com
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    Monday, October 29, 2012 6:36 PM
    Moderator
  • You mentioned the following, "You'll need to figure out how you want to handle this.  If the references are local, you need to make sure the assemblies (DLLs) are available when you check out the project.  There are various approaches here, from using common paths, including the references in your source control, etc.".

    From the statement above, i have the following additional questions:

    1. From the part of the statment, "If the references are local, you need to make sure the assemblies (DLLs) are available when you check out the project", I know that local means in the code you are actually accessing at the current moment. However I do not know  what you mean by, "need to make sure the assemblies (DLLs) are available when you check out the project"? How do you complete this task?

    2. You also mentioned the following, "There are various approaches here, from using common paths, including the references in your source control, etc.". I do not know what the various approaches are here. Can you explain how to "use common paths including the references in your source control" or show me in code how to complete this task?

    Monday, October 29, 2012 7:14 PM
  • This isn't really a "code" issue - the problem is that the C# project can't find the assemblies (DLLs) you're referencing.

    At some point, you did an "Add Reference" and added a reference to a DLL in your project.  This DLL is not in the same place in your checked out folder as it is in the original one.  

    As I said, go into the project with the error, and look in the References in Solution Explorer, and you should see the problem.


    Reed Copsey, Jr. - http://reedcopsey.com
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    Monday, October 29, 2012 7:30 PM
    Moderator
  • Problem: missing a reference or a namespace directive

     This is the first time I checked the code into  anksvn (open source version control software specifically for visual studio). This problem is only occuring in one solution file.
     
     
    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.

    As an aside, do you do a Save-All before cheking into anksvn?

    Maybe ank is saving the project file as it sits on the hard drive, but not the correct project file with the correct references which is in memory during the time of the save.


    William Wegerson (www.OmegaCoder.Com)

    Monday, October 29, 2012 8:06 PM
    Moderator
  • Just out of curiosity, what file exactly is it complaining about? Is it a .NET assembly or perhaps a third party dll? The reason I ask is that sometimes that has a bearing on how you can go about fixing it.

    Monday, October 29, 2012 11:46 PM
  • It is looking for the common.logging.dll. Do you know how I can fiind this dll? If so, can you tell me how locate the common.logging.dll and/or add this dll to the solution file?
    Tuesday, October 30, 2012 3:45 AM
  • It is looking for the common.logging.dll. Do you know how I can fiind this dll? If so, can you tell me how locate the common.logging.dll and/or add this dll to the solution file?

    I believe that the common.logging.dll is an open source  project which bills itself as "Common Infrastructure Libraries for .NET" on source forge (link) which allows for a general way to log. It can be installed via Visual Studio's Nu-get Package installer or as a HTML download in the download section in the link provided.

    See How to: Add or Remove References By Using the Add Reference Dialog Box as to your other question.

    Also, I suggest that you create a seperate directory in anksvn which would contain all the third party dlls which your project(s) needs and can be easily acquired during the check out/get phase. So this doesn't happen in the future to the next developer who needs an add-in installed in before being able to work; just like you ran into.

    See Ian's answer on StackOverflow to the question TFS, VS2008: How to deal with external assemblies or the sort of dry version as (just focus on the Common folder location in the source control and not TFS) as found at patterns & practices: Team Development with Visual Studio Team Foundation Server.


    William Wegerson (www.OmegaCoder.Com)




    Tuesday, October 30, 2012 12:43 PM
    Moderator