Skip to content

Could not load file or assembly Microsoft.VisualStudio.Interop.dll #17

@Craigoss

Description

@Craigoss

We recently migrated from .net framework 4.8 to .net 6. We've found our existing .tt files do not generate.

We have added this extension and attempted to run but get the following errors:
Severity Code Description Project File Line Suppression State
Error Something went wrong executing the template in .NET Core: System.IO.FileNotFoundException: Could not load file or assembly 'd:\Repos\Hvcc.Ips\Src\Server\Hvcc.Ips.Host\Entities\Autogenerated\Microsoft.VisualStudio.Interop.dll'. The system cannot find the file specified.
File name: 'd:\Repos\Hvcc.Ips\Src\Server\Hvcc.Ips.Host\Entities\Autogenerated\Microsoft.VisualStudio.Interop.dll'
at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyPath(String assemblyPath)
at RdJNL.TemplateExecute.LibraryLoadContext.LoadLibrary(String library) in C:\Dev\TextTemplatingCore\TemplateExecute\LibraryLoadContext.cs:line 24
at RdJNL.TemplateExecute.Program.Main(String[] args) in C:\Dev\TextTemplatingCore\TemplateExecute\Program.cs:line 68 Hvcc.Ips.Host d:\Repos\Hvcc.Ips\Src\Server\Hvcc.Ips.Host\Entities\Autogenerated\Entities.tt 1

I did manage to find a package to obtain the Microsoft.VisualStudio.Interop.dll, but then found it needed to be copied into several places in our solution. Which then gave us a new error below:
Severity Code Description Project File Line Suppression State
Error Something went wrong executing the template in .NET Core: System.IO.FileNotFoundException: Could not load file or assembly 'd:\Repos\Hvcc.Ips\Src\Server\Hvcc.Ips.Host\Entities\Autogenerated%VSAPPIDDIR%EntityFramework.dll'. The system cannot find the file specified.
File name: 'd:\Repos\Hvcc.Ips\Src\Server\Hvcc.Ips.Host\Entities\Autogenerated%VSAPPIDDIR%EntityFramework.dll'
at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyPath(String assemblyPath)
at RdJNL.TemplateExecute.LibraryLoadContext.LoadLibrary(String library) in C:\Dev\TextTemplatingCore\TemplateExecute\LibraryLoadContext.cs:line 24
at RdJNL.TemplateExecute.Program.Main(String[] args) in C:\Dev\TextTemplatingCore\TemplateExecute\Program.cs:line 68 Hvcc.Ips.Host d:\Repos\Hvcc.Ips\Src\Server\Hvcc.Ips.Host\Entities\Autogenerated\Entities.tt 1

Any ideas?

Thanks,
Craig.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions