I\'m using Roslyn to compile, emit and run C# source code. However, I\'ve run into a limitation when faced with projects that use EntityFramework.
It seems that simply e
Try the following:
var mockObject = new Mock();
IBuildEngine engine = mockObject.Object;
var entityDeployTask = new EntityDeploy();
entityDeployTask.Sources = new ITaskItem[]
{
new TaskItem(@"path to edmx\Model1.edmx")
};
entityDeployTask.OutputPath = @"C:\";
entityDeployTask.BuildEngine = engine;
entityDeployTask.Execute();
The output path doesn't seem to be picked up, but if it's empty then an error is logged. You can see this if you implement your own IBuildEngine
and log the errors. The result of the process will be three files next to the edmx: "Model1.ssdl", "Model1.csdl", "Model1.msdl". These files need to be passed to CSC as embedded resources, at least that's what the original targets file seems to do.
Hope it helps, and at least gets you started.