Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix "msbuild 4040: There is no target in the project."

I am currently developing a solution with two web projects and a test project. I added a fourth project, a class library to the solution and everything builds fine locally. But when I ran my branch in Azure DevOps through my build pipeline it fails with an error code 4040 and says the there is no target in the new project/class library I created. So far all the help i have found online hasn't done anything for me.

I have tried adding a nuget.build.pack (something to that effect) to my class library project but it still errors.

I literally have no idea where to go from here and need to make sure that the build passes on ADO before making a pull request. Any help is appreciated.

like image 369
Darth Scitus Avatar asked Jan 21 '26 08:01

Darth Scitus


1 Answers

Figured out the problem, so I will post for any future users with the same issue. My problem was that I had added a .NET Standard class library to my solution when all of my other projects were .NET Framework projects. I simply added a new project to my solution but selected the .NET Framework Class Library then copied the contents over and deleted the old one, and wired up all the references to the new one. Fixed the issue.

like image 64
Darth Scitus Avatar answered Jan 23 '26 22:01

Darth Scitus



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!