Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
328 views
in Technique[技术] by (71.8m points)

c# - WCF windows form not working in .exe but working in visual studio

I will appreciate if you have any idea for my issue.

Followed MS WCF direction to create a client server console app and working fine running as administrator at DOS prompt. Then I changed the console app to windows forms but it won't run as administrator at file explorer (can't find the service). But if I run the server form at Visual Studio, then I can run client form at file explorer (no need to be administrator). If I run the server form at file explorer, I can run client form at Visual Studio.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

After you host the wcf service in the application, you can find the bin in your project folder and then find the shortcut of your compiled program in this directory, so that the wcf service can be hosted in this process and not Occupy visual studio. Then run your client program in vs to call the wcf service. Compile the program which host the WCF service, and the folder where the shortcut is located will be displayed after success.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...