curiouswebster
asked on
EF5 How do I stop pre-compiled views?
I am having a terrible bug involving pre-compiled views.
Here is the inner exception...
InnerException = {"The mapping and metadata information for EntityContainer 'MyContext' no longer matches the information used to create the pre-generated views."}
I use VS 2016.
So, I installed EFPowerTools and used the newly installed option:
In Solution Explorer, Right click MyContext.edmx
select: Entity Framework > Generate Views
I see a new file is created:
MyContext.View.cs
and added to the project
I run the program and get the same exception. Why?
I follow these instructions but did not write any new code as this MSDN post suggests...
https://msdn.microsoft.com/en-us/data/dn469601.aspx
Can I disable pre-compiled views? At the moment, I am okay with slower performance.
Thanks.
Here is the inner exception...
InnerException = {"The mapping and metadata information for EntityContainer 'MyContext' no longer matches the information used to create the pre-generated views."}
I use VS 2016.
So, I installed EFPowerTools and used the newly installed option:
In Solution Explorer, Right click MyContext.edmx
select: Entity Framework > Generate Views
I see a new file is created:
MyContext.View.cs
and added to the project
I run the program and get the same exception. Why?
I follow these instructions but did not write any new code as this MSDN post suggests...
https://msdn.microsoft.com/en-us/data/dn469601.aspx
Can I disable pre-compiled views? At the moment, I am okay with slower performance.
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
What are the pre-compiled View filename extensions? Maybe I can delete them manually? Or is MyContext.View.cs considered a pre-compiled view?
Also from the article you posted "It's near certainty that it's writable on your development workstation"
I did verify the folder is writable and even opened VS 2015 as an Admin. And by the fact that the MyContext.View.cs files exists, I assume there are no folder write permissions issues at play here.
Also from the article you posted "It's near certainty that it's writable on your development workstation"
I did verify the folder is writable and even opened VS 2015 as an Admin. And by the fact that the MyContext.View.cs files exists, I assume there are no folder write permissions issues at play here.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
try to set build action to none ..
ASKER
That created the following exception:
Message = "Unable to load the specified metadata resource."
Message = "Unable to load the specified metadata resource."
ASKER
thanks
ASKER
> To improve performance I have pre-compiled the views that EF normally generates at runtime. This works fine when I run locally or publish to our test server from visual studio
I am running locally and should have no need to pre-generated views, I would think.
I tried it both with the MyContext.View.cs being added to the project via EFPowerTools and with it deleted. Both got the same error.