I'd like to customize the UnitTest project template for Visual Studio 2013: We use Moq very often in UnitTest projects, hence I think it should be automatically referenced.
In C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\ProjectTemplates\CSharp\Test\1033\UnitTestProject
, I edited UnitTestProject.csproj
by adding a reference section and an ItemGroup:
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
...
<Reference Include="Moq, Version=4.2.1510.2205, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
<HintPath>..\packages\Moq.4.2.1510.2205\lib\net40\Moq.dll</HintPath>
<Private>True</Private>
</Reference>
Then I added the file packages.config to that folder, and edited UnitTestProject.vstemplate
by adding
<ProjectItem ReplaceParameters="false" TargetFileName="packages.config">packages.config</ProjectItem>
to the Project section.
But when I create a new UnitTest project, I get the error message
The file packages.config could not be found within the project templates. Continuing to run, but the resulting project may not build properly.
After clicking OK, another error message follows:
Unable to copy the file 'packages.config' from the project template to the project. Cannot find file "(%TEMP%\some folder)\packages.config'.
How can that be solved?