1. 执行权限

  对于一般服务项目,需要使用管理员权限打开Visual Studio。右击项目 -> 属性 -> 安全性,如下图:

  勾选红框中部分,项目中会增加文件 app.mainfest 如下图:

  该文件内容:  

<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app" />
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC 清单选项
如果要更改 Windows 用户帐户控制级别,请用以下节点之一替换
requestedExecutionLevel 节点。 <requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" /> 指定 requestedExecutionLevel 节点将会禁用文件和注册表虚拟化。
如果要利用文件和注册表虚拟化实现向后
兼容性,则删除 requestedExecutionLevel 节点。
-->
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
<applicationRequestMinimum>
<defaultAssemblyRequest permissionSetReference="Custom" />
<PermissionSet class="System.Security.PermissionSet" version="" Unrestricted="true" ID="Custom" SameSite="site" />
</applicationRequestMinimum>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- 此应用程序设计使用的所有 Windows 版本的列表。
Windows 将会自动选择最兼容的环境。-->
<!-- 如果应用程序设计为使用 Windows Vista,请取消注释以下 supportedOS 节点-->
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"></supportedOS>-->
<!-- 如果应用程序设计使用 Windows ,请取消注释以下 supportedOS 节点-->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>-->
<!-- 如果应用程序设计为使用 Windows ,请取消注释以下 supportedOS 节点-->
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"></supportedOS>-->
<!-- 如果应用程序设计为使用 Windows 8.1,请取消对以下 supportedOS 节点的注释-->
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>-->
</application>
</compatibility>
<!-- 启用 Windows 公共控件和对话框的主题(Windows XP 和更高版本) -->
<!-- <dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>-->
</asmv1:assembly>

  当编译或启动项目时,如果权限不足,会有提示是否以管理员身份运行 Visual Studio,选择是后自动重新以管理员身份运行 Visual Studio 。

2.

C# 服务开发的更多相关文章

  1. 大规模web 服务开发技术

    <大规模web 服务开发技术> 是一本讲解大型Web 应用的入门级书籍,能够让我们接触到大应用的知识点. 目录如下: 第1章  大规模Web服务的开发定位——掌握整体第2章  大规模数据处 ...

  2. ASP.NET MVC 中应用Windows服务以及Webservice服务开发分布式定时器

    ASP.NET MVC 中应用Windows服务以及Webservice服务开发分布式定时器一:闲谈一下:1.现在任务跟踪管理系统已经开发快要结束了,抽一点时间来写一下,想一想自己就有成就感啊!!  ...

  3. WCF服务开发与调用的完整示例

    WCF服务开发与调用的完整示例 开发工具:VS2008 开发语言:C# 开发内容:简单的权限管理系统 第一步.建立WCF服务库 点击确定,将建立一个WCF 服务库示例程序,自动生成一个包括IServi ...

  4. delphi 10 seattle 安卓服务开发(二)

    关于delphi 10 移动服务开发的几张图

  5. 北京联想招聘-java 云服务开发工程师 加入qq 群:220486180 或者直接在此 留言咨询

     Position Title: 云服务开发工程师 Experience Required:  3 - 5 Years 负责联想企业网盘服务端开发  Position Requirements  1. ...

  6. (转)在SAE使用Apple Push Notification Service服务开发iOS应用, 实现消息推送

    在SAE使用Apple Push Notification Service服务开发iOS应用, 实现消息推送 From: http://saeapns.sinaapp.com/doc.html 1,在 ...

  7. 大规模web服务开发技术

    大规模web服务开发技术 总评        这本书是日本一个叫hatena的大型网站的CTO写的,通过hatena网站从小到大的演进来反应一个web系统从小到大过程中的各种系统和技术架构变迁,比较接 ...

  8. Android开发9:网络访问&Web服务开发

    前言 啦啦啦各位小伙伴们好~ 一起进入我们今天的主题.今天我们将和大家学习网络访问和Web服务开发的相关知识,一起学习熟练使用 HttpURLConnection 访问 WebService,熟悉使用 ...

  9. 构建微服务开发环境4————安装Docker及下载常用镜像

    [内容指引] 下载Docker: Mac下安装Docker: Windows下安装Docker; 下载常用docker镜像. 一.下载Docker 1.Mac适用Docker下载地址:https:// ...

  10. 构建微服务开发环境8————Hello 微服务

    [内容指引] 1.用IDEA打开微服务项目; 2.更新Maven依赖: 3.IntelliJ IDEA JDK配置; 4.修改代码: 5.运行微服务: 6.将代码变更提交到Github. 经过前面的努 ...

随机推荐

  1. Game Engine Architecture 2

    [Game Engine Architecture 2] 1.endian swap 函数 floating-point endian-swapping:将浮点指针reinterpert_cast 成 ...

  2. List和符号分隔的字符串互相转换

    一.将逗号分隔的字符串转换成List: 1. 使用JDK的Arrays类: import java.util.Arrays; import java.util.List; public class T ...

  3. 启动tomcat时报错:http-nio-8080-exec-10

    启动Tomcat后访问  http://192.168.199.10:8080/jpress-web-newest  网页,查看日志有报错 问题原因:Java的内存溢出 故障现象为: cat /app ...

  4. 使用css3实现动画来开启GPU加速

    参考文章: https://www.w3cplus.com/css3/introduction-to-hardware-acceleration-css-animations.html http:// ...

  5. Centos 7 Ntop 流量分析 安装

    Centos 6 安装 Ntop:https://www.cnblogs.com/weijie0717/p/4886314.html 一.安装 1.添加EPEL 仓库 # yum install ep ...

  6. Hillstone基础上网配置

    1.接口配置 1)进入设备管理界面后,点击左边 网络—接口: 2)选择相应的接口,点击编辑: 3)在接口配置界面中,选择接口的安全域类型(三层接口即为三层安全域,二层接口即为二层安全域).安全域名称 ...

  7. BundleConfig某js文件 全部打包

    var server = HttpContext.Current.Server; var jsFiles = System.IO.Directory.GetFiles(server.MapPath(& ...

  8. vue调试方法

    vue调试方法有如下三种 1.chrome谷歌插件vue-devtools 2.console.log().console.error().alert().debugger 3.设置全局变量,分为两种 ...

  9. centos7下编译安装nginx-1.16.0

    一.下载nginx源码 http://nginx.org/en/download.html 如:nginx-1.16.0.tar.gz 二.创建用户和组,并解压 groupadd www userad ...

  10. 分析easyswoole3.0源码,体验es3(三)

    demo在手,总得去试试看效果吧.我们先把默认的服务改成webserver,并且添加数据库的配置. 建立数据库,github里面有相关内容 CREATE TABLE `user_list` ( `us ...