I'm creating a new view off of a model.
The error message I am getting is
Error
There was an error running the selected code generator:
'Access to the path
'C:\Users\XXXXXXX\AppData\Local\Temp\SOMEGUID\EntityFramework.dll' is denied'.
I am running VS 2013 as administrator.
I looked at Is MvcScaffolding compatible with VS 2013 RC by command line? but this didn't seem to resolve the issue.
VS2013 C#5 MVC5 Brand new project started in VS 2013.
I had the same problem when in my MVC app EF reference property (in Properties window) "Specific version" was marked as False and in my other project (containing DBContext and models) which was refrenced from MVC app that EF reference property was marked as True. When I marked it as False everything was fine.
change the web.config file as such: removed the provider/s from ef tag:
added connection string tags under config sections:
I have the exact same problem. First encountered this while following along the Pluralsight Course "Parent-Child Data with EF, MVC, Knockout, Ajax, and Validation".
I am using MVC 5, EF 6.1.1 and framework 4.5.2.
Even after updating my VS2013 to update 4, this error still persisted.
Was able to circumvent this annoying problem by changing the DbSet to IDbSet inside the DbContext class. Answer was originally from here.
What worked for me to resolve this: Close Solution, And open the project by clicking project file and not the solution file, add your controller, and bobs your uncle
In case it helps anyone, I renamed the namespace that the model resided in, then rebuilt the project, then renamed it back again, and rebuilt, and then it worked.
None of the above helped for me.
I found that the cause of my problem was overriding OnModelCreating in my context class that the scaffold item was dependent on. By commenting out this method, then the scaffolding works.
I do wish Microsoft would release less buggy code.