Search Unity

Predefined type 'System.Object' is not defined or imported

Discussion in 'AR/VR (XR) Discussion' started by Link2011, Sep 6, 2017.

  1. Link2011

    Link2011

    Joined:
    Sep 6, 2017
    Posts:
    4
    Tried to follow the Microsoft Hololense Tutorial but always get 10k-20k Errors where it says:
    "xx" is not defined or imported
    or
    The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

    For examples check the Box.
    Can someone help me?

    (Copy paste, using Visual Studio in german so the output is german too)
    Code (CSharp):
    1. Schweregrad    Code    Beschreibung    Projekt    Datei    Zeile    Unterdrückungszustand
    2. Fehler    CS0012    Der Typ "ValueType" ist in einer nicht referenzierten Assembly definiert. Fügen Sie einen Verweis auf die Assembly "System.Runtime, Version=4.0.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" hinzu.    Assembly-CSharp    C:\DevProjects\MRBeans\Assets\HoloToolkit-Examples\GazeRuler\Scripts\LineManager.cs    137    Aktiv
    3. Fehler    CS0518    Der vordefinierte Typ "System.ValueType" ist nicht definiert oder importiert.    Assembly-CSharp    C:\DevProjects\MRBeans\Assets\HoloToolkit-Examples\GazeRuler\Scripts\LineManager.cs    137    Aktiv
    4. Fehler    CS0518    Der vordefinierte Typ "System.Object" ist nicht definiert oder importiert.    Assembly-CSharp    C:\DevProjects\MRBeans\Assets\HoloToolkit-Examples\GazeRuler\Scripts\LineManager.cs    137    Aktiv
    5. Fehler    CS0518    Der vordefinierte Typ "System.Void" ist nicht definiert oder importiert.    Assembly-CSharp    C:\DevProjects\MRBeans\Assets\HoloToolkit-Examples\GazeRuler\Scripts\LineManager.cs    137    Aktiv
    6. Fehler    CS0518    Der vordefinierte Typ "System.ValueType" ist nicht definiert oder importiert.    Assembly-CSharp    C:\DevProjects\MRBeans\Assets\HoloToolkit-Examples\GazeRuler\Scripts\LineManager.cs    139    Aktiv
    7. Fehler    CS0518    Der vordefinierte Typ "System.Object" ist nicht definiert oder importiert.    Assembly-CSharp    C:\DevProjects\MRBeans\Assets\HoloToolkit-Examples\GazeRuler\Scripts\LineManager.cs    139    Aktiv
    8. Fehler    CS0518    Der vordefinierte Typ "System.Void" ist nicht definiert oder importiert.    Assembly-CSharp    C:\DevProjects\MRBeans\Assets\HoloToolkit-Examples\GazeRuler\Scripts\LineManager.cs    139    Aktiv
    9. Fehler    CS0518    Der vordefinierte Typ "System.Single" ist nicht definiert oder importiert.    Assembly-CSharp    C:\DevProjects\MRBeans\Assets\HoloToolkit-Examples\GazeRuler\Scripts\LineManager.cs    141    Aktiv
    10. Fehler    CS0518    Der vordefinierte Typ "System.Void" ist nicht definiert oder importiert.    Assembly-CSharp    C:\DevProjects\MRBeans\Assets\HoloToolkit-Examples\GazeRuler\Scripts\LineManager.cs    141    Aktiv
    11. Fehler    CS0234    Der Typ- oder Namespacename "Generic" ist im Namespace "System.Collections" nicht vorhanden. (Möglicherweise fehlt ein Assemblyverweis.)    Assembly-CSharp    C:\DevProjects\MRBeans\Assets\HoloToolkit-Examples\GazeRuler\Scripts\MeasureManager.cs    7    Aktiv
    12. Fehler    CS0012    Der Typ "Object" ist in einer nicht referenzierten Assembly definiert. Fügen Sie einen Verweis auf die Assembly "System.Runtime, Version=4.0.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" hinzu.    Assembly-CSharp    C:\DevProjects\MRBeans\Assets\HoloToolkit-Examples\GazeRuler\Scripts\MeasureManager.cs    18    Aktiv
    13.  
     
    julenka likes this.
  2. SiliconDroid

    SiliconDroid

    Joined:
    Feb 20, 2017
    Posts:
    302
    Hi, try putting this at the top of your .cs file:

    Code (CSharp):
    1. using System;
     
  3. Link2011

    Link2011

    Joined:
    Sep 6, 2017
    Posts:
    4
    I had it there, but VS didn't used it. Needed to disable and reenable the Nuget packeges, so it whould (re)download it, then it worked.
     
    julenka likes this.
  4. nilsubimax

    nilsubimax

    Joined:
    Apr 3, 2017
    Posts:
    17
    Could you outline what exactly you did when you "disable and reenable the Nuget packeges"? Having the same issue and everything that I thought could be meant by that did not help :/
     
  5. vipin8169

    vipin8169

    Joined:
    Jul 10, 2015
    Posts:
    1
    I am facing the same problem, hope you had elaborated on how to disable and re-enable nuget packages :/
     
  6. DarkGate

    DarkGate

    Joined:
    Jan 26, 2016
    Posts:
    33