美文网首页
Expecting to find a type to be d

Expecting to find a type to be d

作者: 吉凶以情迁 | 来源:发表于2023-06-25 21:47 被阅读0次

    今天项目彻底报废打不开了,而且发现了一些奇怪的问题,经过rider开发工具 找到历史版本进行还原备份, 文本比对终于找出问题。
    在当前项目下找到CesiumForUnrealSamplesTarget .cs
    CesiumForUnrealSamplesEditorTarget .cs
    发现内容空白,加进去即可。
    找到

    
    public class CesiumForUnrealSamplesTarget : TargetRules
    {
        public CesiumForUnrealSamplesTarget(TargetInfo Target) : base(Target)
        {
            Type = TargetType.Game;
            DefaultBuildSettings = BuildSettingsVersion.V2;
    
            ExtraModuleNames.AddRange( new string[] { "CesiumForUnrealSamples" } );
        }
    }
    
    
    
    // Copyright 2020-2021 CesiumGS, Inc. and Contributors
    
    using UnrealBuildTool;
    using System.Collections.Generic;
    
    public class CesiumForUnrealSamplesEditorTarget : TargetRules
    {
        public CesiumForUnrealSamplesEditorTarget(TargetInfo Target) : base(Target)
        {
            Type = TargetType.Editor;
            DefaultBuildSettings = BuildSettingsVersion.V2;
    
            ExtraModuleNames.AddRange( new string[] { "CesiumForUnrealSamples" } );
        }
    }
    
    
    

    出现这个问题的原因是想改名,但是后果很严重。
    加入进去后删除.vs Intermediate Saved Binaries
    重新generate visual studio file成功了

    Running UnrealBuildTool: dotnet "..\..\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.dll" Development Win64 -Project="C:/ueproject/CesiumForUnrealSamples/CesiumForUnrealSamples.uproject" -TargetType=Editor -Progress -NoEngineChanges -NoHotReloadFromIDE
    Log file: C:\Users\Administrator\AppData\Local\UnrealBuildTool\Log.txt
    Creating makefile for CesiumForUnrealSamplesEditor (no existing makefile)
    Expecting to find a type to be declared in a module rules named 'CesiumForUnrealSamples' in CesiumForUnrealSamplesModuleRules, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null.  This type must derive from the 'ModuleRules' type defined by Unreal Build Tool.
    
    

    同样的,在类似结构
    CesiumForUnrealSamples\Source\CesiumForUnrealSamples\CesiumForUnrealSamples.Build.cs中发现内容空白

    
    using UnrealBuildTool;
    
    public class CesiumForUnrealSamples : ModuleRules
    {
        public CesiumForUnrealSamples(ReadOnlyTargetRules Target) : base(Target)
        {
            PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
        
            PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });
    
            //PrivateDependencyModuleNames.AddRange(new string[] {  });
    
    
            // Uncomment if you are using Slate UI
            // PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
            
            // Uncomment if you are using online features
            // PrivateDependencyModuleNames.Add("OnlineSubsystem");
    
            // To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true
        }
    }
    
    

    相关文章

      网友评论

          本文标题:Expecting to find a type to be d

          本文链接:https://www.haomeiwen.com/subject/zecwydtx.html