C# project in Visual Studio Code is missing the Accord.targets 3.8.0 package

160 views Asked by At

I'm trying to build an open source Git project locally on my computer using Visual Studio Code. The project I'm trying to build is MusicAnalyser. I've successfully set up Visual Studio Code, installed Git, installed C# (I think; I have quite a bit of experience as a Java programmer, but I am new to C#) and cloned the repository. Admittedly, I am not a Git expert, but I don't think that matters here. I now want to build the project, but I get the following error:

This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see Troubleshooting package restore errors. The missing file is ..\packages\Accord.3.8.0\build\Accord.targets.

I've therefore installed the NuGet Package Manager GUI and started looking for Accord.targets. I can't find it... I've tried installing a whole bunch of Accord packages, hoping the one I need happened to be in one of them, but no luck. I'm stuck!

I can't find Accord.targets anywhere online either, and I'm pretty sure I'm missing something far more basic. For example, I'm trying to figure out where NuGet installs packages, but I can't find them anywhere on my local computer. Also, I've tried to use the option to 'Restore NuGet Packages', but I'm out of my depth. I don't know how to run that or where to get started.

I admit there are too many new things for me so I don't know what to do next. Of course I have googled a lot before posting this question, however did not find anything helpful. How can I fix this?

1

There are 1 answers

5
padeso On

The project dependencies are listed in the packages.config file (https://github.com/Seank23/MusicAnalyser/blob/master/MusicAnalyser/packages.config). You just need to restore them. Assuming you have the .NET extension installed, you should be able to hit F1 and select .NET Restore Project. Actually, if you have the extension installed, Visual Studio Code will usually ask if you want to restore when you open the project.

If it comes down to it, you can also open the terminal, navigate to the project folder and enter:

dotnet restore