Can't build solution because of missing NuGet references - c#

Like title says, I can not build my solution(C#) as NuGet is spitting out this error
This project references NuGet package(s) that are missing on this
computer. Use NuGet Package Restore to download them. For more
information, see http://go.microsoft.com/fwlink/?LinkID=322105. The
missing file is ..\packages\Fody.1.26.1\build\Fody.targets.
When I run Get-Package, it says no packages are installed.
How do I get rid of this(I have no need for the package anymore).
Thanks

You don't want to use the project based nuget package restore!
Make sure you have the latest Nuget version (Tools -> Extensions and Updates)
When you go to build the project it should tell you it needs to download the nuget packages (or might just auto download them).
Edit not sure whats with the downvotes:
http://blog.davidebbo.com/2014/01/the-right-way-to-restore-nuget-packages.html
To find the menu item: "enable nuget package restore" right-click in the solution explorer on the solution - not on the project.
You get a message:
Do you want to configure this solution to download and
restore missing NuGet packages during build?

Press Ctrl+Q then type "Package Manager Console", This will bring up a console like interface.
Type in
Uninstall-Package Fody
and press enter will remove this package for you

Related

File is not accessible - Visual Studio 2017

I have downloaded Visual Studio 2017/Community, for test automation, but when I added the reference selenium-dotnet 3.14.0 , it's saying that this file is not accessible.
Please help. Thanks
click here to see the problem
Have you tried going to the NuGet Package Manager?
Go to Tools -> NuGet Package Manager -> Manage NuGet Packages for Solution
Then Search for Selenium and v3.14.0 is at the top
You can also do this from the NuGet Package Manager Console with:
Install-Package Selenium.WebDriver
According to the screenshot, you're trying to add a NuGet package through the "Add reference" dialog, which is designed to add references to DLLs directly. NuGet packages typically contain DLLs but you have to install them using the Manage NuGet Packages for Solution dialog as #ZP123 explained and not through Add Reference.

xamarin git pull nuget package error

I am new in Xamarin android development.
I take the code pull from git.
After that i opened my solution in visual studio.
I cleaned the solution - now it is fine.
then i trying to build the solution it is showing the error.
>Restoring NuGet packages...
To prevent NuGet from restoring packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages during build.'
NuGet Package restore failed for project app: Unable to find version '2.0.0' of package 'FastAndroidCamera'.
C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\: Package 'FastAndroidCamera.2.0.0' is not found on source 'C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\'.
https://api.nuget.org/v3/index.json: Unable to load the service index for source https://api.nuget.org/v3/index.json.
An error occurred while sending the request.
The remote name could not be resolved: 'api.nuget.org'
1>------ Rebuild All started: Project: app, Configuration: Debug Any CPU ------
1>D:\PRANAV\TOLL\GIT\MobileApp-12-06-2018\MobileApp\app\app.csproj(467,5): error : This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ..\packages\Xamarin.Build.Download.0.4.3\build\Xamarin.Build.Download.props.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========\
This is the error that i am getting . So guys can you figure where i am doing the mistakes ?
According to the error message,
To prevent NuGet from restoring packages during build, open the Visual
Studio Options dialog, click on the Package Manager node and uncheck
'Allow NuGet to download missing packages during build.'
It seems the project use the older now deprecated NuGet package restore that is MSBuild based and runs NuGet.exe on every build. These messages are from NuGet.exe.
Check the similar issue here.
To resolve this issue, you should make sure to upgrade to the latest version of NuGet which does package restore automatically instead of MSBuild based NuGet package restore.
You're going to want to delete the NuGet targets (delete the .nuget folder and then manually edit your .csproj files and remove the lines that import the NuGet.targets file). This is no longer needed. Using the new way to restore nuget package, the NuGet packages will be automatically restored by Visual Studio just before the build.
See this post by David Ebbo for more information: http://blog.davidebbo.com/2014/01/the-right-way-to-restore-nuget-packages.html and the blog how to switch from "Enable Package Restore" to "Automatic Package Restore"
Hope this helps.

Nuget Packages are missing in Visual Studio

I have been using xamarin studio, it works fine when I download a sample project from mvvmcross. It compiles and deploys the device perfectly.
But when I open the project in the visual studio, there are a lot of missing packages for some reasons. Is there a way of handling ? I am using Nuget 2.8 in Visual studio 2013
When I open Nuget as follows, there is a button to restore the missing packages. I clicked on it.
Then it is attempting to download the missing packages, and then it realizes there are dependencies as follows:
Then I am attempting to download the dependency manually as follows but it shows the packages has already downloaded but I am still seeing the missing packages in the solution, nothing is affected.
Therefore I am getting hundreds of errors as follows:
When I take a look at the property of missing packages, I see as follows
You should update your NuGet Package Manager extension in Visual Studio and then try restoring the packages again.
The restore error MvvmCross.Binding already has a dependency defined for MvvmCross.Core is caused by an old version of the NuGet package manager extension not recognising the newer target frameworks that the MvvmCross.Binding NuGet package is using in its group dependencies. This bug has been fixed in a newer version of the NuGet Package Manager.
If you search for the 'already has a dependency defined' error message you will find several cases of this, such as this StackOverflow question, for example:
Can not install NuGet package
Right click on the solution in solution explorer and choose 'restore nuget packages'

Where to place NuGet

I have downloaded Google WEB API sample project. Solution explorer contains .nuget folder that is missing on my machine. NuGet itself is installed on my system. Currently build project rices error:
Error 1 This project references NuGet package(s) that are missing on
this computer. Enable NuGet Package Restore to download them. For
more information, see http://go.microsoft.com/fwlink/?LinkID=322105.
The missing file is
C:\pro\gplus-quickstart-csharp-master\.nuget\NuGet.targets. C:\pro\gplus-quickstart-csharp-master\gplus-quickstart-csharp\gplus-quickstart-csharp.csproj 196 5 gplus-quickstart-csharp
If I remove .nuget folder I have the same error.
How to configure NuGet in my system to make project build?
Have you tried Tools -> Options -> Nuget Package Manager and then selecting Allow Nuget to download missing packages?
Then rebuild your solution

how to add assembly DocumentFormat.OpenXml.Wordprocessin in visual studio

I want to read a doc file and do some operation and I found a code, but it has asking following "WordprocessingDocument" namespace.Has anyone know from where I can find this assembly.please dont sent me a download link for .dll file because it not good to add third party .dll directly.
you can download "Open XML SDK 2.5 for Microsoft Office" from http://www.microsoft.com/en-us/download/details.aspx?id=30425
for using this lib go to http://msdn.microsoft.com/en-us/library/office/bb448854.aspx
As per recent updates and methods for adding any namespaces related to Open XML SDK please add name spaces like System.IO.Packaging, DocumentFormat.OpenXml etc via Nuget Package. You can find nuget package on https://www.nuget.org/packages/DocumentFormat.OpenXml/
To Install this Nuget Package you can open Nuget Package Mananger console (Tools -> Nuget Package Manager -> Nuget Package Manager Console) and make sure that you have right project selected in console dropdown.
Run the following command.
Install-Package DocumentFormat.OpenXml
Alternatively you can also install it via Nuget Package Manager GUI which you can open simply by Right clicking on Solution Explorer and going in 'Manage Nuget Packages'

Categories