Closed sunnylarr closed 2 months ago
Any advice or insight at all in to the issue? Are there workarounds that don't involve hard coded paths or the need to install the DLL in the global assembly cache?
@sunnylarr Can you try upgrading to 9.0.0-preview.7.24405.3? It references a new version of Mono.TextTemplating that contains a fix that might be relevant here.
EF Team Triage: Closing this issue as the requested additional details have not been provided and we have been unable to reproduce it.
BTW this is a canned response and may have info or details that do not directly apply to this particular issue. While we'd like to spend the time to uniquely address every incoming issue, we get a lot traffic on the EF projects and that is not practical. To ensure we maximize the time we have to work on fixing bugs, implementing new features, etc. we use canned responses for common triage decisions.
Hello, my team has been using EF Core Power Tools for a few months now with no major issues, but just recently we have noticed a bug when trying to run EF Power Tools reverse engineering using custom T4 template files.
After talking to @ErikEJ, the problem seems to be with EF Core itself since the same error occurs using the EF Core CLI tool.
Prior to the error, we would be able to successfully generate our EF context and model files using T4 templates that included assemblies located in our project's Libs\ folder. In this case, a local
PluralizeService.Core.dll
like so:However, within the last few months, we would be getting this error when trying to run EF Core Power Tools, or even the EF Core CLI with the following command:
dotnet ef dbcontext scaffold "Data Source=tcp:<our_local_test_db_url>,1433;Initial Catalog=DEV_DB;Authentication=Active Directory Interactive;" Microsoft.EntityFrameworkCore.SqlServer
One thing to note is that absolute pathing does work, such as
<#@ assembly name="C:\Users\LSun10\Repos\Common\MyProject\Libs\PluralizeService.Core.dll" #>
I am also not able to use any VS variables such as $(SolutionDir) or custom project properties as described in the T4 guide here
I also noticed that, when trying to print the working directory from the
DbContext.t4
file, it would returnC:\Windows\system32
, so it is not respecting the project's working directory anymore.Any reason why the template generation logic changed? Again, these template files were working fine a few months ago and are now suddenly broken. Any help would be greatly appreciated. Thanks!
Include provider and version information
EF Core version: 8.0.8 Database provider: Microsoft.EntityFrameworkCore.SqlServer Target framework: .NET 6.0 Operating system: IDE: Visual Studio 2022 17.10.0