Could not find file '[project root]\CodeTemplates\CSharpDbContext\Partials\DbConstructor.hbs
See original GitHub issueWhen trying to reverse engineer using Handlebars templates, the output shows
System.IO.FileNotFoundException: Could not find file '[project root]\CodeTemplates\CSharpDbContext\Partials\DbConstructor.hbs'.
Steps to reproduce
Using Reverse Engineer tool:
- What to generate: EntityTypes & DbContext
- Check “Customize code using Handlebars templates (preview)”
Further technical details
EF Core Power Tools version: 2.2.4
Database engine: SQL Server
Visual Studio version: 15.9.5
Stack trace:
System.IO.FileNotFoundException: Could not find file '[project root]\CodeTemplates\CSharpDbContext\Partials\DbConstructor.hbs'.
File name: [project root]\CodeTemplates\CSharpDbContext\Partials\DbConstructor.hbs'
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost)
at System.IO.File.InternalReadAllText(String path, Encoding encoding, Boolean checkHost)
at System.IO.File.ReadAllText(String path)
at EntityFrameworkCore.Scaffolding.Handlebars.Internal.FileSystemFileService.RetrieveFileContents(String directoryName, String fileName)
at ReverseEngineer20.ReverseEngineer.CustomTemplateFileService.RetrieveTemplateFileContents(String relativeDirectory, String fileName, String altRelativeDirectory)
at EntityFrameworkCore.Scaffolding.Handlebars.HbsDbContextTemplateService.GetPartialTemplates()
at EntityFrameworkCore.Scaffolding.Handlebars.HbsTemplateService.RegisterPartialTemplates()
at EntityFrameworkCore.Scaffolding.Handlebars.HbsCSharpModelGenerator.GenerateModel(IModel model, String namespace, String contextDir, String contextName, String connectionString, ModelCodeGenerationOptions options)
at Microsoft.EntityFrameworkCore.Scaffolding.Internal.ReverseEngineerScaffolder.ScaffoldModel(String connectionString, IEnumerable`1 tables, IEnumerable`1 schemas, String namespace, String language, String contextDir, String contextName, ModelReverseEngineerOptions modelOptions, ModelCodeGenerationOptions codeOptions)
at ReverseEngineer20.EfCoreReverseEngineer.GenerateFiles(ReverseEngineerOptions reverseEngineerOptions)
at EFCorePowerTools.Handlers.ReverseEngineerHandler.<ReverseEngineerCodeFirst>d__2.MoveNext() in C:\projects\efcorepowertools\src\GUI\EFCorePowerTools\Handlers\ReverseEngineerHandler.cs:line 193
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
TFS checkin error - could not find file
My fix: 1. Exclude the old project and (any related files with this warning) from check-in. 2. Check in your changes. 3. With...
Read more >Frequently Asked Questions - Research Computing Services
How can I request a change to an existing project space on the HBSGrid, including requesting more storage space? Please fill out this...
Read more >Copying Files to/from the HBSGrid
Copying files between computers is made easy via terminal and GUI. But before you start the copying process please pause a moment and...
Read more >Accessing Spaces & Storage - Research Computing Services
You can connect to your research storage project spaces and home folders by using the familiar Finder "Connect to Server…" option: Connect to...
Read more >Failed - Could not find file"-message in an AutoCAD Plant ...
When closing project setup and checking-in the project, an error pops up: Plant Project Collaboration Error encountered Failed Could not ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
(I have confirmed the workaround fixes the issue)
Did you try a folder rename?