Borland.Delphi.Targets was not found

Applied to Delphi 2007/2009, Windows 8.1/10/11
Borland.Delphi.Targets was not found
Error
Unable to load project ... .dproj The imported project "C:\Windows\ Microsoft.NET \F…\Borland.Delphi.Targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.
... .dproj
There are a lot of topics in the Internet containing the error message
The imported project "C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Borland. Delphi.Targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
RAD keeps the copies of Targets files in the
"C:\ProgramData\{B59CE2E6-B15A-4F23-BD0E-72BF2ADDC3C7}\core\7EFD2DA3\6C948720\"
directory, and they can be copied to
"C:\Windows\Microsoft.NET\Framework\v2.0.50727\"
("C:\Windows\Microsoft.NET\Framework64\v2.0.50727\") /
sometimes to
"C:\Windows\Microsoft.NET\Framework\v4.0.30319"
("C:\Windows\Microsoft.NET\Framework64\v4.0.30319")
if absent.

But error can still exist!
The matter to give "Full control" to "ALL APPLICATION PACKAGES" ("Все пакеты приложений") for the "C:\Windows\Microsoft.NET\" directory.


Note:
"ALL APPLICATION PACKAGES" ("Все пакеты приложений"), appeared with WIN 8.
SID - ALL_APP_PACKAGES
The All Application Packages group is a well-known group with a predefined SID. The group must have specific access to certain locations of the registry and file system for Microsoft Store Apps to function properly.

There is a more clumsy way to fix this error.
Find the line <Import Project="$(MSBuildBinPath)\Borland.Delphi.Targets" /> in project file .dproj. This line is located about at the end of file.
Replace the value "$(MSBuildBinPath)\Borland.Delphi.Targets" with full path to file, for instance: "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Borland.Delphi.Targets"
Note:
Directory "C:\Windows\Microsoft.NET\Framework\v2.0.50727"
stands for .NET Framework, Version 2.0, Visual Studio Version 2005
Directory "C:\Windows\Microsoft.NET\Framework\v4.0.30319"
stands for .NET Framework, Version 4.0/4.5.2, Visual Studio Version 2010/2012

No comments:

Post a Comment