Why all of my .Net project's references are gone? - c#

I have created a web application project. While developing my application, I have installed some packages from NuGet and yet they still there in my project. But when I copy my project to another computer and try to run the project, there are many errors occurred because all references are marked with yellow alerts.
I open the project with file .sln
When I run the project, it generated a lot of error because it cannot find the libraries.
As Abhay Saraf's request, I provide the link to download .csproj section: http://www.hellomeo.net/Umbraco/EmployeeLeaveManagement.zip

First, you need to check the packages.config file in your project to confirm all packages are listed in this file. Then please check your Visual Studio settings (Tools -> Options -> NuGet Package Manager -> General), the options under Package Restore are all checked as below screenshot.
If above options are checked but the packages still not restore automatically, please use following ways to restore packages for entire solution.
Open Package Manager Console window from View -> Other Windows -> Package Manager Console.
Type command “Update-Package -reinstall” to reinstall all packages in your current solution which will based on the packages that listed in the packages.config file.

Right-click on one of the missing references, choose Properties and see what the Path is set to. Is the Path correct?

Run dnu restore from the Package Manager Console

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.

Visual Studio - Microsoft.bcl.build.targets, unload project option not available

I'm getting the following error:
This project references NuGet packages(s) that are missing on this computer. Use Nuget Package Restore to download them... This missing file is ..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets
When I run "Install-Package Microsoft.Bcl.Build -Version 1.0.21" in my Package Manager Console nothing happens.
I've tried to unload the project but, when I right click on the project name I don't see an option for "Unload".
This is the only error I'm seeing when I build the project.

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

Can't build solution because of missing NuGet references

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

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