Reputation: 715
I am using System.ServiceProcess.dll in my ASP.NET application. I added a reference and intellisense recognizes it. But when I build an application, there is no System.ServiceProcess.dll in bin folder and application says it can't find a namespace. What may be wrong? Can I use this dll in IIS?
This is what I get:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0234: The type or namespace name 'ServiceProcess' does not exist in the namespace 'System' (are you missing an assembly reference?)
Source Error:
Line 5: using System.Diagnostics;
Line 6: using System.Linq;
Line 7: using System.ServiceProcess;
Line 8: using System.Web;
Line 9: using System.Web.UI;
Upvotes: 1
Views: 2601
Reputation: 1276
Add a reference in the process to System.ServiceProcess.dll.
To do this, in the solution window, right click on "References" and choose "Add Reference.." Go to the .NET tab, and double click on System.ServiceProcess.dll.
Upvotes: 3
Reputation: 66398
Most likely you added reference to the DLL of wrong .NET version. (so it exists, but when trying to actually compile, it's breaking)
When adding the reference, make sure the version match the version of your project:
Upvotes: 0