We have an ASP.NET MVC 5 project that we are developing that depends on projects from a different solution. The other solution are class libraries that are common, and we publish as NuGet packages. When we release we compile the project and have it take from the NuGet repository, but while we're under development we take the reference from the bin folder of that project.
To get this working we did the follow "hack" to the csproj file of out ASP.NET project (we've manually edited the csproj xml file and changed the reference):
<Reference Include="Common.Utilities, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath Condition=" '$(Configuration)' == 'Debug' ">..\..\..\Common\Common.Utilities\bin\$(Configuration)\Common.Utilities.dll</HintPath>
<HintPath Condition=" '$(Configuration)' != 'Debug' ">..\..\..\..\ExtrnBin\NuGetPackages\Common.Utilities.1.0.0.8\lib\net451\Common.Utilities.dll</HintPath>
</Reference>
so when we compile debug it takes from the class library project folder and when we compuile release it takes from the downloaded NuGet. This is very useful for rapid development since we don't have to re-publish a new NuGet for every change.
We are now testing ASP.NET 5, and dependencies are no longer defined in the csproj
file, but in project.json
file. So if we add a reference we get something like this in project.json
:
"dependencies": {
"EntityFramework.Commands": "7.0.0-rc1-final",
"EntityFramework.MicrosoftSqlServer": "7.0.0-rc1-final",
"Microsoft.ApplicationInsights.AspNet": "1.0.0-rc1",
"Microsoft.AspNet.Authentication.Cookies": "1.0.0-rc1-final",
"Microsoft.AspNet.Diagnostics.Entity": "7.0.0-rc1-final",
"Microsoft.AspNet.Identity.EntityFramework": "3.0.0-rc1-final",
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
"Microsoft.AspNet.Mvc": "6.0.0-rc1-final",
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-rc1-final",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
"Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final",
"Microsoft.AspNet.Tooling.Razor": "1.0.0-rc1-final",
"Microsoft.Extensions.CodeGenerators.Mvc": "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.FileProviderExtensions": "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.UserSecrets": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging.Console": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc1-final",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-rc1-final",
"Common.Utilities": "1.0.0.8-*"
}
it also creates a wrapper folder and copies the DLL to lib\dnx\451
folder.
How can we setup something similar to what we had before to support 2 build configurations?