nuget

Why are content files from NuGet packages added as links in .NET Core projects and how can you prevent that?

余生长醉 提交于 2021-02-04 21:48:57
问题 I am developing a .NET Standard library and plan to use it in both .NET Core and .NET Framework projects. My library is dependant on a third library which itself is dependant on a few C binary files. The C binary files have to be copied to the output directory of the project which will be referencing my library. I added the binary files to my library project as content and they are copied to the content and contentFiles directories when the NuGet package is packed with the dotnet pack command

Is there an alternative to contentFiles with projects that use packages.config?

夙愿已清 提交于 2021-02-04 19:51:05
问题 I have a nuget package with content that I want to be copied to the build output when users install my package. There is support for this: NuGet ContentFiles Demystified in NuGet v3.3. However, it only works in projects that use project.json . The contentFiles are not copied to my build output when I have a project that uses packages.config . Is there an alternative or workaround I could use in order to make my NuGet package work on projects that use either a project.json or packages.config ?

Disable transitive PackageReference dependency for a specific MsBuild project

本秂侑毒 提交于 2021-02-04 19:36:08
问题 I am migrating an old style MsBuild csproj project to using PackageReference format and have run into a problem with transitive dependencies. Consider the following Project A reference NuGet package B and C, each containing one single assembly using PackageReference. On Build Project A uses IL merge to incorporate B as public symbols in the A assembly and C as internalized symbols. Project D have a project reference to A. The transitive dependencies case D to reference A, B and C. When

“Downgraded” MS dll disappears on upgrade - Windows Installer

和自甴很熟 提交于 2021-02-04 19:15:06
问题 We have developed an application that is distributed through Windows Installer, created with the use of WiX, where our customers can upgrade from any older version to the newest. Our latest version however, deletes 2 dll's, and this is only rectified through a reinstall. Details on the NuGet packages Microsoft.IdentityModel.Protocol.Extensions was upgraded from Nuget Version 1.0.2.206221351 and File version 1.0.20622.1351 to Nuget version 1.0.4.403061554 and File version 1.0.4.54. Similar

Visual Studio 2015 Initializing Part Nuget.PackageManagement.VisualStudio.VSolutionManager must be called on UI Thread

扶醉桌前 提交于 2021-02-04 14:02:20
问题 While attempting to build or open a project in Visual Studio 2015 14.0.25431.01 Update 3 which I recently updated, I keep getting errors around nuget package management. Whenever I build the project the first time after opening VS, I get the error message below. I also get it when I try to open the nuget package manager dialog. Anyone else experience this? An exception was thrown while initializing part "Nuget.PackageManagement.VisualStudio.VSolutionManager". GetFullVsVersionString must be

VS2017 Build error - The command nuget restore exited with code 9009

那年仲夏 提交于 2021-02-04 08:37:04
问题 When i am bulding my project i see the below error. The command "nuget restore ProjectName.csproj - PackagesDirectory ....\packages" exited with 9009. When i clicked edit on my .csproj i see below lines of code <Target Name="BeforeBuild"> <Exec WorkingDirectory ="$(ProjDir)" command = "nuget restore $(ProjectName) -PackagesDirectory ..\..\packages> </Exec> </Target> 回答1: First , you should make sure that you have downloaded the latest nuget.exe v5.7.0 and config it full path into System

Including a Folder in NuGet Package and have it install into project as file .netcore/Razor

让人想犯罪 __ 提交于 2021-02-04 08:30:27
问题 I am using Visual Studio 2019 and creating NuGet packages successfully with this method: https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package-using-visual-studio?tabs=netcore-cli All going well, but there are some settings ( .json ) files contained within a directory PageSettings/ When I publish my NuGet package and then install it into a new project, this directory appears in VS as a linked item (see pic). So as a user I can access the files, but they don't "exist"

手工搭建基于ABP的框架

