I'm getting an issue that appears to be intermittent but I have no idea why it happens.
Today I did a "get latest" on a project I am contributing to and it downloaded all the files as expected. However, when I did a clean and build I had lots of errors of type CS2001 saying class files were missing. I knew they are Entity Framework related files as the referenced project is our Entity Framework class library and the missing files all start with "tbl_" which is our convention for Entity Framework generated class objects from our SQL Servers database tables. There are also some store procedure object classes showing as missing too saying it cannot find them also.
I'm very confused as I'm sure Entity Framework context files are auto generated but I can see the context files!
I have had this before and it took ages to fix. Sadly, I cannot remember how I did it.
Can anyone help?
Yes, I get this all the time. Seems to be an issue from Entity Framework 6 onwards. Very annoying bug which occurs when you download the files from source control.
You are correcting that the files are generated. What's likely happened is some of the files that have dependency's have not generated. You can see them in your project as they will have the same yellow explanation mark icon as a missing file in your solution explorer.
To fix this, do the following.
Now when you build it should work fine.
Above shows how it should look if you experience this issue. this is from a project i contribute with the exact same issue.
This is where "Run Custom Tool" is located.
Hope this helps