0

enter image description hereI want to build my solution file in azure devops. I have added this to build pipeline, I see this step doesn't succeed. It tells " MSBUILD : error MSB1008: Only one project can be specified." I suspect I am making some mistake in specifyning msbuild args

msbuild $(Build.SourcesDirectory)\ansysfnonet\ansysfnonet.vs2017.sln /t:$(Build.SourcesDirectory)\ansysfnonet\ansysfnonet.csproj:Rebuild;

I tried specify only proj file as msbuild arg it didn't work for me

I tried without specifying msbuild it throws me whole lot of errors.

Someone please help me , why I am failing in this step and how to solve this error.

Thanksenter image description here

karansys
  • 2,449
  • 7
  • 40
  • 78
  • For `.net core` project, we often recommend to use `dotnet restore` instead of using `nuget restore` in Azure Devops. You can convert your solution into an answer then accept it, thus other SO users could refer to that solution:-) – Mengdi Liang Oct 30 '19 at 08:26

1 Answers1

1

You don't need to specify an msbuild command line in the MSBuild Arguments field. You need to specify any additional MSBuild parameters beyond the defaults.

Clear that field. That should fix the problem you're encountering.

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
  • Thanks Daniel, I removed th msbuild args when I run the build – karansys Oct 24 '19 at 10:20
  • ansysfnonet\FNOServices.cs(22,17): Error CS0234: The type or namespace name 'Extensions' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) ansysfnonet\FNOServices.cs(165,28): Error CS0246: The type or namespace name 'IOptions<>' could not be found (are you missing a using directive or an assembly reference?) – karansys Oct 24 '19 at 10:20
  • Note : Visual studio adds some folders like debug, .vs, then this error seems to disappear, I am not sure what these folders – karansys Oct 24 '19 at 10:23
  • I am new to visual studio, I guess it imports some library – karansys Oct 24 '19 at 10:23
  • You need to do a nuget restore before you build. – Daniel Mann Oct 24 '19 at 10:23
  • I added nuget restore before I start visual studio builder in the pipeline, The nuget command failed with exit code(1) and error(Errors in C:\agent1\_work\1\s\ansysfnonet\ansysfnonet.csproj Package Microsoft.Extensions.Options 2.1.1 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package Microsoft.Extensions.Options 2.1.1 supports: netstandard2.0 (.NETStandard,Version=v2.0) One or more packages are incompatible with .NETCoreApp,Version=v2.0.) Packages failed to restore – karansys Oct 24 '19 at 10:27
  • Hi Daniel, thank you so much instead of nuget restore I used dotnet restore that made the build sucessful – karansys Oct 24 '19 at 10:38