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 Dinkelborg · Feb 26, 2014 at 10:46 AM · errordllcompilerwindows-form

Internal Compiler Error, caused by System.Windows.Forms.dll

I have two projects, on the first one I'm working for a long time now and at one point I integrated the System.Windows.Forms.dll in the folder Plugins to be able to have a proper file dialog. The second project was just created now with the newest release of Unity (and Mono) the second project was created to isolate one feature out of the first project and so to make a unity-package out of it.

The first project uses the DLL with no problems at all and it is also using the newest version of Unity by now, but it started using the DLL with a previous version and was always updated.

I copied the DLL so it is exactly the same as in the first one in the second one, I even copied the folder as a test, but nothing works at all. Once I try to use the forms library the Internal Compiler error occurs. If no script tries to use it everything is fine and even writing "using System.Windows.Forms;" does not make the error occur first when it says: "openDialog = new OpenFileDialog();" the Internal Error shows reading:

Internal compiler error. See the console log for more information. output was: Unhandled Exception: System.TypeLoadException: Could not load type 'System.ComponentModel.CancelEventHandler' from assembly 'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. at (wrapper managed-to-native) System.Reflection.MonoMethodInfo:get_method_info (intptr,System.Reflection.MonoMethodInfo&) at System.Reflection.MonoMethodInfo.GetMethodInfo (IntPtr handle) [0x00000] in unknown>:0 at System.Reflection.MonoMethodInfo.GetAttributes (IntPtr handle) [0x00000] in unknown>:0 at System.Reflection.MonoMethod.get_Attributes () [0x00000] in :0 at System.Reflection.MethodBase.get_IsVirtual () [0x00000] in :0 at Mono.CSharp.MemberCache.AddMethods (BindingFlags bf, System.Type type) [0x00000] in :0 at Mono.CSharp.MemberCache.AddMethods (System.Type type) [0x00000] in :0

the following is the script trying to use the DLL.

 using System.Collections;
 using System.Windows.Forms;
 
 public class LoadManager
 {
     private static OpenFileDialog openDialog;
     
     public LoadManager ()
     {
         //
     }
     
     public static string[] OpenFileDialog ()
     {
         openDialog = new OpenFileDialog();
         openDialog.InitialDirectory = UnityEngine.Application.dataPath;
         openDialog.Filter = "music files (*.mp3;*.wav)|*.MP3;*.WAV|All files (*.*)|*.*";
         openDialog.Title = "Select some music you want to listen to during this Game session.";
         openDialog.Multiselect = true;
         string[] result = null;
         if (openDialog.ShowDialog() ==  DialogResult.OK)
         {
             result = openDialog.FileNames;
         }
         if (openDialog.FileName == string.Empty)
         {
             result = null;
         }
         openDialog = null;
         return result;
     }
 }


I'm completely helpless with this and I'm running both projects on the same Laptop, with the same version of Unity... I have no clue at all and I would be very very thankful for any kind of help

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by _monoflow · Jul 02, 2014 at 01:21 PM

Change your settings: "Build Settings/Player Settings/Other settings/Api Compatibility Level" to .NET2.0 (not subset)

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

21 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 avatar image

Related Questions

When I build my game it gives me this error 'Assets/Builds/Build_0.01_Data/Managed/Assembly-CSharp.dll' shouldn't be queried by IsAssemblyCompatible, missing IsInternalOrCompiledAssembly check ? 2 Answers

SpeechRecognitionEngine.InstalledRecognizers() returns null within Unity. 3 Answers

c# 6 not recognize after project upgrade from 2017 to 2019 version. 0 Answers

MySql compiler error help~ (OSX) 0 Answers

EntryPointNotFoundException, when trying to import DLL. Help please :) 1 Answer


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