dotnet / dotnet/msbuild

Building a solution with (c,C++, and C# projects) using "dotnet build" command

Open
#9,134 0 comments 0 reactions 0 assignees View on GitHub
triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

I have a solution (framework version 5.0.0) that contains three projects: a C# console application, a CLR project, and a Static Library project. The "static library" project contains c code. I can build and run my application using vs2022 on Windows. However, I couldn't build it on Ubuntu 22. I tried the following commands:
a- wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
b- sudo chmod +x ./dotnet-install.sh
c- ./dotnet-install.sh --runtime aspnetcore

Then I used the command "dotnet build"

I got the following errors:
MSB4019: The imported project "/Microsoft.Cpp.targets" was not found.

However, if I just keep the C# projects and remove the references to the other projects, I can build and run the solution.

Could you please tell me how I can build my solution with all the projects?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.