windows - how to resolve this issue "the type or namespace name 'service' could not be found" in C# -


i working on project of c# using visual studio 2010, in need running services of system servicecontroller[] scservices = servicecontroller.getservices() , need manipulate result, there need these objects help, whenever declaring it's showing "the type or namespace name 'service' not found", have added reference , using system.serviceprocess.

service rsvc = new service();      list<service> rsvclist = new list<service>();   listservicesreply rreply = new listservicesreply(); 

can me out, how rid of this?

imo, there 2 possible reasons error.

  1. in application have namespace = service. in case, compiler finds ambiguous resolve 'service'. suggested in comments, using qualified namespace help.

  2. there dependent assembly reference missing in project. in case, running msbuild more logging help. can use following command visual studio command prompt (msdn reference)

    msbuild /verbosity:detailed yourpath/yoursolution.sln


Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -