The Alloy project has a number of automation steps that are invoked when the project is built. Unfortunately these steps are conflicting with NuGet and needs to be removed:
Remove <ReferencePath /> element.
<PropertyGroup>
<ReferencePath Condition="'$(ReferencePath)' == ''">[Libraries]\EPiServer</ReferencePath>
</PropertyGroup>
Remove automatic copying of EPiServer binaries done in the post build element.
copy "$(ProjectDir)[Libraries]\EPiServer\*.dll" "$(TargetDir)" /y
Remove automatic configuration transforms done in the post build element by taking out the following lines:
$(MSBuildBinPath)\msbuild.exe "$(ProjectDir)[MSBuild]\CommonConfigTransforms.xml"
$(MSBuildBinPath)\msbuild.exe "$(ProjectDir)[MSBuild]\BuildSpecificConfigTransforms.xml" /p:Configuration=$(ConfigurationName)
$(MSBuildBinPath)\msbuild.exe "$(ProjectDir)[MSBuild]\DeleteTempConfigFiles.xml"
Note If you want to apply the EPiServer.Search package you also need to remove the EPiServer.IndexingService.dll from [libraries]\EPiServer in the visual studio project otherwise it will get priority when msbuild is resolving references and you will not get the desired assembly version in the bin folder.