targets file was corrupted. Reinstall .net 9 SDK issue got fixed
Issue with Project Reference
I am using visual studio 2022 with net9. C# unable to reference a class library project in another class
library project.
\Program Files\dotnet\sdk\9.0.201\Microsoft.Common.CurrentVersion.targets(2189,5): warning MSB9008: The referenced project \ProjectB\ProjectB.csproj does not exist.
folder structure
- SolutionFolder
- ProjectA
- ProjectA.csproj
- ProjectB
- ProjectB.csproj
- ProjectA
ProjectA.csproj:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\ProjectB\ProjectB.csproj" />
</ItemGroup>
</Project>
.NET Training
2 answers
Sort by: Most helpful
-
-
Pradeep M 8,185 Reputation points Microsoft External Staff
2025-03-26T05:38:43.1833333+00:00 Hi Anil Babu Ravi,
I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to accept the answer.
Ask: Issue with Project Reference
Solution: targets file was corrupted. Reinstall .net 9 SDK issue got fixed
Please feel free to contact us if you have any additional questions.
Please don’t forget to Accept Answer and Yes for "was this answer helpful" wherever the information provided helps you, this can be beneficial to other community members.