末鹿安然 提交于 2021-02-03 07:08:27
一个业务功能往往不只由一次数据库请求(或者服务调用)实现。为了功能的完整性,我们希望如果该功能执行一半时出错,则撤销前面已执行的改动。在数据库层面上,事务管理实现了这种完整性需求。在ABP中,一个完整的业务功能称为一个工作单元(Unit of Work,简称UoW)。工作单元代表一种完整的、原子性的操作。即一个工作单元包含的步骤要么全部被执行,要么都不被执行。如果执行一半时出现异常,则必须讲已执行的步骤还原。通常我们将事务管理实现在工作单元中。下面我们从ABP源码入手研究如何使用工作单元。 ABP工作单元(UoW)的工作原理 ABP默认将工作单元应用在Repositories、 Application Services、MVC控制器和Web API控制器等组件。也就是说,这些组件的每个方法都是一个工作单元。ABP文档对工作单元的原理讲得不是很详细,所以我们只能通过源码进行研究。这里我们以MVC控制器为例来了解一下ABP工作单元大致的工作原理。源码分析比较枯燥,最好配套ABP源码阅读,或者 跳到后面看粗体字结论 。 ABP在Web模块初始化时注册了过滤器 AbpMvcUowFilter 。 AbpMvcUowFilter 在请求处理前( OnActionExecuting 方法)调用 UnitOfWorkManager.Begin 方法来开始一个工作单元。

开源APM系统HttpReports在.NET Core的应用

家住魔仙堡 提交于 2021-02-02 04:39:59
前言 简单说明下,APM全称Application Performance Management应用性能管理,通过各种收集请求数据,同时搭配Dashboard以实现对应用程序性能管理和故障管理的系统化解决方案。 HttpReports 介绍 HttpReports 是针对.Net Core 开发的轻量级APM系统,基于MIT开源协议, 使用HttpReports可以快速搭建.Net Core环境下统计,分析,图表,监控一体化的站点,并且支持多种数据库存储,适应.Net Core WebAPI,MVC,Web项目, 通过引用Nuget构建Dashboard面板,非常适合中小项目使用。 Github地址: https://github.com/SpringLeee/HttpReports 感兴趣的同学欢迎 Github Star 一波... 在线预览: https://moa.hengyinfs.com 账号: admin 密码 123456 主要功能 接口调用指标分析 多服务节点数据聚合分析 慢请求,错误请求分析 接口调用日志查询 趋势数据分析 (维度: 小时,天,月) 多类型预警监控 HTTP调用分析 多数据库支持,集成方便 数据库支持 Dashboard-UI 快速开始 Step1: 初始化数据库 HttpReports 需要手动创建数据库, 我这里使用 SqlServer

ASP.NET中IOC容器Autofac(依赖注入DI 控制反转IOC)

☆樱花仙子☆ 提交于 2021-01-30 09:56:37
IOC的一个重点是在程序运行中,动态的向某个对象提供它所需要的其他对象。这一点是通过DI来实现的。Autofac则是比较流行的一款IOC容器。 IoC和DI有什么关系呢?其实它们是同一个概念的不同角度描述。 一、IOC IOC—Inversion of Control,即“ 控制反转 ”,不是什么技术,而是一种设计思想,一种面向对象编程法则,目的是程序解耦。 谁控制谁,控制什么? 传统程序设计,我们直接通过new object()创建对象,是程序主动去创建依赖对象;而IoC是有专门一个容器来创建这些对象,即由Ioc容器来控制对象的创建。 为何叫控制反转? 有反转就有正转,传统程序是我们自己主动创建并控制依赖对象,叫正转。 而 反转 则是由容器来帮忙创建及注入依赖对象,由容器帮我们查找及注入依赖对象,对象只是被动的接受依赖对象。 二、DI DI—Dependency Injection,即“ 依赖注入 ” 比如对象A需要操作数据库,以前我们总是要在A中自己编写代码来获得一个Connection对象,有了Autofac我们就只需要告诉Autofac,A中需要一个Connection,至于这个Connection怎么构造,何时构造,A不需要知道。在系统运行时,Autofac会在适当的时候制造一个Connection,然后像打针一样,注射到A当中,这样就完成了对各个对象之间关系的控制