Error in the compilation of assemblies and dependencies depending on which folder it is in

Case Number 1193928

@okcompute_unity @DanielTG You have detailed information with a complete isolated example.

Thanks.

Thanks for reporting a bug!

Pascal

@okcompute_unity I’ve looked into it a little more and I can give you some more clues.

C# compiler errors

I have some official nuget as UPM packages (using https://github.com/xoofx/UnityNuGet):

  • “AssemblyA.dll” 1.0 that depends on “AssemblyB.dll” >= 1.0.

If I put:

  • Assets/AssemblyA.dll (1.0)
  • Assets/AssemblyB.dll (1.1)

WORKS.

If I put them as packages:

  • Packages/com.package.a/AssemblyA.dll (1.0)
  • Packages/com.package.b/AssemblyB.dll (1.1)

COMPILATION ERRORS.

An example of those errors:

It seems that being on a package they are compilated with different flags by Unity and it’s forcing a specific version? I need to alter this and behave like Nuget packages where you rely on >= 1.0 and not == 1.0…

Were are heavily relying on UPM for our codebase and https://github.com/xoofx/UnityNuGet for Nuget dependencies so this is a big problem for us and a stopper gaving us a lot of headaches.

In fact, I attach an even stranger example with “System.IO.Pipelines” (4.6.0):

https://www.nuget.org/packages/System.IO.Pipelines/4.6.0

The project (in 2019.3.0b8) simply has the dependencies chain for “.NET Standard 2.0” distributed in UPM package format (no higher dependencies, exact dependencies).

If you later take all the dlls from those packages and leave them simply in Assets you’ll see that it compiles.

5111651–504620–test.zip (245 KB)

1 Like

@bdovaz These packages are not officially supported by Unity. I’ll let the community help you with this one. And you can probably also push an issue on UnityNuget repository to give you more visibility on the issue.

Regards,

Pascal

@okcompute_unity

Please take a moment to read my messages and replicate my bug report and my other project in the attached file. They are simply the official nuget assemblies packaged in UPM format (it’s the assembly with the package.json). If the assemblies in the assets folder work I don’t know why they don’t work when they are in UPM format. Please take the time to investigate the problem as it has nothing to do with that repository you mention, it is easily replicable.

The bug/problem it’s on Unity side.

Consider the time I have taken to prepare the two projects, replicate it easily and write it all down and don’t answer me that they are not Unity-supported packages and that the community will answer me. It is evident that they are not packages from Unity… I’m creating them from Nuget. I’m giving my feedback, I hope at least you do your job and give me an answer when you’ve taken the time to look at it please.

I believe this is a known limitation of UPM today that will fail on NuGet packages deployed as UPM that are relying on a >= version dependency instead of ==. There is currently no way to express such dependencies with UPM

@okcompute_unity @xoofx

My compilation problem has to do with what folder the assemblies are in. If they are all in the same folder it works perfectly, otherwise those errors come out. I have prepared a very basic project just with that and you can try.

5113808–504809–test.zip (201 KB)