This is a bit of a weird one. I'm doing an MVC 3 code first development using the SQL compact 4 stuff. Its all running fine but I'm getting issues when I try to scaffold a new controller. I fire up the new controller dialog and select my entity and the datacontext (both of which are in a separate assembly in the same solution) and get the following error:
Unable to retrieve metadata for 'MyNamespace.MyClassName'. Access to the database file is not allowed. [ 1884,File name=C:\Program Files\Microsoft Visual Studio 10.0\Common7\EntityContext.sdf,SeCreateFile ]
That file does not exist on disk at the moment - the EntityContext.sdf file is sat in my App_Data folder. I'm not sure if its trying to create that file (and if so why?) but if it is I'm not logged in as admin so it won't have permissions. In that case do I need to define a difference working folder or something?
I've tried it running as admin now and it works, so it's definitely trying to create a file in my Program Files directory, there must be a setting for temp files somewhere?
Any help would be great :)