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. Dismiss Notice

WebGL build problems with assembly definition asset file

Discussion in 'WebGL' started by chiron, Jan 21, 2021.

  1. chiron

    chiron

    Joined:
    Mar 9, 2015
    Posts:
    3
    I got 181 errors mostly related to cs0246. After removing asmdef file totally webgl seems to build again. Is it not possible to use asmdef together with webgl?
     
    TomTrottel and travlake like this.
  2. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    944
    I have not been aware of WebGL specific limitations in organizing C# code into assemblies. It should be the same for all IL2CPP utilizing platforms. Does a native Windows/macOS build work if you choose IL2CPP as the scripting backend?
     
  3. TomTrottel

    TomTrottel

    Joined:
    Aug 16, 2014
    Posts:
    18
    I have a similar problem.

    I have an own assembly definition in a sub-directory in the asset directory for a namespace, which I need so UI Toolkit is compiled in the correct order (as recommended here and it solved that problem).

    But I get over 100 compile erros of classes from other namespaces not found if I use the asmdef when I try to built it for WebGL. It works fine in the Editor itself when played.

    But if I remove it it compiles without problems to WebGL.

    (added one day later : also now UI Toolkit is also compiling correctly without the custom asmdef, which it did not before without the assembly def for my namsspace. this is very confusing)

    @jukka_j will try later what you asked
     
    Last edited: Oct 10, 2021