Closed reactor-gonguela closed 4 years ago
Please share your csproj file
`<?xml version="1.0" encoding="utf-8"?>
same issue here
I am not able to reproduce in the latest VS 2019 version, please provide a repro project, and I will investigate.
Ping ?
Hi I have windows 10 Pro version 2004 and Visual Studio Enterprise 2019 Version 16.7.5. i'm getting the following error
'Console.Domain' is a project in my solution and the solution is buildable and working with no issues.
and here is the csproj content for the project i'm trying to generate views for ` <?xml version="1.0" encoding="utf-8"?>
I need a full repro solution, as I cannot reproduce.
actually, I was deleting some projects from my solution to send it to you and I have tried once before sending and it works. I went back to my original solution and unload all unnecessary projects and I have made the views successfully. so I think in my case it's totally related to something in other projects.
Closing this as no repro received, feel free to re-open if you can provide one.
@reactor-gonguela Latest daily build includes much improved error logging for this issue.
I installed the latest daily build, and got the not very helpful output below "An error occurred while trying to generate views for CodingModel".
How does one debug the tool to discover where the error is occurring?
System.AggregateException: One or more errors occurred. ---> Microsoft.DbContextPackage.Extensions.EdmSchemaErrorException: An error occurred while trying to generate views for CodingModel.
at Microsoft.DbContextPackage.Handlers.OptimizeContextHandler.<>c__DisplayClass6_0.<OptimizeContextEF6>b__0(String viewsPath)
at Microsoft.DbContextPackage.Handlers.OptimizeContextHandler.<>c__DisplayClass4_1.<OptimizeContextCore>b__1()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of inner exception stack trace ---
---> (Inner Exception #0) Microsoft.DbContextPackage.Extensions.EdmSchemaErrorException: An error occurred while trying to generate views for CodingModel.
at Microsoft.DbContextPackage.Handlers.OptimizeContextHandler.<>c__DisplayClass6_0.<OptimizeContextEF6>b__0(String viewsPath)
at Microsoft.DbContextPackage.Handlers.OptimizeContextHandler.<>c__DisplayClass4_1.<OptimizeContextCore>b__1()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()<---
Are you able to provide a sample project and I will have a look - looks like there is room for even more improvement
Sorry, haven't been able to create a repro project and probably wouldn't be able to anyway. There is probably something wrong in our database project itself or with the edmx, probably due to a merge that someone did, though both projects build fine. We have another team that started "helping out" on our project and they don't exactly know what they're doing and things like bad merges of files that should not ever be merged in the first place are occurring (e.g., trying to actually merge an edmx file).
When this happened a week or two ago, I reverted the edmx and sqlproj back to a known good state, and then generating views worked fine, so I then applied all of the schema changes manually and then everything worked.
I wonder if there is some kind of caching going on in Visual Studio or something where things get in a bad state; I've also had some issues due to these bad merges (I think) wherein my app will apaprently go into an infinite recursion and will blow out the stack and exit hard when attempting to use the dbcontext for certain model objects only, so probably that's where the actual problem lies. (Again, everything builds fine).
So now some more checkins have occurred from this other team, and now I'm back to the same place and basically the same error "an error occurred".
I was serious about asking how one might debug this, as in run the generate views manually as a separate executable and debug it, or if there are any suggestions you have that would be great.
@domehead100 Clone this repo, set a breakpoint in the OptimizeContextHandler, and press F5.
Hello, i'm getting an error when atempting to generete the views for my code first context and i don't know how to fix it. I already tried to reinstall the power tools but nothing seems to wok.