I am using Unity 2017.3.0f3 and VS 2017 (ver. 15.5.2) with 4.6 .NET enabled.
When I am trying to use some classes from namespace System.Net.Http Visual Studio telling me that “The type or namespace Http does not exists in namespace System.Net”. I tried to add reference directly in *.csproj and it worked fine but - after opening solution again - it is removed. What’s more regarding namespace System - I observed that in csproj there are only references like this: <Reference Include="mscorlib"> <HintPath>D:\Program Files\Unity\Edito - Pastebin.com . The same issue is with System.ServiceModel namespace and others.
I have no idea how to add other references.
What I’m doing wrong ? It looks like VS see only some libs from …lib\mono\4.6-api directory.
The .csproj files generated by Unity are for output only. Unity never reads them to determine how to build things, so you want to avoid modifying them. Instead, create a file named mcs.rsp in the Assets directory of your Unity project, and add the references there, like this:
When you add the mcs.rsp file to your project, does the error message change at all? Can you provide the specific error message that you see in that case?
Hi, I am using 2018.1 unity version I got some error when I add some plugin error CS1070: The type System.Net.Http.HttpClient' has been forwarded to an assembly that is not referenced. Consider adding a reference to assembly System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’
after that I create mcs.rsp file and put it inside the asset folder in the mcs.rsp file I added -r:System.Net.Http.dll this line but I got the same error please help me out.
Yes, that mcs.rsp or csc.rsp file should be in the Assets directory. Note that mcs.rsp will definitely not work, based on your other settings, the file must be named csc.rsp.
I have the same problem when trying to use System.IdentityModel.Tokens.Jwt. I’ll try to create that file. It has support for .net 4 up to 6, But when has run the command dotnet --info no vscode it says I’m using version 7.x.x I tried to change it to some 6.x.x version, but It didn’t work.