0
    
    
        
                    Leonardo.Willrich created
                    
                    
                    
                
                - ABP Framework version: v4.2.1
- UI type: Blazor
- DB provider: EF Core
- Tiered (MVC) or Identity Server Separated (Angular): yes / no
- Exception message and stack trace:
- Steps to reproduce the issue:
Hi,
When I try to run DbMigrator.exe on deployed environment it says that the solution folder was not found. In the "...DbMigrationService.cs" I've found a method that gets the solution path. If not found, it raises an exception. See below:
private string GetDbMigrationsProjectFolderPath()
        {
            var slnDirectoryPath = GetSolutionDirectoryPath();
            if (slnDirectoryPath == null)
            {
                throw new Exception("Solution folder not found!");
            }
            var srcDirectoryPath = Path.Combine(slnDirectoryPath, "src");
            return Directory.GetDirectories(srcDirectoryPath)
                .FirstOrDefault(d => d.EndsWith(".DbMigrations"));
        }
        private string GetSolutionDirectoryPath()
        {
            var currentDirectory = new DirectoryInfo(Directory.GetCurrentDirectory());
            while (Directory.GetParent(currentDirectory.FullName) != null)
            {
                currentDirectory = Directory.GetParent(currentDirectory.FullName);
                if (Directory.GetFiles(currentDirectory.FullName).FirstOrDefault(f => f.EndsWith(".sln")) != null)
                {
                    return currentDirectory.FullName;
                }
            }
            return null;
        }
Is that correct? Is DbMigrator suppose to be executed in deployment environement? I don't have my source code there, only the binary files generated by "Publish to Folder" option.
2 Answer(s)
- 
    0
- 
    0This question has been automatically marked as stale because it has not had recent activity. 

 
                                