the source file is different from when the module was built

后端 未结 27 2000
無奈伤痛
無奈伤痛 2020-11-29 20:53

This is driving me crazy.

I have a rather large project that I am trying to modify. I noticed earlier that when I typed DbCommand, visual studio did

相关标签:
27条回答
  • 2020-11-29 21:15

    solution:- the problem is:- if your some projects in a solution , refer to some other projects, then sometimes the dll of some projects, will not update automatically, whenever you build the solution, some projects will have previous build dlls, not latest dlls

    you have to go manually and copy the dll of latest build project into referenced project

    0 讨论(0)
  • 2020-11-29 21:17

    Check if the location you pointed to using mex() in Matlab is correct (contains lib and obj files which are modified to the last date you compiled the library in Visual studio).

    If this is not the case:

    Make sure you are compiling Visual studio in a mode that saves .lib files :

    1. properties -> Config properties -> General -> Config type -> static library

    2. properties -> Config properties -> General -> Target extension=.lib (instead of exe)

    Make sure the output and intermediate directories match the Matlab directory in

    1. properties -> Config properties -> General -> Output directory
    2. properties -> Config properties -> General -> Intermediate directory
    0 讨论(0)
  • 2020-11-29 21:18

    Follow these steps

    1. Just delete the bin directory from the project where the DLL is generated.
    2. Re-build the project.
    3. Remove reference from the project that make reference to the DLL.
    4. Include again the reference.
    5. Enjoy.
    0 讨论(0)
  • 2020-11-29 21:18

    I had the same problem. To fix it I used the "Release Mode" to debug in VS2013. Which is sufficient for me, because I'm working in a node js\c++ addon.

    0 讨论(0)
  • 2020-11-29 21:19

    This is how I fixed the problem in Visual Studio 2010:

    1) Change the 'Solutions Configurations' option from "Debug" to "Release"

    2) Start debugging

    3) Stop debugging and switch the 'Solutions Configurations' option back to "Debug"

    This worked for me. Step 3 is optional - it was working fine when I changed it to "Release" but I wanted to change it back.

    0 讨论(0)
  • 2020-11-29 21:20

    I got this issue running a console app where the source that was different was the source that had the entry-point (static void Main). Deleting the bin and obj directories and doing a full rebuild seemed to correct this, but every time I made a code change, it would go out-of-date again.

    The reason I found for this was:

    1. I had checked "Only build startup projects and dependencies on Run" (Tools -> Options -> Projects and Solutions -> Build and Run)
    2. In Configuration Manager, my start-up project didn't have "Build" checked

    (For #2 -> accessible via the toolbar under the 'Debug/Release' drop down list.)

    0 讨论(0)
提交回复
热议问题