-1

We are building a web API application for a Xamarin forms app. I included a .NET standard class library project to use as my view models. The idea being as we build out the web api endpoints - I will publish the updated class library to our internal NuGet server.

Our CI is failing. When I check in the code - I am getting a build error (using TFS 2015 on premise). The first error I received was

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/developer/msbuild/2003" to the element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format.

So I added the XML namespace to the csproj

Now I get this:

There is no target in the project.

JDBennett
  • 1,323
  • 17
  • 45

2 Answers2

0

Which version of Visual Studio do you use? Can you build the project locally with VS or build with msbuild in command line?

Anyway, based on the error message, it seems related to the version of VS which created the project and the msbuild version (New .csproj project format applied in VS 2017). You can reference below threads to troubleshoot the issue:

For the first error:

For the second error:

  • Visual Studio 2010 Project Targets

    Add the following attribute to the Project element:

    DefaultTargets="BuildTarget"

    That will tell MSBuild to use the target named "BuildTarget" when we do a build. Next add the following subelement to the Project element (just before the last line, which has "</Project>"):

    <Target Name="BuildTarget"> <Message Text="Build selected" Importance="high"/> </Target>

    Then save the file and close the edit window. Then return to the Solution Explorer and right-click on the solution and select "Reload Project". Then build the project. You should get the message "Build selected" along with the output of the build, as in:

Andy Li-MSFT
  • 28,712
  • 2
  • 33
  • 55
  • This is our CI server (TFS 2015 on premise). It builds fine for me locally (VS 2017). I guess my question is more specifically can TFS 2015 build a .NET standard class library project? – JDBennett Aug 15 '17 at 12:37
  • @JDBennett You can try to install VS 2017 on your build agent server, then use MSBuild task instead of Visual Studio Build Step, then specify the location of MSBuild 15.0. Check if that works for you, Reference: https://stackoverflow.com/questions/42689384/how-to-use-visual-studio-2017-with-tfs-visual-studio-build-step – Andy Li-MSFT Aug 16 '17 at 13:01
  • I haven't been able to try it yet - but I will soon. I will add the results once I get 2017 installed. – JDBennett Aug 31 '17 at 14:40
0

So answer is not possible. I have tried install VS 2017 on the agent - that didn't work.

We did find an article that TFS needed to be upgraded beyond Update 3.

I will end up upgrading us to 2017 in a few months - which will make this a moot point.

Thanks for the answers.

JDBennett
  • 1,323
  • 17
  • 45