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

Visual Studio Typescript to JavaScript
I can't download visual studio
Unable to Sign In to Visual Studio 2013 and open Team Explorer after installing Update 5
Jasmine.d.ts failing to compile in visual studio with error “jasmine.d.ts(137,44): error TS1005: ',' expected”
SHA-1 SSL for my admin application showing as bad
Deploying UWP app from Visual Studio to Windows 10 Phone requires PIN
Visual Studio 2015 XAML designer not showing with System.Runtime.Remoting.RemotingException
Visual Studio 2015 Designer Crashes in all Win10 UAP projects (“The app didn't start.”)
Visual Studio Publish MSdeploy $(SolutionDir)
Visual Studio publish skips project
Visual Studio How to debug project A when started by project B?
UWP Iot-Core Project in Visual Studio 2015 thinks it is WinRT and requires sealed classes and blocks generic collections etc
Visual Studio Ctrl K, D - HTML Tag Spacing
clean reinstall of Visual Studio Community 2015
Sharepoint Online: Create & use List in Provider Hosted App (C#)
Compare two configuration properties (Debug & Release build)

Categories

HOME
visual-studio
android-studio
redmine
activex
vsts-build
magento-2.0
gallery
dji-sdk
phpmqtt
native-base
cocotb
google-awareness
bnf
deepfreeze
bluemix-mobile-services
connection-refused
ava
animated-gif
firemonkey-style
environment
echosign
envoy
steam-web-api
python-2.x
directfb
creation
cups
gitolite
iscroll
suds
data-uri
coverage.py
yoast
doctrine-extensions
destroy
dredd
uiautomatorviewer
datediff
connect-direct
.when
rustdoc
perl-data-structures
email-injection
allegro
yargs
metabase
clp
jsf-2.3
meld
jeditable
gulp-uglify
preferenceactivity
flush
teensy
pack
juniper-network-connect
nette
android-studio-import
mobilefirst-server
scala-macros
mxe
image-rotation
multivariate-testing
mobile-country-code
webautomation
forceclose
.htpasswd
refit
assetic
eclim
progress-db
stty
django-facebook
contextswitchdeadlock
icenium
email-verification
semantic-merge
coordinate
autosize
fitch-proofs
uploading
litespeed
motodev-studio
tessellation
ntruencrypt
sqlsitemapprovider
iphone-sdk-3.1.3

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App