简体   繁体   中英

Nuget 3.2.0 don't add additional files/folder in project

Since a recent update of Nuget Package Manager (from 2.9 to 3.2.0 I guess), installing package via nuget doesn't add addition files of the package anymore. It just adds the libraries only, update the "project.json" and something like that.

For example: Installing MVVMLight to a project will add Models, ViewModels and Views folder to project. Also, it will add a MainViewModel.cs, ViewModelLocator.cs to ViewModels folder. Now none of these files/folders are added to project.

Any suggestion will help

Since Nuget 3.1 this is no longer supported: https://docs.nuget.org/release-notes/nuget-3.1 . One of the main reasons is that packages can copy in files on install, but you're not sure what to do with it on uninstall (as content might have changed manually). But do note that there's an open issue to maybe re-enable this functionality.

Laurent Bugnion of MVVM Light is aware of this issue as well:

Caution: Full package in Windows 10 Universal applications (UWP)

There is a known issue when you install the “mvvmlight” package in Windows 10 universal applications. The Nuget team unfortunately changed the way that Nuget works for this framework, and it doesn't allow installing additional files, or running scripts anymore. Because of this, installing the “mvvmlight” package in Windows 10 UWP applications creates the exact same result as installing the “mvvmlightlibs” package. Because running a script is not allowed, it is not even possible to warn the user.

I will publish more detailed information on how to add the scaffolding to a Windows 10 UWP application manually. Stay tuned.

As of today, he didn't post a full guide yet, but you could try to run the packaged powershell script manually.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM