random cs files not opening in visual studio 2012

前端 未结 6 1583
灰色年华
灰色年华 2021-02-19 19:47

So here\'s my pickle. I\'m using Visual Studion 2012 and been developing my application without a hitch. I opened VS today and I can open all the files as I normally would (cs

6条回答
  •  南旧
    南旧 (楼主)
    2021-02-19 20:07

    I had this same error and it was caused by my dlls in one project not getting up to date with another project dependency. I tried rebuilding, deleting bin files, clearing cache and a few other things. None of it worked for me.

    Here is a simple example of my scenario. Project A was dependent on Project B. Whenever Project A hit a point in debugging where it called a method in project B I received the error.

    What worked to fix my issue:

    • Put both Project A and Project B into a single VS solution. (If you have many projects that all depend on each other, you can place them all in the same solution, I actually had 9)
    • Clean and Build both projects. (to get them synced within the new solution)
    • Set your startup project to be Project A (or whatever you were previously trying to debug.)

    Now you should be able to step through both project's code.

提交回复
热议问题