Deploy WCF to Windows 2016 IIS

After many years of non-development, IIS will not be used.

WCF was tested with C # fx4.5 and I want to publish it to a test virtual server running Windows 2016. This server originally only tested SQL2016, so first add the Web Server role . The default option goes up. The fx4.6 function is available by default, so it doesn't matter.

Then add the application. Why is there only 4.0 in the application pool? No matter, force my WCF cloth to say it again. Sure enough, 500 is wrong.

Certainly something is wrong. Measured from the static HTML page that comes with the default site. It is accessible. In the default site, add a test.aspx file for testing, which contains only a sentence <% = System.DateTime.Now.ToString ()%>, and I get a 404 error after access. This confirms that asp.net is not enabled. Check the IIS role configuration carefully, there is a hole, there is "application development" to choose under the Web server options. . . So chose asp.net4.6 . Retest test.aspx, it really can be displayed. I happily changed the URL to my svc in the browser, but it was still 404.

Copy a copy of test.aspx to my application directory and run it. Then explain what wcf related functions are not enabled. Check again, and it turns out that under the Framework function, the WCF service also needs to enable http activation .

Finally, I deleted my application and rebuilt it. The application pool used v4.5 classic, and the once familiar svc page finally appeared again.

By the way, many articles on the Internet say that you need to use commands such as aspnet_regiis and serviceModelReg to repair, and win server 2016 seems to be no longer supported.

==========

C # call pit:
report that application / soap + xml is incompatible with text / xml: In the client app.config, the <binding name = "...." /> section needs to be expanded and insert a section of <security mode = " None "/>

Raspberry Pi call:
It's easier than using C # to develop Client, suds directly supports it, no tossing. . .
 

Published 122 original articles · Like 61 · Visits 530,000+

Guess you like

Origin blog.csdn.net/ki1381/article/details/93850164