Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

[2018.1.0b2][netstandard2.0] Ambigous Reference

Discussion in 'Experimental Scripting Previews' started by Nothilvien, Jan 11, 2018.

  1. Nothilvien

    Nothilvien

    Joined:
    Jun 11, 2013
    Posts:
    10

    I think this is caused because netstandard has the same stuff as other already referenced assemblies.

    Can the assembly references that overlap with netstandard be removed or any way to solve this?

    Thanks ! (Great work getting netstandard available!)
     
  2. joncham

    joncham

    Unity Technologies

    Joined:
    Dec 1, 2011
    Posts:
    276
    Do you have any more details on how you got into this state? What profile are you targeting in the player settings?
     
  3. Nothilvien

    Nothilvien

    Joined:
    Jun 11, 2013
    Posts:
    10


    Scripting Runtime Version: Experimental (.Net 4.6)
    Scripting Backend: Mono
    Api Compatibility Level: .Net Standard 2.0

    I get this error in 'Jet Brains Rider 2017.3'



     
    Last edited: Jan 11, 2018
  4. Schodemeiss

    Schodemeiss

    Joined:
    Jan 4, 2018
    Posts:
    43
    I was trying these settings and I get the same issue.

    I thought maybe I was missing an extension for Visual Studio? I also checked the documentation but it's rather out of date regarding runtime and APIs.

    Is this actually just a problem with the assembly references?

    Also, does it matter if I use Nothivilians setup with with IL2CPP rather than Mono. What does this actually mean??
     
  5. joncham

    joncham

    Unity Technologies

    Joined:
    Dec 1, 2011
    Posts:
    276
    In the case of Visual Studio, you will want to make sure you are using VS 2017 version 15.5.3. You can update via Tools->Extensions and Updates...
     
  6. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,053
    I have the same problem as @Nothilvien (in my case it happens on LINQ methods) and I already have 15.5.3 version.

    It seems that it's a problem on Unity VS Tools when generating solution and projects files.

    Unity compiles correctly but on Visual Studio it messes up project references and we get compilation errors regarding ambiguous references.
     
  7. Nothilvien

    Nothilvien

    Joined:
    Jun 11, 2013
    Posts:
    10
    Last edited: Jan 15, 2018
  8. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    On my machine VSTU 3.6.0.1 works randomly in 2018.1b2. Sometimes it works, sometimes doesn't, and I don't understand the pattern.

    1. Here is a new project with a single Foo.cs script inside, Runtime - Net 4.6, API - Net 4.6. Initial state:
    1.png

    2. After opening it in Unity 2018.1b2:
    2.png
    VSTU works.

    3. After closing Unity and deleting unnecessary files and folders:
    3.png

    4. After opening it in Unity 2018.1b2 again:
    4.png
    VSTU doesn't work.

    5. And after doing the same once more:
    5.png
    Magically it works again!
     
  9. joncham

    joncham

    Unity Technologies

    Joined:
    Dec 1, 2011
    Posts:
    276
    You will want to be using VS 2017. I don't think VSTU will be updated in 2015 for Unity 2018.1
     
  10. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    I actually do use VS 2017. Mostly 15.6 Preview. Should I switch back to 2017 15.5?
     
  11. van800

    van800

    JetBrains Employee

    Joined:
    May 19, 2016
    Posts:
    73
    MechEthan likes this.
  12. z00n

    z00n

    Joined:
    Nov 24, 2009
    Posts:
    44
    This error strikes again in 2018.1.0b6, when project references `…2018.1.0b6\Editor\Data\NetStandard`. The issue is that MSBuild always removes all hinted references to System.Core.dll and inserts the reference to System.Core.dll from the installed .Net framework.

    This might be fixed once and for all by clearing 'AdditionalExplicitAssemblyReferences' property at the very end of the project file.

    Code (XML):
    1.   ...
    2.   <PropertyGroup>
    3.     <AdditionalExplicitAssemblyReferences />
    4.   </PropertyGroup>
    5. </Project>

    http://msbuildlog.com/
     
    goncalo-vasconcelos and CriDos like this.
  13. recursive

    recursive

    Joined:
    Jul 12, 2012
    Posts:
    669
    I have this exact issue! I posted it in the 2018.1 forum, since I didn't see this thread earlier. I already reported it: Case number is 996937. It happens with VS Code / Visual Studio on all my tested machines.

    I haven't had the opportunity to test agains b7 yet.
     
  14. joncham

    joncham

    Unity Technologies

    Joined:
    Dec 1, 2011
    Posts:
    276
    This should all be fixed in soon to be released b10.
     
    z00n and recursive like this.