首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >错误5:启动windows服务时访问被拒绝

错误5:启动windows服务时访问被拒绝
EN

Stack Overflow用户
提问于 2010-11-24 21:00:38
回答 31查看 284.3K关注 0票数 108

当我尝试启动在C#中创建的windows服务时,收到以下错误:

到目前为止我的代码:

代码语言:javascript
复制
private ServiceHost host = null;

public RightAccessHost()
{
    InitializeComponent();
}

protected override void OnStart(string[] args)
{
    host = new ServiceHost(typeof(RightAccessWcf));
    host.Open();
}

protected override void OnStop()
{
    if (host != null)
        host.Close();
    host = null;
}

更新#1

我通过授予账号网络服务的权限解决了上面的问题,但现在我有另一个问题:

更新#2

无法启动

服务。System.InvalidOperationException:服务'RightAccessManagementWcf.RightAccessWcf‘没有应用程序(非基础结构)终结点。这可能是因为找不到应用程序的配置文件,也可能是因为在配置文件中找不到与服务名称匹配的服务元素,或者是因为在服务元素中没有定义终结点。在System.ServiceModel.Description.DispatcherBuilder.EnsureThereAreNonMexEndpoints(ServiceDescription描述)在System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(ServiceDescription描述,在超时)在System.ServiceModel.ServiceHostBase.InitializeRuntime()在System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan超时)在System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan超时)在RightAccessHosting.RightAccessHost.OnStart(String[]参数)在C:\ ServiceHostBase ...

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/4267051

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档