mono / t4

T4 text templating engine
Other
394 stars 101 forks source link

ERROR: Metadata file 'Microsoft.EntityFrameworkCore.dll' could not be found #155

Open divinebovine opened 1 year ago

divinebovine commented 1 year ago

My t4 template has the following:

<#@ output extension=".md" #>
<#@ assembly name="System.Core" #>
<#@ assembly name="Microsoft.EntityFrameworkCore" #>
<#@ assembly name="Microsoft.EntityFrameworkCore.Relational" #>
<#@ assembly name="Microsoft.EntityFrameworkCore.Design" #>
<#@ parameter name="Model" type="Microsoft.EntityFrameworkCore.Metadata.IModel" #>
<#@ parameter name="Options" type="Microsoft.EntityFrameworkCore.Scaffolding.ModelCodeGenerationOptions" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="Microsoft.EntityFrameworkCore" #>

When I execute the dotnet t4 tool, I get the following:

dotnet t4 -P bin/Debug/net7.0/ MermaidDiagram.tt
Processing 'MermaidDiagram.tt' failed.
ERROR: Metadata file 'Microsoft.EntityFrameworkCore.dll' could not be found
ERROR: Metadata file 'Microsoft.EntityFrameworkCore.Relational.dll' could not be found
ERROR: Metadata file 'Microsoft.EntityFrameworkCore.Design.dll' could not be found

My project's bin/Debug/net7.0 folder has these dlls, but I'm not sure why this isn't working. Any advice would be appreciated.

danielgreen commented 1 year ago

@divinebovine Does your csproj specify a runtime identifier? I've run into a similar issue affecting CLI builds when the --runtime option is used.