Why would adding this to my .csproj file:

<UsingTask TaskName="NUnit" AssemblyFile="$(teamcity_dotnet_nunitlauncher_msbuild_task)"/>
  <Target Name="Test" DependsOnTargets="Build">
    <CreateItem Include="bin\$(Configuration)\*.Tests.dll">
      <Output TaskParameter="Include" ItemName="TestAssemblies" />
    <NUnit Assemblies="@(TestAssemblies)"/>

Cause this to happen?

Microsoft Visual Studio
Unable to read the project file 'Alpha.Modules.Sam.Tests.csproj'.

C:\development\Alpha\core\src\Tests\Alpha.Modules.Sam.Tests\Alpha.Modules.Sam.Tests.csproj(99,31): The result "" of evaluating the value "$(teamcity_dotnet_nunitlauncher_msbuild_task)" of the "AssemblyFile" attribute in element <UsingTask> is not valid.

I thought I'd make a straight cut-and-paste from here:

1 comment
Comment actions Permalink

That assembly is only defined when the build is running under TeamCity started msbuild script ( by sln2005, sln2008 and msbuild runners).

To make script workable outside TeamCity you will have to add Condition attributes to all parts that rely on TeamCity.

Like: <NUnitTeamCity ... Condition=" "'$(TEAMCITY_VERSION' != '' "" />



Please sign in to leave a comment.