title: How do I solve error MSB4041 (VS2017, C#, MSBuild, SpecFlow.Tools.MsBuild.Generation, SpecRun)?
body: <p>I have an automation test suite, attempting to use SpecRun to run tests in parallel. It appears that rather than being able to run tests in Test Explorer, I need to instead run them using the provided "runtests.cmd" file...</p>
  
  <pre><code>@pushd %~dp0
  
  @where /q msbuild
  
  @IF ERRORLEVEL 1 (
      echo "MSBuild is not in your PATH. Please use a developer command prompt!"
      goto :end
  ) ELSE (
      MSBuild.exe "C:\Users\me\source\repos\OurAutomation\src\OurAutomation.csproj"
  )
  
  @if ERRORLEVEL 1 goto end
  
  @cd ..\packages\SpecRun.Runner.*\tools\net45
  
  @set profile=%1
  @if "%profile%" == "" set profile=Default
  
  @if exist "%~dp0\bin\Debug\%profile%.srprofile" (
      SpecRun.exe run "%profile%.srprofile" --baseFolder "%~dp0\bin\Debug" --log "specrun.log" %2 %3 %4 %5
  ) else (
      SpecRun.exe run --baseFolder "%~dp0\bin\Debug" --log "specrun.log" %2 %3 %4 %5
  )
  
  :end
  
  @popd
  
  pause
  </code></pre>
  
  <p>...the pause statement is something I added in to keep the console open to see the errors.</p>
  
  <p>The errors are:</p>
  
  <pre><code>Microsoft (R) Build Engine version 4.7.3056.0
  [Microsoft .NET Framework, version 4.0.30319.42000]
  Copyright (C) Microsoft Corporation. All rights reserved.
  
  Build started 08/07/2019 11:15:06.
  Project "C:\Users\me\source\repos\OurAutomation\src\OurAutomation.csproj" on node 1 (defau
  lt targets).
  C:\Users\me\source\repos\OurAutomation\src\packages\SpecFlow.Tools.MsBuild.Generation.3.0.220\build\Sp
  ecFlow.Tools.MsBuild.Generation.props(1,1): error MSB4041: The default XML namespace of the project must be the MSBuild
   XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="http://schemas.microsoft.com/d
  eveloper/msbuild/2003" to the &lt;Project&gt; element. If the project has been authored in the old 1.0 or 1.2 format, please
  convert it to MSBuild 2003 format. [C:\Users\me\source\repos\OurAutomation\src\OurAutomati
  on.csproj]
  Done Building Project "C:\Users\me\source\repos\OurAutomation\src\OurAutomation.csproj" (d
  efault targets) -- FAILED.
  
  
  Build FAILED.
  
  "C:\Users\me\source\repos\OurAutomation\src\OurAutomation.csproj" (default target) (1) -&gt;
    C:\Users\me\source\repos\OurAutomation\src\packages\SpecFlow.Tools.MsBuild.Generation.3.0.220\build\
  SpecFlow.Tools.MsBuild.Generation.props(1,1): error MSB4041: The default XML namespace of the project must be the MSBui
  ld XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="http://schemas.microsoft.com
  /developer/msbuild/2003" to the &lt;Project&gt; element. If the project has been authored in the old 1.0 or 1.2 format, pleas
  e convert it to MSBuild 2003 format. [C:\Users\me\source\repos\OurAutomation\src\OurAutoma
  tion.csproj]
  
      0 Warning(s)
      1 Error(s)
  
  Time Elapsed 00:00:00.02
  </code></pre>
  
  <p>I've set the system environment variable PATH to look for MSBuild.exe in C:\Windows\Microsoft.NET\Framework\v4.0.30319 (this is the latest version I have).</p>
  
  <p>I tried to do as the error suggested, and found that both OurAutomation.csproj and OurAutomation.csproj.user files already have:</p>
  
  <pre><code>&lt;Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;
  </code></pre>
  
  <p>So that's the simple fix out of the way - no fix at all, because the Project tag already has the required attribute and value!</p>
  
  <p>I've been on several websites looking for an alternative solution. Others are saying that they had this problem when upgrading from VS2015 to 2017 (they changed from using project.json to *.csproj). However I have not upgraded. I created my project in VS2017. Target framework: .NET Framework 4.7.2, Output type: Class Library.</p>
  
  <p>Not sure if SpecFlow.Tools.MsBuild.Generation is introducing a conflict here, but I do need it.</p>
  
  <p>Please do you know how I would go about fixing this? Running out of ideas.</p>
  
  <p>Thank you.</p>