简体   繁体   English

自定义nuget提要,VS未将软件包视为已安装

[英]Custom nuget feed, VS doesn't see package as installed

Hi all I have a local Nuget source with a package containing some default items I want in my projects (default corporate models and styles and some default pages). 大家好,我有一个本地Nuget源,其包装中包含一些我想要在项目中使用的默认项(默认公司模型和样式以及一些默认页面)。 It is only copying items in to the project and adding a connection string to the web.config, nothing fancy. 它只是将项目复制到项目中,并将连接字符串添加到web.config中,一点也不花哨。

I can install the package via the Package Manager Console and the GUI. 我可以通过程序包管理器控制台和GUI安装程序包。 However, it never shows as installed. 但是,它永远不会显示为已安装。 This means that I cannot update it nor can I uninstall it. 这意味着我无法更新它,也无法卸载它。 If I go to the GUI, it shows the package as not installed, even though it has added all items to the project and has a folder for the package in the packages directory. 如果我转到GUI,即使已将所有项目添加到项目中,并且在packages目录中有该文件夹的文件夹,它也会显示未安装的软件包。

Also, I want to use this NuGet package to overwrite some files that already exist in the default MVC project (such as AccountController and LogonUserControl.ascx). 另外,我想使用此NuGet包覆盖默认MVC项目中已经存在的某些文件(例如AccountController和LogonUserControl.ascx)。 Can this be done or will I need to start off with the blank MVC template instead of the default? 可以做到这一点,还是需要从空白的MVC模板而不是默认模板开始?

Packages.config: Packages.config:

<?xml version="1.0" encoding="utf-8"?>
<packages>
 <package id="MyCompanyMVC" version="1.1" />
</packages>

NuGet不会覆盖文件-我不相信有一种强制方法,但是您可以通过使用PowerShell脚本(tools / install.ps1)删除旧文件并重命名注入的文件来“解决”此问题具有所需的名称。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 NuGet Package 管理器控制台:“update-package -project ...”不会更新所有已安装的软件包 - NuGet Package Manager Console: “update-package -project …” doesn't update all installed packages 我如何创建一个(仅设计时)nuget程序包,该程序包在安装时不添加程序集引用? - How can i create a (design time only) nuget package that doesn't add an assembly reference when installed? 从程序包管理器控制台添加自定义nuget源(PowerShell) - Add custom nuget feed from the Package Manager Console (PowerShell) 已安装Azure SDK,但Visual Studio 2012未看到它 - Azure SDK is installed but Visual Studio 2012 doesn't see it PTVS无法检测到已安装的VS2010 - PTVS Doesn't detect installed VS2010 Visual Studio看不到Nuget - Visual Studio Can't See Nuget 从NuGet安装了引用,但是VS2010无法找到名称空间 - Installed the reference from NuGet but VS2010 cant find the namespace 如果nuget包尚未更新,则选项 - Options if a nuget package hasn't been updated 安装Resharper Ultimate 2016.1.2时不会加载VS2010中的数据库项目 - Database proj in VS2010 doesn't load when Resharper Ultimate 2016.1.2 installed 使用TFS在VS 2010中进行分支会丢失NuGet包引用 - Branching in VS 2010 with TFS loses NuGet package references
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM