Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Craigoss opened this issue Jan 25, 2024 · 1 comment
Open

Comments

@Craigoss
Copy link

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.

@RdJNL
Copy link
Owner

RdJNL commented Jan 30, 2024

What assembly references do you have in the T4 file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants