我收到一个不存在的项目文件的IO异常(我只是尝试创建该项目)
我尝试使用Visual Studio 2017而不是2019(因为与UE 4.22.3的兼容性问题),但我的Windows SDK没有发现任何问题(虚幻引擎论坛上的一些人说这可能是问题)和VS配置
Running C:/Program Files/Epic Games/UE_4.22/Engine/Binaries/DotNET/UnrealBuildTool.exe -projectfiles -project="C:/Users/Director/Documents/source/repos/Phz/Phz.uproject" -game -rocket -progress
Discovering modules, targets and source code for project...
ERROR: Unhandled exception: System.IO.FileLoadException: Could not load file or assembly 'file:///C:\Users\Director\Documents\source\repos\Phz\Intermediate\Build\BuildRules\PhzModuleRules.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
File name: 'file:///C:\Users\Director\Documents\source\repos\Phz\Intermediate\Build\BuildRules\PhzModuleRules.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 http://go.microsoft.com/fwlink/?LinkId=155569 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, HashSet`1 SourceFileNames, List`1 ReferencedAssembies, List`1 PreprocessorDefines, Boolean TreatWarningsAsErrors) in D:\Build\++UE4\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\System\DynamicCompilation.cs:line 358
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\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\System\DynamicCompilation.cs:line 427
at UnrealBuildTool.RulesAssembly..ctor(DirectoryReference BaseDir, IReadOnlyList`1 Plugins, List`1 ModuleFiles, List`1 TargetFiles, Dictionary`2 ModuleFileToPluginInfo, FileReference AssemblyFileName, Boolean bContainsEngineModules, Boolean bUseBackwardsCompatibleDefaults, Boolean bReadOnly, Boolean bSkipCompile, RulesAssembly Parent) in D:\Build\++UE4\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\System\RulesAssembly.cs:line 109
at UnrealBuildTool.RulesCompiler.CreateProjectRulesAssembly(FileReference ProjectFileName, Boolean bUsePrecompiled, Boolean bSkipCompile) in D:\Build\++UE4\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\System\RulesCompiler.cs:line 488
at UnrealBuildTool.ProjectFileGenerator.AddProjectsForAllTargets(PlatformProjectGeneratorCollection PlatformProjectGenerators, List`1 AllGames, ProjectFile& EngineProject, ProjectFile& EnterpriseProject, List`1& GameProjects, Dictionary`2& ProgramProjects) in D:\Build\++UE4\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\ProjectFiles\ProjectFileGenerator.cs:line 2104
at UnrealBuildTool.ProjectFileGenerator.GenerateProjectFiles(PlatformProjectGeneratorCollection PlatformProjectGenerators, String[] Arguments) in D:\Build\++UE4\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\ProjectFiles\ProjectFileGenerator.cs:line 674
at UnrealBuildTool.GenerateProjectFilesMode.Execute(CommandLineArguments Arguments) in D:\Build\++UE4\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\Modes\GenerateProjectFilesMode.cs:line 172
at UnrealBuildTool.UnrealBuildTool.Main(String[] ArgumentsArray) in D:\Build\++UE4\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.cs:line 443
“ Phz”是在那些DLL名称中使用的项目名称。
是否有任何特定的.NET Framework SDK或我缺少的东西?
(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
)
答案 0 :(得分:0)
经过多年的努力: 它无法在C:驱动器中创建项目!
我想知道它是否存在某些许可问题...
:|
答案 1 :(得分:0)
您可以创建一个Blueprint项目,然后通过创建C ++类在C ++项目中对其进行转换。转到File-> New C ++ Class
答案 2 :(得分:0)
错误消息中给出了您收到该错误消息的原因:
ERROR: Unhandled exception: System.IO.FileLoadException: Could not load file or assembly 'file:///C:\Users\Director\Documents\source\repos\Phz\Intermediate\Build\BuildRules\PhzModuleRules.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
由于该文件似乎位于您的本地C驱动器上,所以我怀疑这是您对网络共享的依赖-也许您有一些复杂的联结设置,其中一个或多个目录指向网络位置。无论如何,如果您搜索该行的末尾,即。 HRESULT: 0x80131515
您可以在2011年找到关于同一错误的另一个SO问题。
从该SO线程那里有一个相对简单的解决方案,您可以在https://stackoverflow.com/a/8535963/1327399中找到。但是,根据我的测试,该解决方案无效。 devenv可执行文件似乎未参与ue4的“生成项目文件”命令。我的研究无法找到二进制/配置文件对来应用此解决方案来专门影响UE4和其他尽可能少的事情。
行之有效的:我能够从另一个SO线程(即.net 4框架范围内)中找到一个nuclear option。
对此问题2011 blog post所做的肯定值得注意的,因为从网络位置运行代码存在明显的风险,因此该解决方案可能存在无法预料的漏洞。
在您选择的一行结尾处,在您的帖子结尾处,您可以找到上述解决方案的基础。
please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.
该链接:http://go.microsoft.com/fwlink/?LinkId=155569
如果有人更热衷,我相信他们可以深入研究虚幻的构建工具源代码,并找到更适合xml行的主页。根据示例,其中哪个似乎需要嵌套在放置该配置文件的特定层次结构中。
此外,但这[在这里]可能不值得一提-在我的虚拟化Windows环境中,ue4将项目文件生成到我的NFS共享上,但是也遇到了错误。似乎是错误的错误;可能是Microsoft NFS驱动程序中的错误,但谁知道。该错误表明存在写入错误,事实证明这些错误没有发生(至少在灾难性的级别上),因为实际上文件已写入并且可以打开它们-我没有做任何工作,所以我没有测试我是否可以毫无问题地保存更改。