Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

"The dll is not allowed to be included or could not be found" while building.

Discussion in 'Editor & General Support' started by valyard, Jul 6, 2012.

  1. valyard

    valyard

    Unity Technologies

    Joined:
    Jun 4, 2010
    Posts:
    291
    Bass.NET library seems to be referencing System.Windows.Forms for whatever reason.
    In the editor it works fine but if I try to build a project I get this error:

    How is that possible if this specific library is a part of .NET/Mono?
    Is there a way to fix this except to copy the whole Mono folder to Plugins folder of my project?
     
  2. AnthonyPaulO

    AnthonyPaulO

    Joined:
    Nov 5, 2010
    Posts:
    110
    I'm surprised this worked at all, even from the editor; the Windows Forms dll makes extensive use of the Windows 32 API and as such is not supported, which means you can't use whatever Bass dll you're using. Seeing that Bass is a audio library, you should look into using their lib dlls that don't reference UI modules such as windows forms.
     
  3. puargs

    puargs

    Joined:
    Apr 30, 2013
    Posts:
    10
    I know this is a super old thread, but I was searching and found the answer to this problem. AnthonyPaulO's answer was incorrect - you CAN use System.Windows.Forms references, you just need to change the Api Compatibility Level.

    Go to Edit -> Project Settings -> Player.
    At the bottom, where it says "Api Compatibility Level", change it to ".NET 2.0" (do NOT leave it on ".NET 2.0 Subset").

    Now it should build and run just fine :)
     
  4. kalisclark

    kalisclark

    Joined:
    Sep 29, 2014
    Posts:
    33
    This may be a super old thread but it is still helping! Puargs, you just saved me a load of frustration! thank you!
     
  5. specterdragon

    specterdragon

    Joined:
    Dec 30, 2013
    Posts:
    21
    Old thread... but still helpful. :D
     
  6. nathanvog

    nathanvog

    Joined:
    Oct 19, 2015
    Posts:
    2
    Oldies but goldies... :D
     
  7. Jimbo10

    Jimbo10

    Joined:
    May 8, 2016
    Posts:
    6
    Amazing 2016 and 5.4f3 just needed exactly this:D:cool:
     
  8. Woahbird

    Woahbird

    Joined:
    Jan 5, 2016
    Posts:
    1
    Still helpfull, saved me. :D
     
  9. Nukode

    Nukode

    Joined:
    May 24, 2016
    Posts:
    9
    it works ! Thanks puargs :)
     
  10. Mastrom

    Mastrom

    Joined:
    Dec 17, 2013
    Posts:
    4
    Unity 2017.1 and still works! thanks
     
    sonofbryce and AndantaCompany like this.
  11. sonofbryce

    sonofbryce

    Joined:
    May 19, 2009
    Posts:
    111
    Just updated to 2017.1 and ran into this error! Another thanks! This error could've been a bad end to a long day, haha.
     
  12. Zeeshan-Aslam

    Zeeshan-Aslam

    Joined:
    Oct 22, 2015
    Posts:
    6
    after build Apk. there is no live streaming. what can be the problem?
     
  13. unity_pdU7YcUMgJNbDQ

    unity_pdU7YcUMgJNbDQ

    Joined:
    Dec 6, 2017
    Posts:
    1
    Unity 2017.2 and works for me.
     
  14. difficultnerd

    difficultnerd

    Joined:
    May 3, 2014
    Posts:
    52
    2017.3 and this does not work for me.
     
  15. difficultnerd

    difficultnerd

    Joined:
    May 3, 2014
    Posts:
    52
    ahh - I see - my error is different -

    ArgumentException: The Assembly UnityEngine is referenced by UnityEngine.UI ('C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/Standalone/UnityEngine.UI.dll'). But the dll is not allowed to be included or could not be found.
    UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2 cache, BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:156)
    UnityEditor.AssemblyHelper.FindAssembliesReferencedBy (System.String[] paths, System.String[] foldersToSearch, BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:196)
    UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

    Build completed with a result of 'Failed'
    UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

    UnityEditor.BuildPlayerWindow+BuildMethodException: 3 errors
    at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x0020e] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:181
    at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x00065] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:88
    UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
     
  16. ShantuApps

    ShantuApps

    Joined:
    Apr 25, 2016
    Posts:
    14
    do u have it solved ?
     
  17. OlliIllustrator

    OlliIllustrator

    Joined:
    Nov 1, 2013
    Posts:
    71
    Oldies but goldies, I had a similar error today with a dll. from an asset and the solution to change to Net 2.0 in Player settings helped (Unity 5.6.5).
     
    Last edited: Mar 21, 2018
  18. laurencebudd96

    laurencebudd96

    Joined:
    May 10, 2018
    Posts:
    1

    This fixed it for me! Thanks for leaving this up!
     
  19. sgrein

    sgrein

    Joined:
    May 9, 2018
    Posts:
    11
    A life saver, thanks.
     
  20. HinxLai

    HinxLai

    Joined:
    Dec 31, 2017
    Posts:
    4
    Problem solved. Thank you.
     
  21. MujtabaKhan

    MujtabaKhan

    Joined:
    Jul 19, 2018
    Posts:
    2
    Mot working for me! tried many solutions and searched many threads, still facing this error. Please help!
     
  22. not_today

    not_today

    Joined:
    Apr 9, 2019
    Posts:
    2
    Solved for me. Thanks! Unity 2018.3.12
     
  23. moulikirs

    moulikirs

    Joined:
    Jun 22, 2019
    Posts:
    5
    upload_2019-6-25_11-31-14.png


    i couldnt find wat you are taking about any idea??
     
  24. Mathyx92

    Mathyx92

    Joined:
    Apr 9, 2019
    Posts:
    2
    i2eilly likes this.
  25. princessjike

    princessjike

    Joined:
    Aug 7, 2019
    Posts:
    2
    Thanks. This just save me
     
  26. mscardinal

    mscardinal

    Joined:
    Oct 29, 2019
    Posts:
    1
    thanks!
    I was using the same Asset and the change worked for me!
     
  27. wykj-luke

    wykj-luke

    Joined:
    Feb 11, 2020
    Posts:
    6
    same as you.
     
  28. Sonaht

    Sonaht

    Joined:
    Sep 20, 2017
    Posts:
    1
    The same, realy thanks!!
     
  29. Rugbug_Redfern

    Rugbug_Redfern

    Joined:
    Jun 2, 2017
    Posts:
    20
    I'm using https://github.com/gkngkc/UnityStandaloneFileBrowser as well, and was attempting to use it with IL2CPP. If anyone figures out how to use that asset with IL2CPP please tell me! I was able to fix the error by switching back to Mono but I'd rather not have to do that.
     
  30. JohnArtanis

    JohnArtanis

    Joined:
    Dec 29, 2020
    Posts:
    4
    its not working for me (sad face)
     
  31. razaali4939

    razaali4939

    Joined:
    Mar 6, 2020
    Posts:
    2
    Do you find any solution about this error, because it is not working for me also.
     
  32. andresmqa

    andresmqa

    Joined:
    Nov 10, 2016
    Posts:
    4
    I am having this issue since I installed Google Maps API in my project. To change "Api Compability Level" is not working for me
     
  33. DJManic

    DJManic

    Joined:
    Jul 29, 2021
    Posts:
    1
    mine wont switch it keeps going back to net 4.x
     
  34. bisrit

    bisrit

    Joined:
    Nov 20, 2021
    Posts:
    2
    puargs I really appreciate your answer. I have been benefited using the way you suggested so long ago. Any thanks is less than you deserve.