@echo.
@if exist "%windir%\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe" goto INSTALL4.0

:INSTALL4.0
@echo ◎ 开始安装服务2.0
@%windir%\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe   xx.Service
@echo.
@echo √ 服务安装完成!
@goto Ed
 
:ERR
@echo.
@echo × 程序运行期间出错,安装过程失败,请重新安装本软件!
@echo off

:Ed
@echo.
@echo 按任意键退出......
@pause>nul
@exit

//***********************************************************************************************

如上,

在初始化安装时发生异常:
System.IO.FileNotFoundException:
"file:///D:\testService"未能加载文件或程序集。系统找不到指定文件。

原因是:

InstallUtil  WindowsService1.exe

把  “.exe" 加上

正确的命令行:

@echo.
@if exist "%windir%\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe" goto INSTALL4.0

:INSTALL4.0
@echo ◎ 开始安装服务2.0
@%windir%\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe   xx.Service.exe
@echo.
@echo √ 服务安装完成!
@goto Ed
 
:ERR
@echo.
@echo × 程序运行期间出错,安装过程失败,请重新安装本软件!
@echo off

:Ed
@echo.
@echo 按任意键退出......
@pause>nul
@exit

服务 在初始化安装时发生异常:System.IO.FileNotFoundException: "file:///D:\testService"未能加载文件或程序集。系统找不到指定文件。的更多相关文章

  1. 服务 在初始化安装时发生异常:System.IO.FileNotFoundException: 未能加载文件或******

    这个问题是在用installutil.exe安装服务时候碰到的 解决方法就是把installutil.exe文件直接复制到要安装的目录下 installutil.exe的所在位置 windows/mi ...

  2. .net应用程序安装部署时异常 Error 1001. 在初始化安装时发生异常 System.BadImageFormatException:未能加载文件或程序集 的解决办法【成功解决】

    采用.net 4.0框架开发的一个桌面应用程序在某学校的一体机(Windows7的32位操作系统)上做安装部署时抛出异常,安装程序回滚,多次尝试仍不成功. Error 1001. 在初始化安装时发生异 ...

  3. 未能加载文件或程序集“System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35”或它的某一个依赖项。系统找不到指定的文件

    ASP.NET 运行时错误:针对类型System.Web.Mvc.PreApplicationStartCode的应用程序邓启动初始化方法Start 引发了异常,显示下列错误消息: 未能加载文件或程序 ...

  4. .net安装部署“Error 1001 在初始化安装时发生异常” 的解决方法

    状况描述:打包安装后,如果删除安装目录中的某个文件,这时从桌面快捷方式启动软件系统会自动运行修复程序,此时因为路径问题会报出“错误 1001 在初始化安装时发生异常xxx”的异常.(前提是你的安装部署 ...

  5. “System.BadImageFormatException”类型的未经处理的异常在 PurchaseDevices.Access.dll 中发生 其他信息: 未能加载文件或程序集“System.Data.SQLite, Version=1.0.66.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139”或它的某一个依赖项。试图加载格式不正确

    引用sqlite的程序集时,有时会报如下异常:  "System.BadImageFormatException"类型的未经处理的异常在 PurchaseDevices.Acces ...

  6. 使用Autofac部署IIS6.0时未能加载文件或程序集“System.Core, Version=2.0.5.0...“

    错误信息 .net4.0项目中使用autofac这个IOC容器,在部署在win2003+iis6时出现以下错误. “/”应用程序中的服务器错误. --------------------------- ...

  7. 创建 userSettings/Microsoft.SqlServer.Configuration.LandingPage.Properties.Settings 的配置节处理程序时出错: 未能加载文件或程序集“System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”或它的某一个依赖项。系统没找到指定的文件

    创建 userSettings/Microsoft.SqlServer.Configuration.LandingPage.Properties.Settings 的配置节处理程序时出错: 未能加载文 ...

  8. Microsoft.EntityFrameworkCore.Internal.ServiceProviderCache的类型初始值设定项引发异常。 ---> System.IO.FileLoadException: 未能加载文件或程序集

    场景: 安装程序到全新的环境的电脑时中(此时已经安装了能正常安装程序电脑的环境) 完整错误: Application_ThreadException:System.TypeInitialization ...

  9. 异常详细信息: System.IO.FileLoadException: 未能加载文件或程序集“Office, Version=7.0.3300.0,

    导出Excel程序调试起来很正常,发布到服务器上却出错. 错误:未能加载文件或程序集“Office, Version=2.2.0.0, Culture=neutral, PublicKeyToken= ...

随机推荐

  1. Java集合与算法

    梗概: 集合接口 集合实现(链表.数组列表.散列集.树集.队列与双端队列.映射表) 集合与数组之间的转换 算法(排序.二分查找). 文章链接: http://mp.weixin.qq.com/s?__ ...

  2. SVN的部署及分支等方法

    1.本地Repository的创建 repository的创建很简单,假设我要在D:\TortoiseSVN\TestRepository目录中创建repository,只需 右键TestReposi ...

  3. c# 强制转换, 隐式转换, 显式转换

    using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threa ...

  4. Mac OS 后台服务注册

    /Library/LaunchAgents/ /Library/LaunchDaemons

  5. iOS学习之iOS沙盒(sandbox)机制和文件操作(二)

    1.获取程序的Home目录 NSString *homeDirectory = NSHomeDirectory(); NSLog(@"path:%@", homeDirectory ...

  6. Course Schedule

    There are a total of n courses you have to take, labeled from 0 to n - 1. Some courses may have prer ...

  7. PAT (Advanced Level) Practise:1001. A+B Format

    [题目链接] Calculate a + b and output the sum in standard format -- that is, the digits must be separate ...

  8. 【科普】为什么WiFi自动信道选到的信道多数在1/6/11

    http://bbs.hiwifi.com/thread-4126-1-1.html 论坛上不少朋友很困惑,为什么小极的自动信道选择选到的信道只会在1.6.11这三个信道呢?WiFi不是一共有10几个 ...

  9. python 字符串编码转换

    import chardetdef CheckCode(filename): adchar=chardet.detect(filename) if adchar['encoding']=='utf-8 ...

  10. python2 与 python3 urllib的互相对应关系

    urllib Python2 name Python3 nameurllib.urlopen() Deprecated. See urllib.request.urlopen() which mirr ...