nuget

c#操作word书签

和自甴很熟 提交于 2020-12-17 21:42:15
因项目需要,给word文档的书签赋值,框架没有相关内容,于是自己上网加上查看文档,成功搞定该功能。下面是我的实现过程: 首先需要引用nuget包: Microsoft.Office.Interop.Word,我下载的是12.0.0版本的,刚开始下载的15.0.0版本的无法使用,暂时不知道为什么,有空研究一下;然后就是代码实现: /// <summary> /// 版 本 /// Copyright (c) 2018-2018 /// 创建人:Yu /// 日 期:2018.04.17 /// word操作 /// </summary public class WordHelp { ApplicationClass wordApp = new ApplicationClass(); Document doc; /// <summary> /// 生成文件存放地址 /// </summary> public string newPath { get ; set ; } /// <summary> /// 生成的新文件文件夹路径 /// </summary> public string newDicPath { get ; set ; } /// <summary> /// 无参构造方法 /// </summary> public WordHelp() { } /// <summary>

docker生成dotnet core镜像

早过忘川 提交于 2020-12-17 07:28:55
使用docker生成dotnet core项目镜像。需要编写Dockerfile文件。编写方法有两种,如下: 第一种:将发布成功的项目,直接生成镜像。 FROM microsoft/dotnet:2.2 -aspnetcore-runtime WORKDIR /app EXPOSE 5000 COPY bin/Debug/netcoreapp2.2 /publish/ app/ ENV ASPNETCORE_URLS http://*:5000 ENTRYPOINT ["dotnet", "app/WebApplication1.dll"] 第二种:发布源码,自动build,publish FROM microsoft/dotnet:2.2 -aspnetcore-runtime AS base WORKDIR /app EXPOSE 5000 FROM microsoft/dotnet:2.2 -sdk AS build WORKDIR /src COPY . . RUN dotnet restore "WebApplication1.csproj" --configfile NuGet.Config WORKDIR "/src/" RUN dotnet build "WebApplication1.csproj" -c Release -o /app FROM build AS

Team Services的打包管理

时光怂恿深爱的人放手 提交于 2020-12-17 00:44:16
Team Services的打包管理 ##概述 Package Management (打包管理)是一种扩展,可以更容易地发现、安装和发布包。 它与Team Services中心如构建功能深度集成,这样打包管理就可以与现有工作流无缝对接。 当产品已成功,组织正在成长,这时就该扩大代码库来与之匹配。当在一个单一产品的单一代码库中扩展到过去的2-3个团队时,你可能会发现以下问题: 团队如何有效地共享可重用组件? 如何让特性团队快速迭代,而不影响其他团队的工作? 如何让团队自主地以适应他们的速度进行迭代? 这些问题不仅仅适用于刚刚成长的团队。如果是一个拥有历史代码库的成熟团队,可能也会面临这些相同的问题,因为团队被要求交付更多的价值,更快交付。无论情况如何,组件化可以帮助构建一个代码库,它可以扩展到团队的规模并匹配当前开发速率。 在该模块中,我们将探索如何通过打包管理实现二进制组件,从而帮助管理和共享外部依赖项、OSS和隔离的共享组件。 ##前置条件 要完成这个实验室需要: Visual Studio Team Services 账户.如果没有,需要 创建 一个。 Visual Studio 2017 或更高版本 可以使用 Visual Studio team Services Demo Data generator Visual Studio team

IdentityServer4 4.x版本 配置Scope的正确姿势

允我心安 提交于 2020-12-14 03:57:35
点击上方蓝字" 小黑在哪里 "关注我吧 前言 IdentityServer4 是为ASP.NET Core系列量身打造的一款基于 OpenID Connect 和 OAuth 2.0 认证的框架 IdentityServer4官方文档:https://identityserver4.readthedocs.io/ 看这篇文章前默认你对IdentityServer4 已经有一些了解。 本篇使用IdentityServer4的4.x版本,跟老版本的稍微有些差别。下面直接进入正题。 鉴权中心 创建IdentityServer4项目 使用IdentityServer4 来搭建一个鉴权中心,首先建议安装一下IdentityServer4的官方项目模板。也可以不安装,自己创建项目,然后NuGet安装需要的包也行。(不过还是推荐用官方的模板,很方便)。 命令行执行: dotnet new -i IdentityServer4.Templates image-20200629205619088 安装完成后会多出以下项目模板: image-20200629205731577 我这里选用is4inmem这个模板来创建项目,这个模板的数据都是写死在内存中的,并且包含了Quickstart页面,比较简单方便。 来到我的项目目录下执行: dotnet new is4inmem --name Idp

