自定义 nuget feed,VS 没有看到已安装的包
大家好 我有一个本地 Nuget 源,其中包含一个包,其中包含我想要在项目中使用的一些默认项(默认公司模型和样式以及一些默认页面)。它只是将项目复制到项目中并将连接字符串添加到 web.config 中,没什么花哨的。
我可以通过包管理器控制台和 GUI 安装该包。但是,它从未显示为已安装。这意味着我无法更新它也无法卸载它。如果我进入 GUI,它会显示该包未安装,即使它已将所有项目添加到项目中并且在包目录中具有该包的文件夹。
另外,我想使用这个 NuGet 包来覆盖默认 MVC 项目中已存在的一些文件(例如 AccountController 和 LogonUserControl.ascx)。这可以完成吗?还是我需要从空白 MVC 模板而不是默认模板开始?
包.config:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MyCompanyMVC" version="1.1" />
</packages>
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). It is only copying items in to the project and adding a connection string to the web.config, nothing fancy.
I can install the package via the Package Manager Console and the 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.
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). Can this be done or will I need to start off with the blank MVC template instead of the default?
Packages.config:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MyCompanyMVC" version="1.1" />
</packages>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
NuGet 不会覆盖文件 - 我不相信有办法强制它,但是您可能可以通过使用 PowerShell 脚本 (tools/install.ps1) 删除旧文件并重命名注入的文件来“解决”此问题以获得所需的名称。
NuGet won't overwrite files - I don't believe there's a way to force it, however you could probably "work around" this by using a PowerShell script (tools/install.ps1) to delete the old file and rename your injected file to have the required name.