admin管理员组文章数量:1321257
I would like to generate code from a SQL Server database using scaffolding and Entity Framework Core. The project I am working with, has a dependency on COM.
When executing the following command in the terminal:
dotnet ef dbcontext scaffold "Data Source=mysource;Initial Catalog=mydb" Microsoft.EntityFrameworkCore.SqlServer
I get an error
MSB4803: The task "ResolveComReference" is not supported on the .NET Core version of MSBuild. Please use the .NET Framework version of MSBuild.
Of course I checked, building the project normally from Solution Explorer works fine. So, I understand the command line tool does not use the same way to build...
How can I tell dotnet ef dbcontext scaffold
command to use the right "thing" to build ?
Also, why does it need to build itself (I want to generate code, not to build it...) ?
How can I check if it connects properly to the database? I am not even sure this works, since it seems it wants to build before anything else.
I would like to generate code from a SQL Server database using scaffolding and Entity Framework Core. The project I am working with, has a dependency on COM.
When executing the following command in the terminal:
dotnet ef dbcontext scaffold "Data Source=mysource;Initial Catalog=mydb" Microsoft.EntityFrameworkCore.SqlServer
I get an error
MSB4803: The task "ResolveComReference" is not supported on the .NET Core version of MSBuild. Please use the .NET Framework version of MSBuild.
Of course I checked, building the project normally from Solution Explorer works fine. So, I understand the command line tool does not use the same way to build...
How can I tell dotnet ef dbcontext scaffold
command to use the right "thing" to build ?
Also, why does it need to build itself (I want to generate code, not to build it...) ?
How can I check if it connects properly to the database? I am not even sure this works, since it seems it wants to build before anything else.
Share Improve this question edited Jan 17 at 16:49 marc_s 756k184 gold badges1.4k silver badges1.5k bronze badges asked Jan 17 at 15:27 mguijarrmguijarr 7,9306 gold badges49 silver badges74 bronze badges 3- 1 Just use EF Core Power Tools – ErikEJ Commented Jan 17 at 15:32
- Thanks @ErikEJ - what does it mean? Should I install something – mguijarr Commented Jan 17 at 15:35
- So I gave a try to EF Core Power Tools, it seems helpful however I don't know how to generate code like what I was expecting from the command line in the question – mguijarr Commented Jan 17 at 15:51
1 Answer
Reset to default 1So, I answer my own question (again !), may this helps future me or someone in the same situation...
thanks to EF Core Power Tools extension, I could test connection and have the proper
Data Source=...
instructionI used
--no-build
option to not have this build stepI had to clean and rebuild the whole project
Finally, I got the generated code as expected.
本文标签:
版权声明:本文标题:c# - .NET database scaffolding: build step fails with unsupported "ResolveComReference" (.NET core vs .NET fra 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742095917a2420547.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论