-
Notifications
You must be signed in to change notification settings - Fork 27
protobuf-net mscorlib references cause warnings #2
Comments
protobuf-net 447: protobuf-net.2.0.0.668\lib\net40\protobuf-net.dll should target v4.0.30319, not v2.0.50727 |
@ctaggart you can get rid of the warnings by using the DesktopAssemblyIdentityComparer.Default (an example of how to use it is in this LinqPad script which was used to get all the stuff below). The generated IL is different though: public static class Program
{
public static void Main()
{
using (var ms = new System.IO.MemoryStream())
{
ProtoBuf.Serializer.Serialize(ms, new {a = 1});
}
}
} The csc.exe generates the following IL (irrelevant stuff omitted)
Roslyn generates the following IL, without the v2 mscorlib reference:
I haven't found a way to make it reference both mscorlib versions at once. And it gets weirder when PCLs are in play. |
This Froto project is going to take a new direction. Protocol Buffers v3 support C# code generation out of the box and it is supported via a |
Froto.Roslyn is a .NET 4.5 project. Using the latest protobuf-net, version 2.0.0.668, for nuget, it adds the dll from
net40
. Unfortunately, it looks to be compiled for .NET 3.5.Roslyn emit then complains about mscorlib 3.5 missing from my system.
If I switch to use the dll from the
net20
, emit is successful, but I get a bunch of warnings.How do I get rid of these warnings?
The text was updated successfully, but these errors were encountered: