FastScriptReload icon indicating copy to clipboard operation
FastScriptReload copied to clipboard

Inheriting from 'Editor' in runtime script is causing error CS0118: 'Editor' is a namespace but is used like a type

Open handzlikchris opened this issue 1 year ago • 0 comments

This is down to Editor assembly not being referenced for new hot reloaded assembly

FSR: Error when updating files: 'AddNewFieldsTest.cs', FastScriptReload.Editor.Compilation.HotReloadCompilationException: Compiler failed to produce the assembly. Output: 'C:\Users\Chris\AppData\Local\Temp\72848fbb3b4645e28394c26e99b3c675.SourceCodeCombined.cs(124,52): error CS0118: 'Editor' is a namespace but is used like a type

C:\Users\Chris\AppData\Local\Temp\72848fbb3b4645e28394c26e99b3c675.SourceCodeCombined.cs(126,30): error CS0115: 'AddNewFieldsTestEditor__Patched_.OnInspectorGUI()': no suitable method found to override' ---> System.Exception: Compiler failed to produce the assembly. Output: 'C:\Users\Chris\AppData\Local\Temp\72848fbb3b4645e28394c26e99b3c675.SourceCodeCombined.cs(124,52): error CS0118: 'Editor' is a namespace but is used like a type

C:\Users\Chris\AppData\Local\Temp\72848fbb3b4645e28394c26e99b3c675.SourceCodeCombined.cs(126,30): error CS0115: 'AddNewFieldsTestEditor__Patched_.OnInspectorGUI()': no suitable method found to override' at FastScriptReload.Editor.Compilation.DotnetExeDynamicCompilation.ExecuteDotnetExeCompilation (System.String dotnetExePath, System.String cscDll, System.String rspFile, System.String outLibraryPath, System.Collections.Generic.List1[System.String]& outputMessages) [0x001fe] in E:\_src-unity\FastScriptReload\Assets\FastScriptReload\Scripts\Editor\Compilation\DotnetExeCompilator.cs:309 at FastScriptReload.Editor.Compilation.DotnetExeDynamicCompilation.Compile (System.Collections.Generic.List1[T] filePathsWithSourceCode, ImmersiveVRTools.Runtime.Common.UnityMainThreadDispatcher unityMainThreadDispatcher) [0x00145] in E:_src-unity\FastScriptReload\Assets\FastScriptReload\Scripts\Editor\Compilation\DotnetExeCompilator.cs:107 --- End of inner exception stack trace --- at FastScriptReload.Editor.Compilation.DotnetExeDynamicCompilation.Compile (System.Collections.Generic.List1[T] filePathsWithSourceCode, ImmersiveVRTools.Runtime.Common.UnityMainThreadDispatcher unityMainThreadDispatcher) [0x001e7] in E:\_src-unity\FastScriptReload\Assets\FastScriptReload\Scripts\Editor\Compilation\DotnetExeCompilator.cs:150 at FastScriptReload.Editor.Compilation.DynamicAssemblyCompiler.Compile (System.Collections.Generic.List1[T] filePathsWithSourceCode, ImmersiveVRTools.Runtime.Common.UnityMainThreadDispatcher unityMainThreadDispatcher) [0x0000e] in E:_src-unity\FastScriptReload\Assets\FastScriptReload\Scripts\Editor\Compilation\DynamicAssemblyCompiler.cs:23 at FastScriptReload.Editor.FastScriptReloadManager+<>c__DisplayClass54_1.<TriggerReloadForChangedFiles>b__1 () [0x00063] in E:_src-unity\FastScriptReload\Assets\FastScriptReload\Scripts\Editor\FastScriptReloadManager.cs:380 UnityEngine.Logger:Log (UnityEngine.LogType,object) ImmersiveVrToolsCommon.Runtime.Logging.LoggerScoped:LogInternal (UnityEngine.LogType,object) (at Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/Runtime/Logging/LoggerScoped.cs:52) ImmersiveVrToolsCommon.Runtime.Logging.LoggerScoped:LogError (object) (at Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/Runtime/Logging/LoggerScoped.cs:57) FastScriptReload.Editor.FastScriptReloadManager/<>c__DisplayClass54_1:<TriggerReloadForChangedFiles>b__1 () (at Assets/FastScriptReload/Scripts/Editor/FastScriptReloadManager.cs:425) System.Threading._ThreadPoolWaitCallback:PerformWaitCallback ()

handzlikchris avatar Apr 04 '23 16:04 handzlikchris