我正在使用visual studio,我在构建项目时遇到了问题。我不知道如何解决它。
我收到此错误:
Error 289 The "CreateProjectReferenceDefineConstants" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Windows\Microsoft.NET\Framework\v4.0.30319" directory. C:\Program Files (x86)\MSBuild\Microsoft\WiX\v3.x\wix2010.targets 1279 6 ProcedureManagerSetup
我双击这个错误,这引导我进入这段代码:
<Target
Name="AddProjectReferenceDefineConstants"
Condition=" '@(_ResolvedProjectReferencePaths)' != '' ">
<CreateProjectReferenceDefineConstants
ProjectReferencePaths="@(_ResolvedProjectReferencePaths)"
ProjectConfigurations="$(VSProjectConfigurations)">
<Output TaskParameter="DefineConstants" PropertyName="ProjectReferenceDefineConstants" />
</CreateProjectReferenceDefineConstants>
</Target>
具体指向这一行:
<CreateProjectReferenceDefineConstants
自从我的Windows 10更新后,就发生了这种情况。我注意到之前,它使用的是.NET 3.5。更新后,它变为.NET 4.0。我不确定这是否是发生这种情况的主要原因,但值得一提。
答案 0 :(得分:1)
这解决了我的问题:
答案 1 :(得分:0)
您可以在注册表中添加以下密钥。
打开注册表(您在“运行收件箱”中编写了regedit)
你找到HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ EventLog \ Application文件夹
然后添加新文件夹。
您的新文件夹名称: “HKEY_LOCAL_MACHINE \系统\ CurrentControlSet \服务\事件日志\应用程序\ ASP.NET 4.0.30319”