So when I build my solution in VS2017, everything works great. I'm getting started with Cake Build and I'm running into issues.
When running .\build.ps1
I end up with the error
Program.cs(19,30): error CS0246: The type or namespace name 'Accounts' could not be found (are you missing a using directive or an assembly reference?)
It's as if project references are not resolving. Does anyone have any suggestions? Below is my cake.build
file
//////////////////////////////////////////////////////////////////////
// ARGUMENTS
//////////////////////////////////////////////////////////////////////
var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");
//////////////////////////////////////////////////////////////////////
// PREPARATION
//////////////////////////////////////////////////////////////////////
// Define directories.
var solutions = GetFiles("./**/*.sln");
//////////////////////////////////////////////////////////////////////
// TASKS
//////////////////////////////////////////////////////////////////////
Task("Clean")
.Does(() =>
{
var solutionPaths = solutions.Select(solution => solution.GetDirectory());
foreach(var path in solutionPaths)
{
Information("Cleaning {0}", path);
CleanDirectories(path + "/**/bin");
CleanDirectories(path + "/**/obj");
}
});
Task("Restore")
.IsDependentOn("Clean")
.Does(() =>
{
foreach(var solution in solutions)
{
Information("Restoring {0}...", solution);
NuGetRestore(solution);
}
});
Task("Build")
.IsDependentOn("Restore")
.Does(() =>
{
foreach(var solution in solutions)
{
Information("Building {0}...", solution);
if(IsRunningOnWindows()) // Use MSBuild
MSBuild(solution, new MSBuildSettings {
Configuration = configuration,
Verbosity = Verbosity.Minimal
});
else // Use XBuild
XBuild(solution, settings => settings.SetConfiguration(configuration));
}
});
//////////////////////////////////////////////////////////////////////
// TASK TARGETS
//////////////////////////////////////////////////////////////////////
Task("Default")
.IsDependentOn("Build");
//////////////////////////////////////////////////////////////////////
// EXECUTION
//////////////////////////////////////////////////////////////////////
RunTarget(target);