1
votes

When trying to update protobuf-net to 2.3.0 via Visual Studio 2017's NuGet package manager for a UWP solution, I get the following error:

System.Reflection.Emit.Lightweight 4.3.0 provides a compile-time reference assembly for System.Reflection.Emit.Lightweight on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-arm-aot. System.Reflection.Emit.ILGeneration 4.3.0 provides a compile-time reference assembly for System.Reflection.Emit.ILGeneration on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-arm-aot.

This also occurs for x86 and x64.

Any ideas on how to resolve this are much appreciated!

1
Short term, I can probably make a UWP-enabled lib by changing some build symbols - it won't work super fast, but it'll work. Long term, I need to solve compile-time codegen. I don't have either of those today (although the code without IL-emit exists for use on restricted platforms - I just haven't targeted in for UWP specifically)Marc Gravell♦
That would be great! The reason I was trying to upgrade was because I am facing the same issue found here: link Would it be best to start a new question on that issue specifically? I realize my case is a bit different as it's for UWP, not Xamarin.Coopra
@Coopra I am not able to repro this. I was able to successfully install protobf-net 2.3.0 in a UWP project in VS2017. Can you provide a project where this repros or steps to get into the state you are in.karann - MSFT
@karann-MSFT I can repro this by creating a blank UWP project in VS2017 that has its max-tested and minimum target versions set to 14393. Attempting to install fails with the error message posted in my question. This also occurs for versions 2.3.1 and 2.3.2 that have been released since my question.Coopra

1 Answers

0
votes

You have two options:

  1. Migrate to package reference - you can do this easily by changing your platform Target Version to 15063. You'll see a message tell you, doing this breaks compat with VS 2015. Say, yes. You can then change back to 14393.
  2. Edit project.json - remove the following entries from runtimes:
    • win10-arm-aot
    • win10-x86-aot
    • win10-x64-aot