Команда генератора кода .net выполняет скаффолд только тогда, когда я останавливаю выполнение
I'm running the dotnet code generator commands from C# (using Process class), I'm able to create project using dotnet new mvc and I'm also able to add nuget packages. But I'm not able to scaffold when application is running. Scaffold happens only when I stop solution.
Process p = getProcess(); p.Start(); p.StandardInput.WriteLine("cd C:\\Users"); p.StandardInput.WriteLine("mkdir " + projName); p.StandardInput.WriteLine("cd " + projName); p.StandardInput.WriteLine("dotnet new sln"); p.StandardInput.WriteLine("dotnet new mvc -n " + projName); p.StandardInput.WriteLine("dotnet sln add .\\" + projName + ".\\" + projName + ".csproj"); p.StandardInput.WriteLine("cd " + projName); p.StandardInput.WriteLine("dotnet add package Microsoft.EntityFrameworkCore.SqlServer"); p.StandardInput.WriteLine("dotnet add package Microsoft.EntityFrameworkCore.Tools"); p.StandardInput.WriteLine("dotnet add package Microsoft.EntityFrameworkCore.SqlServer.Design -v 1.1.6"); p.StandardInput.WriteLine("dotnet add package Microsoft.VisualStudio.Web.CodeGeneration.Design"); p.StandardInput.WriteLine("dotnet add package bootstrap"); string connString = "Server = " + serverAddr + "; Database = " + dbName + "; Trusted_Connection = True;"; p.StandardInput.WriteLine("dotnet ef dbcontext scaffold " + " \"" + connString + "\" " + "Microsoft.EntityFrameworkCore.SqlServer --output-dir Models --project " + projName);
Что я уже пробовал:
p.StandardInput.Flush()