.Net Core Web Api project build fails on CLI


#1

Hello,
I get an error when I add Realm NuGet package to Web API (.Net Core 2.1) project and build it on command line tool (dotnet build). Building the project in Visual Studio 2017 (15.8.7) works fine.

Error messages:

C:\Users\Raif Hairulla\.nuget\packages\realm.database\3.2.1\build\Realm.Database.targets(28,5): 
error MSB3027: Could not copy "C:\Users\Raif Hairulla\.nuget\packages\realm.database\3.2.1\build\..\tools\RealmWeaver.Fody.dll" 
to "*Undefined*Tools\RealmWeaver.Fody.dll". Exceeded retry count of 10. Failed.  
[C:\Users\Raif Hairulla\Source\Repos\webapitest\webapitest\webapitest.csproj]

C:\Users\Raif Hairulla\.nuget\packages\realm.database\3.2.1\build\Realm.Database.targets(28,5): 
error MSB3021: Unable to copy file "C:\Users\Raif Hairulla\.nuget\packages\realm.database\3.2.1\build\..\tools\RealmWeaver.Fody.dll" 
to "*Undefined*Tools\RealmWeaver.Fody.dll". The filename, directory name, or volume label syntax is incorrect : 
'C:\Users\Raif Hairulla\Source\Repos\webapitest\webapitest\*Undefined*Tools' 
[C:\Users\Raif Hairulla\Source\Repos\webapitest\webapitest\webapitest.csproj]

Does anyone know what’s the problem and how to fix it?

I tried to add

<SolutionDir>..\</SolutionDir>

to project file, but it didn’t help. Also tried to run it as Admin.