I am doing some experiments in an uncommon stack. I have a .NET solution which is a mixture of .NET Standard, Core and regular .NET Framework projects. Both VS, framework and tooling are updated to latest available.
I'd like to use gitlab CI with a docker runner over ubuntu.
Before I introduced Core/Net Standard libraries (xprojs), I was able to build my solution by executing
MONO_IOMAP=case xbuild /t:Build /p:Configuration="Release" /p:Platform="Any CPU" ./src/CoreLibrary/CoreLibrary.sln
, but since that, I keep getting the
could not import "$(VSToolsPath)\DotNet\Microsoft.DotNet.Props"
error for all of my xprojs. Although I am able to build the xprojs with dotnet restore
and dotnet build
, the rest only can be built with xbuild. Right now I have two solutions to be able to build the non-xbuilds on linux separately to avoid the error. Is this the best I can do? Can somebody give me a hint on how to do this properly?
Update
To simplify things, let's say I have two projects within a solution: a .NET Core Library project targeting netstandard1.4 (xproj) and the same old .NET Console Application targeting .NET Framework 4.6.1 (csproj). The console application has a dependency to the netstandard library.
From Visual Studio, I am able to build the solution without any problem, both the projects get built properly. From my windows machine, I can use the dotnet utility tool
as well to build/run xprojs. All works fine.
In my ubuntu based container though, mono is not capable to build the solution, it shows the error above (sounds reasonable, no VS installed there). I am only able to first build the xproj by using the properly working dotnet utility tool
and have a separate solution file which does not contain the xprojs, only the console application and build it with xbuild.
My main concern (over the fact that this isn't a convenient solution) is that if a bug in VS gets fixed which makes it impossible at the moment to add references to xprojs from csprojs as project reference, I will not be able to use it since my csproj projects will need to be separated.