1

I have run into this issue a few times now, and I did manage to get it working once, but again since then, it is refusing to cooperate.

I have tried this solution, to ensure all projects are being built, I have attempted to locate the file in question, but this doesn't solve the problem either.

I decided to look at the Disassembly, and for some reson it is looking in a completely separate directory?

  • Where the program is looking (according to disassembly): C:\Users[...]\ Visual Studio 2010 \Projects[…]\Connect_DBEngine_MySQL\MySQLFunctions.cs
  • Where the file actually exists: C:\Users[...]\ Visual Studio 2015 \Projects[…]\Connect_DBEngine_MySQL\MySQLFunctions.cs

The disassembly report:

--- C:\Users\Benjamin\Documents\Visual Studio 2010\Projects\SVN\DCIM\Connect_DBEngine_MySQL\MySQLFunctions.cs 
0140E11C  push        esi  
0140E11D  push        ebx  
0140E11E  sub         esp,34h  
0140E121  xor         eax,eax  
0140E123  mov         dword ptr [ebp-10h],eax  
0140E126  mov         dword ptr [ebp-1Ch],eax  
0140E129  mov         dword ptr [ebp-3Ch],ecx  
0140E12C  mov         dword ptr [ebp-40h],edx  
0140E12F  cmp         dword ptr ds:[5CB9FE0h],0  
0140E136  je          0140E13D  
0140E138  call        6827FA00  
0140E13D  nop  // This line is highlighted, like a breakpoint?
0140E13E  mov         edx,dword ptr [ebp-3Ch]  
0140E141  mov         eax,dword ptr [ebp-40h]  
0140E144  lea         edx,[edx+4]  
0140E147  call        67EDEC20  
0140E14C  nop  
0140E14D  lea         esp,[ebp-0Ch]  
0140E150  pop         ebx  
0140E151  pop         esi  
0140E152  pop         edi  
0140E153  pop         ebp  
0140E154  ret  
--- No source file -------------------------------------------------------------

EDIT as per comments:

  • I am using VS 2015, .NET 4.0.
  • The error I am getting is "The source file is different to the one that was built", when I attempt to run the program.

    enter image description here

  • The file that is failing is another project in the same solution.

    enter image description here

  • I have ensured all the relevant projects (including this one) are being built (in the Configuration manager)

    enter image description here

  • The project is loaded as a reference to the Main project (file(s) are in the appropriate bin folder)

    enter image description here

Ben
  • 2,433
  • 5
  • 39
  • 69
  • I'm not sure on what you are asking. What is the error you are getting and when you are getting this error? – Himesh Sameera Sep 23 '19 at 07:01
  • Does it work when you build it in console? Which dotnet version do you use? – Viktor Arsanov Sep 23 '19 at 07:08
  • Btw, you can open the assembly file even with text editor - you can look for the source file name and there you will find the full path. – Viktor Arsanov Sep 23 '19 at 07:11
  • Net library looks for Reference Items (See you solution Explorer) in the Project bin folder.First check what files are in your bin folder.Make sure you have the correct files check the Date and Size of the file.You can right click on the reference object to check the source of the file and if the option is checked to copy to executable folder.When these type issues occur the file is in the wrong executable folder (debug vs release). Never manually put a object in the bin folder because you end up having issues if you change from debug to release.Use the Add Existing Item and browse to object. – jdweng Sep 23 '19 at 09:16

1 Answers1

0

I realised that the way the project was built, was because it was actually a plugin, not actually directly part of the original program.

So while the project was being built correctly, the Main project was actually referring to a .dll of the reference project, that was much older (2016), and that was what was being referred to.

So after replacing the appropriate files (.dll and .pdb) of the reference project, the program recognised the relevant file(s), which solved the problem.

Ben
  • 2,433
  • 5
  • 39
  • 69