servicehost

Get SvcHost assembly location (path) using SvcImplementation assembly

。_饼干妹妹 提交于 2020-01-16 05:47:27
问题 I have windows 8.1 x64, Visual Studio 2012 x86, IIS 8.5. I have Wcf Service Host project (contains svc file) <%@ ServiceHost Language="C#" Debug="true" Service="WcfServiceImplementation.MyService" %> I have Wcf Service implementation project. Wcf Service hosted in IIS I have 2 assemblies: WcfService.Host.dll and WcfServiceImplementation.dll This code in WcfServiceImplementation.dll: 1) Assembly.GetEntryAssembly() gets null. 2) Assembly.GetExecutingAssembly() gets WcfServiceImplementation. 3)

Win32Exception @ ServiceHost.Open() for WCF service

大兔子大兔子 提交于 2019-12-31 02:19:39
问题 I am working on writing BDD specifications for a broad set of WCF service infrastructure I am writing. I have noticed that each specification I write that involves a call to ServiceHost.Open(), that line takes a good 2 - 6 seconds to execute (the time keeps growing as I add more and more specs). I noticed that when this method is called, a Win32Exception is thrown: Win32Exception occurred Message: The specified domain either does not exist or could not be contacted. Stack Trace: at System

Win32Exception @ ServiceHost.Open() for WCF service

送分小仙女□ 提交于 2019-12-31 02:19:27
问题 I am working on writing BDD specifications for a broad set of WCF service infrastructure I am writing. I have noticed that each specification I write that involves a call to ServiceHost.Open(), that line takes a good 2 - 6 seconds to execute (the time keeps growing as I add more and more specs). I noticed that when this method is called, a Win32Exception is thrown: Win32Exception occurred Message: The specified domain either does not exist or could not be contacted. Stack Trace: at System

Getting “The Security Support Provider Interface (SSPI) negotiation failed” when using a ServiceHostFactory

坚强是说给别人听的谎言 提交于 2019-12-24 14:43:19
问题 I recently started using a custom ServiceHostFactory because I want to use dependency injection with WCF. Both my client and service are being run from VS2010 on my local machine and the service is using the ASP.NET Development Server. Why am I having this problem now? I've had success with wsHttpSecurity in the past, having both the client and service on my local machine. I really think the only difference here is the use of a ServiceHostFactory. I've tried using the userPrincipalName

WCF Multiple channels for one service instance

北战南征 提交于 2019-12-24 05:37:25
问题 This is my code for server application: [ServiceContract] public interface IFirst { [OperationContract] void First(); } [ServiceContract] public interface ISecond { [OperationContract] void Second(); } [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)] class Service : IFirst, ISecond { static int count = 0; int serviceID; public Service() { serviceID = ++count; Console.WriteLine("Service {0} created.", serviceID); } public void First() { Console.WriteLine("First function.

What are the benefits for several servicehosts? Does one ServiceHost support several simultaneous connections on one endpoint?

℡╲_俬逩灬. 提交于 2019-12-23 08:17:11
问题 I'm thinking of self-hosting my WCF service instead of using IIS. A big question for me is whether I need to instantiate multiple servicehosts as IIS does or one wil be enough. Do muptiple servicehosts give any benefit except security reasons dut to isolation? Can one servicehost serve multiple connections on one endpoint simultaneously? 回答1: There's no benefit or choice, really - one ServiceHost (instance of that class) can host exactly one service, and for each service, you need a separate

WCF:: ServiceHost: Oddity…Still alive even if thread is dead?

こ雲淡風輕ζ 提交于 2019-12-20 02:26:26
问题 a new member here. Nice to see such a neat community. After a bit of research, I decided to use WCF in my application to do inter process communication, so I am using the NetNamedPipeBinding binding. The ServiceHost hosting application is not a dedicated server, so it has to spawn the ServiceHost via a thread. So far so good. So I have something like the following: Foo() { Thread serverThread = new Thread(new ThreadStart(ServerThread)); serverThread.Start(); Console.WriteLine("Foo Exited"); }

WCF slow ServiceHost.Open() call

扶醉桌前 提交于 2019-12-12 13:57:59
问题 This is a similar question as this one: Win32Exception @ ServiceHost.Open() for WCF service. I have a machine that is very slow on the ServiceHost.Open call below. It consistently takes 7 seconds or so to open the service, every time. This machine is my home box, and it is not part of a domain. I can run the same code on another box (my work box) which is part of a domain and the service host opens in about 3-4 seconds on the first call, but if I run the program again the service host opens

WCF service: app.config versus attributes or a mixture of both

江枫思渺然 提交于 2019-12-11 05:06:02
问题 In a WCF application we have a servicecontract with attributes: namespace We.Work { [ServiceContract(Namespace = "We", Name = "IWork", SessionMode = SessionMode.NotAllowed)] public interface IWork an implementation of the servicecontract with attributes: namespace We.Work { [ServiceBehavior(Name = "Work", Namespace = "We", IncludeExceptionDetailInFaults = true, InstanceContextMode = InstanceContextMode.PerCall, ConcurrencyMode = ConcurrencyMode.Multiple,

WCF listen base address anyip

天涯浪子 提交于 2019-12-10 19:58:36
问题 i want my servicehost to have the base address of any IP so i tried this new ServiceHost(typeof(LoggingController),new Uri("0.0.0.0")); and it gives me invalid URI format any one knows how should i write this ? well i tried to access it from outside of my local lan and it didnt work , i made a small test software using tcpiplistener and i started listening to the same port and i set the base address of the tcpip protocol to anyip and the small test software worked so i figured out all i need