I have developed (in VS2010 - on a machine with Windows 7) a small solution which contains a WCF Service library and a Windows Service for hosting that WCF service. The App.config which is in my WCF service is:
This file is also in my windows service with the same configurations.
My service code is something very simple:
File IService1.cs: using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.ServiceModel; using System.Text; namespace WcfServiceLibrary1 { // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together. [ServiceContract] public interface IService1 { [OperationContract] string GetData(int value); } }
and file Service1.cs:
using System;
using System.Collections.Generic;
using System.Linq; using System.Runtime.Serialization;
using System.ServiceModel; using System.Text;
namespace WcfServiceLibrary1 { // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in both code and config file together. public class Service1 : IService1 { public string GetData(int value) { return string.Format("You entered: {0}", value); } } }
I have added an Installer where I configured properties: Account: NetworkService for serviceProcessInstaller
and StartType: Automatic for serviceInstaller.
I built the project, after that I install the windows service with InstallUtil. After that I looked in my log file if something is wrong. Unfortunately, I didn't find anything. Atfer that I enter in Computer Management (I have Windows 7 and VS2010) and I started my Windows Service. After that I looked again in my log file and in Logs from Event Viewer (from Application), but again I didn't find anything.
Unfortunately, when I want to consume (to register) that address, I can't do this thing. I tried with Add Service refference and after that with SvcUtil but the result is the same.
When I want to add service address net.tcp://localhost:8001/Service1 with Add Service Refference it appears on the screen An error (Detail) occured while attempting to find services at 'net.tcp://localhost:8001/Service1'.
I checked the metadata addressed, but it seems that it's OK. Maybe I'm wrong of course.
I run netstats -ap tcp and I didn't see my TCP protocol: 8001.
Please help me and tell me what it's wrong.
Sincerely Yours,
Florin G