测试Windows服务时出现问题 [英] Problem with testing a Windows service

查看:58
本文介绍了测试Windows服务时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想提供一个Windows服务来访问我的数据库.我的数据库是SQL Server 2005.

I want to make a Windows service that will access my database. My database is SQL Server 2005.

实际上,我在一个网站上工作,而我的数据库位于我们的服务器中.我需要每秒访问我的数据库并更新记录.为此,我需要提供一个Windows服务,该服务将安装到我们的服务器中并执行任务.

Actually I am working on a website and my database is inside our server. I need to access my database every second and update the records. For that purpose I need to make a Windows service that will install into our server and perform the task.

我一直在从本地计算机访问数据库,然后运行该服务,但是问题是我不确定如何测试该服务.

I have been accessing the database from my local machine and then running the service, but problem is I'm not sure how I can test this service.

我试图安装到本地计算机上.安装后,我运行了该服务,但是它没有执行任务,我认为该服务无法与数据库连接.

I tried to install into my local machine. It installed and then I ran the service but it did not perform the task and I think service is not able to connect with the database.

该服务或其安装程序没有问题.唯一的问题是如何测试我的Windows服务.

There is no problem in the service nor its installer. The only issue is how to test my Windows service.

推荐答案

您可以将Visual Studio解决方案附加到Windows Service应用程序.然后,您可以像执行普通项目一样调试Windows服务.

You can attach the visual studio solution to the windows service application. Then you can debug the windows service as you do a normal project.

调试->附加到进程.

这篇关于测试Windows服务时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