Header file for installed NuGet package not recognized in Visual Studio

自作多情 提交于 2020-12-13 04:29:07
问题 I am trying to learn Halide by walking through the tutorials. I'm working in VS 15, and have added the NuGet package for Halide and added it as a reference to my project (as shown in the image). The NuGet tutorials I've watched seem to indicate that once I add the reference, VS should automatically recognize the header file of the project, but this is not happening. I've read all the stackoverflow questions related to this, and have tried uninstalling and reinstalling the package, restarting

Header file for installed NuGet package not recognized in Visual Studio

蹲街弑〆低调 提交于 2020-12-13 04:28:44
问题 I am trying to learn Halide by walking through the tutorials. I'm working in VS 15, and have added the NuGet package for Halide and added it as a reference to my project (as shown in the image). The NuGet tutorials I've watched seem to indicate that once I add the reference, VS should automatically recognize the header file of the project, but this is not happening. I've read all the stackoverflow questions related to this, and have tried uninstalling and reinstalling the package, restarting

Where is the nuget executable for dotnet core

不打扰是莪最后的温柔 提交于 2020-12-12 11:17:06
问题 Where does dotnet core look for a nuget executable when running restore commands? Is there a separate executable, or are the nuget functions built directly into the cli tools? If I already have a nuget executable on my path, can dotnet be configured to use this? 回答1: NuGet is no longer an executable that runs for a restore operation, it has become an integrated part of the build tooling and the dotnet CLI. NuGet operations have been turned into MSBuild tasks which are run during a build. This

Azure Devops - Compatibility problems moving from .NET Core 3.1 to .NET 5 at Nuget Package

孤人 提交于 2020-12-12 09:10:30
问题 I have a .NET Core solution which was running well using .NET Core 3.1 using a Pipeline on Azure Devops. Everything was working fine on the Pipeline. After moving from .NET Core 3.1 to .NET 5.0, I started to have some strange troubles running the pipeline, specifically with Nuget packages. I can build with no problems, but when it starts to pack using Nuget Package, I've got this error: [error] The nuget command failed with exit code(1) NU1202: Package Microsoft.EntityFrameworkCore 5.0.0 is

使用Northwind数据库的 .NET Core应用你了解多少?

时光怂恿深爱的人放手 提交于 2020-12-11 10:32:02
下载DevExpress v20.2完整版 DevExpress技术交流群2:775869749 欢迎一起进群讨论 通过 DevExpress WPF Controls ,您能创建有着强大互动功能的XAML基础应用程序,这些应用程序专注于当代客户的需求和构建未来新一代支持触摸的解决方案。 在本文中,空白示例项目(.NET Core 3.1)是连接到Northwind数据库。 数据库结构: 您可以使用此示例创建DevExpress项目并体验相关功能,该项目引入 DevExpress ThemedWindow 作为根元素。 要创建一个项目并将其连接到数据库: 1. 创建一个新项目: 2. 选择DevExpress v20.1 WPFBlank App (.NET Core): 3. 指定项目名称,然后单击创建: 4. 将Microsoft.EntityFrameworkCore.SqlServer和Microsoft.EntityFrameworkCore.Tools NuGet程序包添加到项目中: 5. 打开 Package Manager Console 然后运行以下命令,此命令为DbContext和数据库的实体类型生成代码: Scaffold-DbContext "Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:

如何在 Asp.Net Core 实现 Excel 导出功能

删除回忆录丶 提交于 2020-12-09 16:40:52
在web应用程序开发时,或许你会遇到这样的需求,如何在 Asp.Net Core 中实现 excel 或者 word 的导入导出,在 NuGet 上有大量的工具包可以实现这样的功能,本篇就讨论下如何使用 ClosedXML 实现 Excel 数据导出。 安装 ClosedXML 如果想实现 Excel 的导出功能,在 Asp.Net Core 中有很多的dll可以做到,其中的一个叫做 ClosedXML,你可以通过可视化界面 NuGet package manager 去安装,也可以使用命令行 NuGet package manager console 执行下面命令。 Install-Package ClosedXML 将数据导出成 CSV 文件 将数据导成 CSV 文件是非常简单的,毕竟每行数据都是用 , 隔开即可,可以用 NuGet 上的 CsvExport 或者 AWright18.SimpleCSVExporter 去实现,当然你觉得自己很 ????????,可以亲自操刀实现,下面我准备亲自实现一下,先看下面定义的 Author 类。 public class Author { public int Id { get; set; } public string FirstName { get; set; } public string LastName { get; set