bitcraftCoLtd / protobuf3-for-unity

Google Protocol Buffers runtime library version 3 for Unity (targeting .NET 3.5)
Other
333 stars 57 forks source link

The reference assemblies for framework ".NETFramework,Version=v3.5" were not found. #6

Open IARI opened 7 years ago

IARI commented 7 years ago

On Windows 10 with .NET Core installed, when I run build_packages.bat i get the following error:

  Google.Protobuf -> D:\github\protobuf3-for-unity\src\Google.Protobuf\bin\Release\net45\Google.Protobuf.dll
C:\Program Files\dotnet\sdk\1.0.1\Microsoft.Common.CurrentVersion.targets(1111,5): error MSB3644: The reference assemblies for framework ".NETFramework,Version=v3.5" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend. [D:\github\protobuf3-for-unity\src\Google.Protobuf\Google.Protobuf.csproj]

I'm thinking, the problem could be related to https://github.com/Microsoft/msbuild/issues/1333

I'm rather new to dotnet, so I don't know how to move on. Is there any chance to get precompiled dll's that work?

chazix commented 7 years ago

I believe the root of the problem is that .net core's current release isn't compatible with the state of this build. To solve this I installed an older version of .net core : https://github.com/dotnet/core/blob/master/release-notes/download-archives/1.1-preview2.1-download.md

TanukiSharp commented 7 years ago

Hello @IARI, sorry for the late reply.

As a quick workaround, you can add a file named global.json in the root folder of the solution (beside the build_packages.bat file) that contains the following:

{
    "sdk": {
        "version": "1.0.0-preview2-003156"
    }
}

Note that you need the .NET Core SDK preview 2 (3156) installed on your machine, you can check this in %DOTNET_CORE_INSTALL_FOLDER%\sdk and you should have a folder named 1.0.0-preview2-003156.

The .NET Core install folder should be in C:\Program Files\dotnet if you didn't change it.

Let me know if this helps you to get it compile, and in the meantime I will upload a prebuilt library.

EDIT: I just figured out there is already a prebuilt available here: https://github.com/bitcraftCoLtd/protobuf3-for-unity/releases/tag/v3.0.0_ga_noJIT

Is it enough ? Please let me know if you need something else.

joelharkes commented 7 years ago

Same issue using 1.0.3 SDK

I found you can use msbuild /p:TargetFramework=net35 **.csproj

to build for net35 framework

TanukiSharp commented 7 years ago

It's hard to keep up with the pace Microsoft are releasing previews and changes they introduce each time. I'd rather wait for the tooling to get stable (and especially for Unity to adopt .NET Standard 2.0) before fixing the build process.

In the meantime, if you don't mind please use the prebuilt binaries available in the zip of the download section.

Let me know if there is something else you guys need.

Thanks.