none
Getting an "Unknown build error". I cannot figure out why

    Question

  • I'm working on a WPF app. I've been working on this app for several weeks. Now, all of a sudden, I can no longer compile it, debug it, run it, etc. When I try to I keep getting this error:

    Unknown build error, 'Could not load file or assembly 'file:///D:\Src\LRAT...\LRAT\LRAT\obj\Debug\LRAT.exe' or one of its dependencies. The system cannot find the file specified.'

    Well, certainly the LRAT.exe isn't there. But that's the whole point of building it, so it will be there. I've done a Get Latest (several times), but it makes no difference whatsoever. I've cleaned my solution, gotten into and out of Visual Studio, rebooted my machine. I have no pending changes. Nothing helps. And what's really weird is my other team mates are able to compile it fine. So, what gives??

    I'm using Visual Studio 2015.


    Rod

    • Moved by Sabah ShariqMVP Wednesday, March 01, 2017 11:55 AM Moved From Visual C#
    Tuesday, February 28, 2017 10:20 PM

Answers

  • Hi Rod at Work,

    Thank you for posting here.

    For your question, please check if you are referencing an assembly which in turn referencing an old version. For example, maybe your LRAT.exe have an assembly which needs an old version of assembly, now when you reference you should provide it with the old version, and that makes the problem.

    May be the output folder where all projects build their assemblies, has an old version.

    You could use  Fuslogvw.exe (Assembly Binding Log Viewer) to display details for assembly binds. This information helps you diagnose why the .NET Framework cannot locate an assembly at run time.

    Here is a quick way, create a new project and copy the code to have a try. Maybe there is something wrong with your Visual Studio. When you create a new one and get the same error, please feel free to contact us.

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Rod at Work Thursday, March 02, 2017 8:19 PM
    Wednesday, March 01, 2017 5:28 AM

All replies

  • Maybe you need to wipeout the solution/project off the HD and do a getlatest.

    You should post to the correct forum, since you don't have a C# issue.

    https://social.msdn.microsoft.com/Forums/vstudio/en-us/home?forum=visualstudiogeneral

     
    Tuesday, February 28, 2017 11:33 PM
  • It's probably "one of its dependencies". Check that the project references are all present and correct.
    Tuesday, February 28, 2017 11:55 PM
  • Hi Rod at Work,

    Thank you for posting here.

    For your question, please check if you are referencing an assembly which in turn referencing an old version. For example, maybe your LRAT.exe have an assembly which needs an old version of assembly, now when you reference you should provide it with the old version, and that makes the problem.

    May be the output folder where all projects build their assemblies, has an old version.

    You could use  Fuslogvw.exe (Assembly Binding Log Viewer) to display details for assembly binds. This information helps you diagnose why the .NET Framework cannot locate an assembly at run time.

    Here is a quick way, create a new project and copy the code to have a try. Maybe there is something wrong with your Visual Studio. When you create a new one and get the same error, please feel free to contact us.

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Rod at Work Thursday, March 02, 2017 8:19 PM
    Wednesday, March 01, 2017 5:28 AM
  • Hi Rod at Work,

    Probably because "one of its dependencies" not build yet. If you have multiple project in same solution I would suggest you to rebuild each project separately, see if this resolves your issue.


    Thanks,
    Sabah Shariq

    [If a post helps to resolve your issue, please click the "Mark as Answer" of that post or click Answered "Vote as helpful" button of that post. By marking a post as Answered or Helpful, you help others find the answer faster. ]

    Wednesday, March 01, 2017 11:54 AM
  • Also, this is Visual C# forum. I am moving your thread to Visual Studio General forum for getting quick response.

    Your understanding and cooperation will be grateful.

    Thanks,
    Sabah Shariq

    [If a post helps to resolve your issue, please click the "Mark as Answer" of that post or click Answered "Vote as helpful" button of that post. By marking a post as Answered or Helpful, you help others find the answer faster. ]

    Wednesday, March 01, 2017 11:54 AM
  • Thank you, Sabah. Sometimes it isn't as easy as one would think, to know which forum to post a message.

    Rod

    Wednesday, March 01, 2017 3:09 PM
  • Hi Rod

    Please go to References in Solution Explorer in Visual Studio.

    Select the assembly which is getting complained.

    Check the property page of the reference.

    There should be an option Copy Local, set it to true.

    This will copy the assembly to the output directory at build-time.

    You could give it a try.

    Best regards,

    Fletch


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, March 02, 2017 9:55 AM