Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

459
Visualizações
How to add a missing assembly reference for xbuild? (Mono/Linux)

We have a C# project that builds perfectly well in Visual Studio on Windows and in TeamCity.

I try to build it like this on Linux, using Mono's xbuild:

MONO_IOMAP=case xbuild BuildAll.sln

The build fails, with 2 warnings and 7 errors, all of them about XmlDiffPatch.

The warnings:

/usr/lib/mono/4.5/Microsoft.Common.targets:  warning : Reference 'XmlDiffPatch, Version=1.0.8.28, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' not resolved

The errors:

***REDACTED***: error CS0234: The type or namespace name `XmlDiffPatch' does not exist in the namespace `Microsoft'. Are you missing an assembly reference?

There are a couple of .cs files with

using Microsoft.XmlDiffPatch;

I have this in a .csproj file:

  <ItemGroup>
    <Reference Include="nunit.framework, Version=2.6.2.12296, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Security" />
    <Reference Include="System.Xml" />
    <Reference Include="XmlDiffPatch, Version=1.0.8.28, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
  </ItemGroup>
  ...
  <ItemGroup>
    <None Include="lib\XmlDiffPatch.dll" />
  </ItemGroup>

I have confirmed that a file lib\XmlDiffPatch.dll indeed exists.

The project has several modules (sorry, I don't know the exact .NET parlance, I come from a Java/Maven background) and the warnings/errors only occur in the modules that have a lib directory.

What do I need to do, to make this project build on Linux with Mono? My best guess is that the .csproj files are missing something so they cannot find the required .dll.

I looked at similar questions but they essentially say "just add a reference" without explaining how to do that on Linux. I don't have a "solutions explorer" or anything.

I should add that I am not using monodevelop, this is all console and editing files with vi.

I would also like to add that any changes to .csproj or other files should still be compatible with Windows.

EDIT

I don't know if it is helpful, but I noticed that the required version of XmlDiffPatch is also available on NuGet. Our C# project currently does not use NuGet at all, but I am certainly open for suggestions - as long as it only requires editing files on Linux and it will automagically work in Visual Studio after the Windows devs pull my commit.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

You can add a HintPath to the .csproj so when MSBuild/xbuild passes the assembly references to csc/mcs it will be found:

<Reference Include="XmlDiffPatch, Version=1.0.8.28, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" >
 <HintPath>lib\XmlDiffPatch.dll</HintPath>
</Reference>

Note: Edit the path so it is found relative to where the .csproj is located at (assuming the lib directory from your question).

https://msdn.microsoft.com/en-us/library/bb629388.aspx

HintPath | Optional string. | Relative or absolute path of the assembly.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda