Realm-dotnet: MSBuild task fail to copy Fody on TFS agent build

Created on 2 Jun 2017  路  9Comments  路  Source: realm/realm-dotnet

I'm traying to build the app every time I make a Check In to source control.
The build breaks when Realm Task tries to copy the Fody dll to Tools directory.

Goals

Make continous integration of a Xamarin App

Expected Results

Build completes sucessfully

Actual Results

Fail with this log line:

CopyRealmWeaver:
  CopyRealmWeaver
  Creating directory "*Undefined*Tools".
1-Development\packages\Realm.Database.1.4.0\build\Realm.Database.targets(28,5): Error MSB3021: Unable to copy file "d:\a\3\s\1-Development\packages\Realm.Database.1.4.0\build\..\tools\RealmWeaver.Fody.dll" to "*Undefined*Tools\RealmWeaver.Fody.dll". Illegal characters in path.

Steps to Reproduce

Create build definition within VisualStudio Online or TFS and try to build

Code Sample

There is no especific code since the problem ocurrs on nuget MSBUILD file.

T-Doc

Most helpful comment

You need to provide /p:SolutionDir=/path/to/solution/folder. Here's a blog post on building with VSTS that will probably be helpful.

All 9 comments

You need to provide /p:SolutionDir=/path/to/solution/folder. Here's a blog post on building with VSTS that will probably be helpful.

I'll leave the issue open as a reminder to document that in the Q&A section of the docs.

we still face the same issue and this blog answer not working

Then it's unlikely to be the same issue. Please open a new one and provide information about your specific use case.

C:UsersVssAdministrator.nugetpackagesrealm.database3.1.0buildRealm.Database.targets(28,5): Error MSB3021: Unable to copy file "C:UsersVssAdministrator.nugetpackagesrealm.database3.1.0build..toolsRealmWeaver.Fody.dll" to "UndefinedToolsRealmWeaver.Fody.dll". Illegal characters in path.

Process 'msbuild.exe' exited with code '1'.
that is the error showing up , I think its the same one

I found that adding a property group to your csproj files worked for my web app. You will also need to add it to your test projects too.

<PropertyGroup>
    <SolutionDir>..\</SolutionDir>
</PropertyGroup>

https://github.com/Fody/Fody/issues/346#issuecomment-317375798

Neither

"/p:SolutionDir=Tools/" or "/p:SolutionDir=src/Tools/" on Additional Arguments

or

PropertyGroup + SolutionDir

does't work on solutions with deep structure, e.g. with submodules.

yea you need to specify where exactly tools folder exist in your project (most properly will be in the root ) and add this path in Additional arguments
here is screenshot
ScreenShot

In the yml file on Azure DevOps this work for me:

  • task: XamariniOS@2
    inputs:
    solutionFile: '*/iOS.csproj'
    args: '/p:SolutionDir=../'
    configuration: 'Release'
    buildForSimulator: true
    packageApp: false
Was this page helpful?
0 / 5 - 0 ratings