The Photon Forum
is Closed Permanently.

After many dedicated years of service, we have made the decision to retire our Forum and switch to read-only: we´ve saved the best to last! Your search result can be found below. Plus, we offer support via these channels:

Try Our
Documentation

Please check if you can find an answer in our extensive documentation on Fusion.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Read More on
Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

How to disable/limit Fusion Unity SDK from weaving all DLLs?

justdizzy
2022-03-20 18:58:41

Whenever Unity triggers a code recompile, frequently Fusion.CodeGen reweaves all the DLLs in the project regardless of whether they have any Fusion related code in them or not. Is there a way to limit which DLLs, AsmDefs, or (best) specific files get weaved?

Here are some of the logs from Unity Editor.log:

  • Starting ILPostProcessor 'Fusion.CodeGen.ILWeaverBindings' on Unity.SysrootPackage.Editor.dll

  • Finished ILPostProcessor 'Fusion.CodeGen.ILWeaverBindings' on Unity.SysrootPackage.Editor.dll in 0.106074 seconds

  • Finished ILPostProcessorRunner in 0.591806 seconds

  • Finished compile Library/ScriptAssemblies/Unity.SysrootPackage.Editor.dll in 257.185127 seconds

  • Starting ILPostProcessorRunner

  • Starting ILPostProcessor 'Fusion.CodeGen.ILWeaverBindings' on Unity.RenderPipelines.Universal.Editor.Tests.dll

  • Finished ILPostProcessor 'Fusion.CodeGen.ILWeaverBindings' on Unity.RenderPipelines.Universal.Editor.Tests.dll in 0.099881 seconds

  • Finished ILPostProcessorRunner in 0.55889 seconds

  • Finished compile Library/ScriptAssemblies/Unity.RenderPipelines.Universal.Editor.Tests.dll in 260.660523 seconds

  • Starting ILPostProcessorRunner

  • Starting ILPostProcessor 'Fusion.CodeGen.ILWeaverBindings' on Unity.Addressables.Editor.dll

  • Finished ILPostProcessor 'Fusion.CodeGen.ILWeaverBindings' on Unity.Addressables.Editor.dll in 0.0993 seconds

  • Finished ILPostProcessorRunner in 0.583428 seconds

  • Finished compile Library/ScriptAssemblies/Unity.Addressables.Editor.dll in 264.505775 seconds

  • Starting ILPostProcessorRunner

  • Starting ILPostProcessor 'Fusion.CodeGen.ILWeaverBindings' on Tilia.Visuals.CollisionFader.Unity.Runtime.dll

  • Finished ILPostProcessor 'Fusion.CodeGen.ILWeaverBindings' on Tilia.Visuals.CollisionFader.Unity.Runtime.dll in 0.09446 seconds

  • Finished ILPostProcessorRunner in 0.561937 seconds

  • Finished compile Library/ScriptAssemblies/Tilia.Visuals.CollisionFader.Unity.Runtime.dll in 252.523622 seconds

  • Starting ILPostProcessorRunner

  • Starting ILPostProcessor 'Fusion.CodeGen.ILWeaverBindings' on Unity.Sysroot.Linux_x86_64.dll

  • Finished ILPostProcessor 'Fusion.CodeGen.ILWeaverBindings' on Unity.Sysroot.Linux_x86_64.dll in 0.096249 seconds

  • Finished ILPostProcessorRunner in 0.524489 seconds

  • Finished compile Library/ScriptAssemblies/Unity.Sysroot.Linux_x86_64.dll in 256.437739 seconds

  • Starting ILPostProcessorRunner

  • Starting ILPostProcessor 'Fusion.CodeGen.ILWeaverBindings' on Fusion.Addressables.dll

  • Finished ILPostProcessor 'Fusion.CodeGen.ILWeaverBindings' on Fusion.Addressables.dll in 0.087463 seconds

  • Finished ILPostProcessorRunner in 0.4951 seconds

  • Finished compile Library/ScriptAssemblies/Fusion.Addressables.dll in 228.186748 seconds

  • Starting ILPostProcessorRunner

  • Starting ILPostProcessor 'Fusion.CodeGen.ILWeaverBindings' on Unity.Toolchain.Win-x86_64-Linux-x86_64.dll

  • Finished ILPostProcessor 'Fusion.CodeGen.ILWeaverBindings' on Unity.Toolchain.Win-x86_64-Linux-x86_64.dll in 0.086952 seconds

  • Finished ILPostProcessorRunner in 0.478356 seconds

  • Finished compile Library/ScriptAssemblies/Unity.Toolchain.Win-x86_64-Linux-x86_64.dll in 231.574042 seconds

  • Finished script compilation in 486.077341 seconds

Comments

ramonmelo
2022-03-31 09:18:43

Hi @justdizzy ,

Yes, it should be straightforward to limit which DLLs are Weaved.

Open the NetworkProjectConfig asset and look for the "Assemblies To Weave" section, select the ones you don't want to Weave and remove them from the list, save and see how it goes.

--

Ramon Melo

Photon Fusion Team

justdizzy
2022-03-31 22:09:48

I have this set to only Assembly-CSharp and Assembly-CSharp-firstpass, but the issue persists.

ramonmelo
2022-04-01 07:03:50

Hi @justdizzy ,

Which SDK version are you using? Does this also happen on the latest version?

--

Ramon Melo

Photon Fusion Team

justdizzy
2022-04-04 01:41:21

It happens in both 1.0.0 Stable and 1.1.0 Nightly.

pgwiazdowski
2022-04-05 11:10:47

What you are observing is as expected, except for those ridiculous compile times. Weaving is actually a two-pass process, first being checking whether a DLL should be altered or not. That's why you see ILPostProcessor in the log.

Does disabling the weaver reduce compile times?

Also, what Unity version are you on?

justdizzy
2022-04-08 02:11:35

Unity 2020.3.23

How do I disable weaving? If I do, will my networking classes not work?

pgwiazdowski
2022-05-19 06:43:04

To make absolutely sure ILPostProcessor is not used, simply remove Assets/Photon/FusionCodeGen folder.

gfaraj
2023-06-10 22:56:12

I'm having an issue with an assembly I'm using from an external package. I keep getting the error

Session join/create failed. Type Foo.Components.FoobarGameRoomController has not been weaved. Has the assembly Foo been added to NetworkProjectConfig?

I tried adding the Foo assembly to Assemblies to Weave but it just gets automatically removed the next time I run the game in the editor. And the same error shows up.

If I remove the FusionCodeGen folder I get this:

Session join/create failed. Type ControllerPrototype has not been weaved. Has the assembly Assembly-CSharp been added to NetworkProjectConfig?

Any help would be appreciated.

gfaraj
2023-06-17 03:50:15

@ramonmelo @photon I have not gotten a response here nor in the discord about the above. Is having common networked components in a separate UPM package not supported?

Back to top