visual-studio


nuget references appear missing after restore but aren't


After I restore nugget packages my solution builds but intellisense says the references don't exist and I get what looks like errors but are false positive. This only seems to happen in my test projects. The only way I have found to fix it is to go into the references for each project that reports errors and view the properties. Once I open one the broken reference in the properties window all of the broken references for that project magically get fixed.
Just to be clear - the restore is working - its just VS doesn't think so; it puts the missing reference icon on the reference and intellisense reports errors on any code that uses the reference. It all builds and runs fine
nuget references appear missing after restore but aren't
You need use the NuGet command line in the Package Manager Console:
Update-Package -reinstall
to force reinstall the package references into project after restore nuget package.
NuGet Restore only restores files in the packages directory (\packages folder ), but does not restore files inside your project or otherwise modify your project, in other words, NuGet will not reinstall the package references in the project. After you restore the packages, the packages are re-download to the packages directory, so the package references are broken temporary, then the intellisense reports missing reference errors on any code that uses the references.
To resolve this question, you can use the "Update-Package -reinstall" command to force reinstall the package references, after that, all references are reinstalled, this weird behavior will disappear.
Hope this can help you.

Related Links

traget platfrom for c++ VS2015 to XP don't work
WebPack in VS2015: How to configure a new pack?
in ClickOnce Publishing, I can't determine what packages to include.
Keep context of Visual Studio properties window
Visual Studio 2017 enable completion after character is typed in F#
Trying Cherry Pick in Visual Studio 2013 with Git extension tools
Class Library or Console App for Models & Data Layer in Solution?
Cosmos devkit stock is not working
Load Test option disappeared
How to stop properties window double click from changing value
diagnostics tools in visual studio for javascripts
Visual Studio 2017 – Enterprise restarts on .Net Core Projects
Move a project from root into a branch directory?
VS2017 takes long time recompiling typescript on save
How to include a file containing files and assembly references in csproj
Adding libraries to visual studio as a whole folder c++

Categories

HOME
qt
oracle
office365
spring-data
extjs
mod-rewrite
opencart
adfs3.0
concurrency
subdomain
dafny
bittorrent
firebase-database
port
lda
lc3
clish
smartgwt
vmware-workstation
spyder
generator
sipp
cell
jstree
raima
morris.js
window-managers
multi-dimensional-scaling
android-service
miniprofiler
bonita
docx4j
d3.js-v4
dotcms
objectmapper
instructions
argv
commonsware-cwac
mongodb-3.4
wampsharp
overwrite
apptentive
directfb
autoencoder
amazon-kms
des
jade4j
ms-dos
variable-variables
selenide
game-center
distributed-caching
section508
watir-webdriver
line-intersection
popen
test-data
yargs
ogg
okio
system.web.optimization
between
jtag
perforce-integrate
yii2-model
deferred-rendering
adjacency-list
sharepoint-apps
accessibilityservice
gridbaglayout
wikimedia-commons
json-spirit
http.client
srv-record
blank-line
mobilefirst-server
org-babel
relational-model
componentart
unidata
shell-extensions
mutators
symja
smacss
forceclose
rails-api
accountmanager
mod-perl
ctp
oscilloscope
ui-design
smartfox
jquery-dialog
zend-pdf
viewpagerindicator
coordinate
system-information
cakeyframeanimation
jdom
struts2-s2hibernate
fitch-proofs
snackjs
winsxs
ppc
error-detection

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App