0

Can you add a refference to System.Web.dll in aWcfServiceLibrary.

I want to create a Wcf service that executes a EXE on the server. For this I have the following code:

 System.Diagnostics.Process process1 = new System.Diagnostics.Process();
        process1.StartInfo.WorkingDirectory = System.Web.Request.MapPath("~/view");
        process1.StartInfo.Arguments = "arguments";
        process1.StartInfo.FileName = Request.MapPath("WindowsMediaPlayer.exe");
        process1.Start();

but the problem is that Request is in System.Web.dll and this assemblt does not appear in the list of assemblies that I can add as refference to a WcfServiceLibrary.

What would you suggest?

Ryan
  • 5,456
  • 25
  • 71
  • 129
  • I am not sure why you do not have system.web in your assemblies list as I have many WCF services that have references to it. – CSharpened Nov 28 '11 at 11:56
  • Can you add reference to System.Web from a WCF service library project? What kind of project did you create that alows you to add such a refference? – Ryan Nov 28 '11 at 12:02
  • Yes I have created both standard WCF projects and also WCF service libraries all of which have allowed me to add in a using directive to system.web. I should clarify that I do not add as a reference, as that should be added automatically on creation of the project, but rather a using directive e.g. Using System.Web; – CSharpened Nov 28 '11 at 12:05

1 Answers1

0

If you are using Visual Studio and .Net 4.0 it always defaults your service to .net 4.o client profile as target framework. Go to the properties of the service and change it to regular .net 4.o then you can add the reference.