Update: I managed to find a very easy solution to this problem. The second reply on this post, by “Rumbleball” fixes this problem.
I used to store my projects on a hard drive which I would use to work on my projects on both my PC and my laptop, and it worked very well. But I recently purchased Google One (their desktop cloud drive service, equivalent to OneNote or Dropbox Desktop, which acts as an external hard drive to store anything in the cloud) and moved my projects from my external hard drive to my cloud drive. But since moving my projects, I haven’t been able to compile them. Inside the engine, when hitting “compile”, I instantly receive the following error message:
- [2021.12.10-19.34.59:993][372]CompilerResultsLog: ERROR: Unhandled exception: System.IO.FileLoadException: Could not load file or assembly ‘file:///G:\My Drive\Projects\Kingdoms\Intermediate\Build\BuildRules\KingdomsModuleRules.dll’ or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
- [2021.12.10-19.34.59:993][372]CompilerResultsLog: File name: ‘file:///G:\My Drive\Projects\Kingdoms\Intermediate\Build\BuildRules\KingdomsModuleRules.dll’ —> System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See <loadFromRemoteSources> Element | Microsoft Learn for more information.
- [2021.12.10-19.34.59:993][372]CompilerResultsLog: at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
- [2021.12.10-19.34.59:993][372]CompilerResultsLog: at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
- [2021.12.10-19.34.59:993][372]CompilerResultsLog: at System.Reflection.Assembly.Load(AssemblyName assemblyRef, Evidence assemblySecurity)
- [2021.12.10-19.34.59:993][372]CompilerResultsLog: at System.CodeDom.Compiler.CompilerResults.get_CompiledAssembly()
- [2021.12.10-19.34.59:993][372]CompilerResultsLog: at UnrealBuildTool.DynamicCompilation.CompileAssembly(FileReference OutputAssemblyPath, HashSet
1 SourceFileNames, List
1 ReferencedAssembies, List`1 PreprocessorDefines, Boolean TreatWarningsAsErrors) in D:\Build++UE4\Sync\Engine\Source\Programs\UnrealBuildTool\System\DynamicCompilation.cs:line 380- [2021.12.10-19.34.59:993][372]CompilerResultsLog: at UnrealBuildTool.DynamicCompilation.CompileAndLoadAssembly(FileReference OutputAssemblyPath, HashSet
1 SourceFileNames, List
1 ReferencedAssembies, List`1 PreprocessorDefines, Boolean DoNotCompile, Boolean TreatWarningsAsErrors) in D:\Build++UE4\Sync\Engine\Source\Programs\UnrealBuildTool\System\DynamicCompilation.cs:line 450- [2021.12.10-19.34.59:993][372]CompilerResultsLog: at UnrealBuildTool.RulesAssembly…ctor(RulesScope Scope, List
1 BaseDirs, IReadOnlyList
1 Plugins, Dictionary2 ModuleFileToContext, List
1 TargetFiles, FileReference AssemblyFileName, Boolean bContainsEngineModules, Nullable`1 DefaultBuildSettings, Boolean bReadOnly, Boolean bSkipCompile, RulesAssembly Parent) in D:\Build++UE4\Sync\Engine\Source\Programs\UnrealBuildTool\System\RulesAssembly.cs:line 110- [2021.12.10-19.34.59:994][372]CompilerResultsLog: at UnrealBuildTool.RulesCompiler.CreateProjectRulesAssembly(FileReference ProjectFileName, Boolean bUsePrecompiled, Boolean bSkipCompile) in D:\Build++UE4\Sync\Engine\Source\Programs\UnrealBuildTool\System\RulesCompiler.cs:line 603
- [2021.12.10-19.34.59:994][372]CompilerResultsLog: at UnrealBuildTool.RulesCompiler.CreateTargetRulesAssembly(FileReference ProjectFile, String TargetName, Boolean bSkipRulesCompile, Boolean bUsePrecompiled, FileReference ForeignPlugin) in D:\Build++UE4\Sync\Engine\Source\Programs\UnrealBuildTool\System\RulesCompiler.cs:line 665
- [2021.12.10-19.34.59:994][372]CompilerResultsLog: at UnrealBuildTool.UEBuildTarget.Create(TargetDescriptor Descriptor, Boolean bSkipRulesCompile, Boolean bUsePrecompiled) in D:\Build++UE4\Sync\Engine\Source\Programs\UnrealBuildTool\Configuration\UEBuildTarget.cs:line 675
- [2021.12.10-19.34.59:994][372]CompilerResultsLog: at UnrealBuildTool.BuildMode.CreateMakefile(BuildConfiguration BuildConfiguration, TargetDescriptor TargetDescriptor, ISourceFileWorkingSet WorkingSet) in D:\Build++UE4\Sync\Engine\Source\Programs\UnrealBuildTool\Modes\BuildMode.cs:line 487
- [2021.12.10-19.34.59:994][372]CompilerResultsLog: at UnrealBuildTool.BuildMode.Build(List`1 TargetDescriptors, BuildConfiguration BuildConfiguration, ISourceFileWorkingSet WorkingSet, BuildOptions Options, FileReference WriteOutdatedActionsFile) in D:\Build++UE4\Sync\Engine\Source\Programs\UnrealBuildTool\Modes\BuildMode.cs:line 247
- [2021.12.10-19.34.59:994][372]CompilerResultsLog: at UnrealBuildTool.BuildMode.Execute(CommandLineArguments Arguments) in D:\Build++UE4\Sync\Engine\Source\Programs\UnrealBuildTool\Modes\BuildMode.cs:line 219
- [2021.12.10-19.34.59:994][372]CompilerResultsLog: at UnrealBuildTool.UnrealBuildTool.Main(String ArgumentsArray) in D:\Build++UE4\Sync\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.cs:line 550
When trying to re-generate the VS Code files, I receive a similar error:
- ERROR: Unhandled exception: System.IO.FileLoadException: Could not load file or assembly ‘file:///G:\My Drive\Projects\Kingdoms\Intermediate\Build\BuildRules\KingdomsModuleRules.dll’ or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
- File name: ‘file:///G:\My Drive\Projects\Kingdoms\Intermediate\Build\BuildRules\KingdomsModuleRules.dll’ —> System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See <loadFromRemoteSources> Element | Microsoft Learn for more information.
- at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
- at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
- at System.Reflection.Assembly.Load(AssemblyName assemblyRef, Evidence assemblySecurity)
- at System.CodeDom.Compiler.CompilerResults.get_CompiledAssembly()
- at UnrealBuildTool.DynamicCompilation.CompileAssembly(FileReference OutputAssemblyPath, HashSet1 SourceFileNames, List
1 ReferencedAssembies, List1 PreprocessorDefines, Boolean TreatWarningsAsErrors) in D:\Build\++UE4\Sync\Engine\Source\Programs\UnrealBuildTool\System\DynamicCompilation.cs:line 380 - at UnrealBuildTool.DynamicCompilation.CompileAndLoadAssembly(FileReference OutputAssemblyPath, HashSet
1 SourceFileNames, List1 ReferencedAssembies, List
1 PreprocessorDefines, Boolean DoNotCompile, Boolean TreatWarningsAsErrors) in D:\Build++UE4\Sync\Engine\Source\Programs\UnrealBuildTool\System\DynamicCompilation.cs:line 450
- at UnrealBuildTool.RulesAssembly…ctor(RulesScope Scope, List1 BaseDirs, IReadOnlyList
1 Plugins, Dictionary2 ModuleFileToContext, List
1 TargetFiles, FileReference AssemblyFileName, Boolean bContainsEngineModules, Nullable1 DefaultBuildSettings, Boolean bReadOnly, Boolean bSkipCompile, RulesAssembly Parent) in D:\Build\++UE4\Sync\Engine\Source\Programs\UnrealBuildTool\System\RulesAssembly.cs:line 110 - at UnrealBuildTool.RulesCompiler.CreateProjectRulesAssembly(FileReference ProjectFileName, Boolean bUsePrecompiled, Boolean bSkipCompile) in D:\Build\++UE4\Sync\Engine\Source\Programs\UnrealBuildTool\System\RulesCompiler.cs:line 603 - at UnrealBuildTool.ProjectFileGenerator.AddProjectsForAllTargets(PlatformProjectGeneratorCollection PlatformProjectGenerators, List
1 AllGames, List1 AllTargetFiles, String[] Arguments, ProjectFile& EngineProject, ProjectFile& EnterpriseProject, List
1& GameProjects, Dictionary`2& ProgramProjects) in D:\Build++UE4\Sync\Engine\Source\Programs\UnrealBuildTool\ProjectFiles\ProjectFileGenerator.cs:line 2288
- at UnrealBuildTool.ProjectFileGenerator.GenerateProjectFiles(PlatformProjectGeneratorCollection PlatformProjectGenerators, String Arguments) in D:\Build++UE4\Sync\Engine\Source\Programs\UnrealBuildTool\ProjectFiles\ProjectFileGenerator.cs:line 753
- at UnrealBuildTool.GenerateProjectFilesMode.Execute(CommandLineArguments Arguments) in D:\Build++UE4\Sync\Engine\Source\Programs\UnrealBuildTool\Modes\GenerateProjectFilesMode.cs:line 198
- at UnrealBuildTool.UnrealBuildTool.Main(String ArgumentsArray) in D:\Build++UE4\Sync\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.cs:line 550
I’m a little lost, because it worked fine when compiling inside an external hard drive. Does anyone know what the problem is?
Thanks in advance!