fix file not found cecilx exception

This commit is contained in:
vis2k 2021-08-21 23:47:25 +08:00
parent 0019d7b52f
commit a9b6f9d278
2 changed files with 7 additions and 2 deletions

View File

@ -5,6 +5,9 @@
// https://forum.unity.com/threads/how-does-unity-do-codegen-and-why-cant-i-do-it-myself.853867/#post-5646937 // https://forum.unity.com/threads/how-does-unity-do-codegen-and-why-cant-i-do-it-myself.853867/#post-5646937
using System.IO; using System.IO;
using System.Linq; using System.Linq;
// to use Mono.CecilX here, we need to 'override references' in the
// Unity.Mirror.CodeGen assembly definition file in the Editor, and add CecilX.
// otherwise we get a reflection exception with 'file not found: CecilX'.
using Mono.CecilX; using Mono.CecilX;
using Unity.CompilationPipeline.Common.ILPostProcessing; using Unity.CompilationPipeline.Common.ILPostProcessing;
// IMPORTANT: 'using UnityEngine' does not work in here. // IMPORTANT: 'using UnityEngine' does not work in here.

View File

@ -9,8 +9,10 @@
], ],
"excludePlatforms": [], "excludePlatforms": [],
"allowUnsafeCode": true, "allowUnsafeCode": true,
"overrideReferences": false, "overrideReferences": true,
"precompiledReferences": [], "precompiledReferences": [
"Mono.CecilX.dll"
],
"autoReferenced": false, "autoReferenced": false,
"defineConstraints": [], "defineConstraints": [],
"versionDefines": [], "versionDefines": [],