Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Mizzinx · Jan 15, 2014 at 11:16 AM · c#editorcompiler error

Internal Compiler Error trying to use NSubstitute

Background: I'm very, very, very new to C# and Unity.

I'm trying to use the NSubstitute framework in my project. I have dll and xml files (taken from the library's NET35 directory) in Assets/Plugins. MonoDevelop seems to be happy with it, but the Unity editor gives me an internal compiler error:

 Internal compiler error. See the console log for more information. output was:
 Unhandled Exception: System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.
 
   at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)
 
   at System.Reflection.Assembly.GetTypes () [0x00000] in <filename unknown>:0 
 
   at Mono.CSharp.RootNamespace.ComputeNamespaces (System.Reflection.Assembly assembly, System.Type extensionType) [0x00000] in <filename unknown>:0 
 
   at Mono.CSharp.RootNamespace.ComputeNamespace (Mono.CSharp.CompilerContext ctx, System.Type extensionType) [0x00000] in <filename unknown>:0 
 
   at Mono.CSharp.GlobalRootNamespace.ComputeNamespaces (Mono.CSharp.CompilerContext ctx) [0x00000] in <filename unknown>:0 
 
   at Mono.CSharp.Driver.LoadReferences () [0x00000] in <filename unknown>:0 
 
   at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0 
 
   at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename unknown>:0 

The Editor.log file shows a bunch of complaints about being unable to load various System.ComponentModel and Castle classes.

I've looked up solutions for similar problems, and they tend to suggest messing with the .net compatability in player settings, but that didn't seem to help. The log file does seem to suggest that is where the problem lies, however, so maybe I just wasn't messing with the right settings.

Any and all help would be awesome.

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image mohanrao164 · Jan 15, 2014 at 12:11 PM 0
Share

the NET35 library's will not work during compiling if possible search for NET2.0 libraries . if they are NET2.0 then only it will work. same situation i faced in my project so it would be helpfull for u

avatar image Mizzinx · Jan 16, 2014 at 07:37 AM 0
Share

There's a comment on the Unity Test Tools asset store page that strongly suggests someone was able to use NSubstitute with Unity. There's also other places that suggest it's possible to get some .NET 3.5 libraries working, at least in older versions of Unity, such as in this post, so I don't want to give up hope quite yet.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by seppukitty · Jan 25, 2016 at 03:10 PM

If you have the newest version of Unity (5.3+):

Put the NSubstitute files inside a directory named Editor (make one if you don't have one). Also make sure you click on the dll and select "Editor" from the list under "Select platforms for plugin".

You can also download Unity Test Tools and only import NSubstitute, but that's all it does anyway. There is no special NET2.0 library for NSubstitute, so if you need it outside the editor (in your actual game for some reason) then it won't work.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

20 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Edit child in parent list [Custom Inspector] 1 Answer

Update variables with C# properties in customeditor 2 Answers

Instantiating Prefabs through Editor Script 1 Answer

Multiple Cars not working 1 Answer

How do I reference variables from one editor script in another 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges