Could not install windows feature IIS - iis

I tried to reinstall iis on my windows 10 system through Control Panel\Programs and Features\ Turn Windows features on or off but after uninstalling it there is a problem with installing iis again.
Here are screenshots with all errors I'm facing at the moment:
In folder Windows/System32/inetsrv/config I recreated file named ApplicationHost.config
here is the configuration:
<?xml version="1.0" encoding="UTF-8" ?>
<configuration>
<system.applicationHost>
<applicationPools>
<add name="DefaultAppPool" />
<applicationPoolDefaults>
<processModel identityType="NetworkService" />
</applicationPoolDefaults>
</applicationPools>
<customMetadata />
<listenerAdapters>
<add name="http" />
</listenerAdapters>
<log>
<centralBinaryLogFile enabled="true" directory="%SystemDrive%\inetpub\logs\LogFiles" />
<centralW3CLogFile enabled="true" directory="%SystemDrive%\inetpub\logs\LogFiles" />
</log>
<sites>
<site name="Default Web Site" id="1">
<application path="/">
<virtualDirectory path="/" physicalPath="%SystemDrive%\inetpub\wwwroot" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:80:" />
</bindings>
</site>
<siteDefaults>
<logFile logFormat="W3C" directory="%SystemDrive%\inetpub\logs\LogFiles" />
<traceFailedRequestsLogging directory="%SystemDrive%\inetpub\logs\FailedReqLogFiles" />
</siteDefaults>
<applicationDefaults applicationPool="DefaultAppPool" />
<virtualDirectoryDefaults allowSubDirConfig="true" />
</sites>
<webLimits />
</system.applicationHost>
</configuration>
Does anyone had something like that before me and was able to run IIS again without reinstalling entire system from scratch?
If any information needed please do not hasitate to ask in comment section.
Thanks in advance :)

Thanks to #LexLi and links provided by him i was able to find out what caused the issue.
Main Link
Second one
And last which point the way to uninstall Windows Process Activation Service in Windows 10 pro not server one
Just to be sure I uninstalled:
Internet Information Services Hostable Web Core
I hope this answer would help someone in future.
Thanks again #LexLi for assistant.
Cheers!

Related

How to modify manually web application SharePoint web.config file when using asmx web service in an EventReceiver project?

First of all, I need to use an asmx web service in an EventReceiver project in Visual Studio.
Then, as common, I add a web reference by right click on the project and then Add menu then Service Reference... menu and finally web service url something like
and this my app.config project:
`
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="IntegrationService_UserSoap">
<security mode="Transport" />
</binding>
<binding name="IntegrationService_UserSoap1" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://???.???.??/services/???????/???.asmx"
binding="basicHttpBinding" bindingConfiguration="IntegrationService_UserSoap"
contract="ServiceReference1.IntegrationService_UserSoap" name="IntegrationService_UserSoap" />
</client>
</system.serviceModel>
</configuration>`
Then I'm going to modify web.config of the web application as I used to do like this:
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
<bindings>
<basicHttpBinding>
<binding name="IntegrationService_UserSoap">
<security mode="Transport" />
</binding>
<binding name="IntegrationService_UserSoap1" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://???.???.??/services/???????/???.asmx"
binding="basicHttpBinding" bindingConfiguration="IntegrationService_UserSoap"
contract="ServiceReference1.IntegrationService_UserSoap" name="IntegrationService_UserSoap" />
</client>
</system.serviceModel>
now, when I'm going to deploy the project by visual studio I've got this error:
"Error occurred in deployment step 'Activate Features': Operation is not valid due to the current state of the object."
What is wrong?

Error with WCF webservice moved to Azure VM

I have an old WCF webservice that's been moved to Azure VM.
I can easily access in Azure:
https://wcf/service.svc,
but when I try to post to:
https://wcf/service.svc/json/DoAction
it comes back with an empty response, when I open this in the browser I get 404 error.
Outside of Azure it all works fine, any ideas what can I do to get it to work? I would like to keep it running in VM as there are other items that were moved and work fine.
Here is the part of the web.config file that relates to "/json/" part:
<system.serviceModel>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<services>
<service name="Service123" behaviorConfiguration="ChallengeBehavior">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="ChallengeMessageEncoding" contract="IService123" behaviorConfiguration="SoapServiceBehavior" />
<endpoint address="/json" binding="webHttpBinding" bindingConfiguration="RestServiceMessageEncoding" contract="IService123" behaviorConfiguration="RestServiceBehavior" />
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="RestServiceBehavior">
<webHttp defaultOutgoingResponseFormat="Json" automaticFormatSelectionEnabled="true" />
</behavior>
<behavior name="SoapServiceBehavior">
</behavior>
</endpointBehaviors>
</behaviors>
<bindings>
<webHttpBinding>
<binding name="RestServiceMessageEncoding">
<security mode="None">
</security>
</binding>
</webHttpBinding>
<wsHttpBinding>
<binding name="ChallengeMessageEncoding">
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" />
<message clientCredentialType="None" establishSecurityContext="false" negotiateServiceCredential="false" />
</security>
</binding>
</wsHttpBinding>
</bindings>
</system.serviceModel>
There is no problem the code snippets seem to me. Which version IIS is installed in the Azure VM? Do you have enabled the feature supported for WCF in IIS.
I suspect that the WCF service published on the VM does not work properly. Try to publish a default WCF service application project and browse the self-introduction page.
In addition, for a specific port, you need to enable outbound/inbound permission on the firewall.
VM>>Settings>>Network
Feel free to contact me if there is anything I can help with.
#Abraham, thank you for your answer.
I finally got it working, not sure which part helped but changes I introduced included:
a) Installed additional WCF features (as above) as only 2 were installed
b) Added extra bits to web config (allowing to run URLs with dots in name /Foo.svc/Save )
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
<clear />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="/*" verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
c) Another config to support dots:
<modules runAllManagedModulesForAllRequests="true" />
d) Extended endpoints to support HTTPS as the above started working for HTTP:
<service name="PrivateService" behaviorConfiguration="PrivateBehavior">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="PrivateBehavior" contract="IPrivateService" behaviorConfiguration="SoapBehavior" />
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="PrivateBehaviorSecure" contract="IPrivateService" behaviorConfiguration="SoapBehavior" />
<endpoint address="/json" binding="webHttpBinding" bindingConfiguration="RestSecure" contract="IPrivateServices" behaviorConfiguration="RestBehavior" />
<endpoint address="/json" binding="webHttpBinding" bindingConfiguration="Rest" contract="IPrivateService" behaviorConfiguration="RestBehavior" />
</service>
...
<webHttpBinding>
<binding name="Rest">
<security mode="None">
</security>
</binding>
<binding name="RestSecure">
<security mode="Transport">
<transport clientCredentialType="None" proxyCredentialType="None" />
</security>
</binding>
</webHttpBinding>

The HTTP request was forbidden with client authentication scheme 'Anonymous'. Error when i call a service

Hi i am calling a asmx web service in my MVC project. Everything working fine on my development environment but after publishing my project i get the error "The HTTP request was forbidden with client authentication scheme 'Anonymous'". I tried a lot of methots on th internet bu they did'nt work. You can see my config down below and many thanks for help.
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="FastApiSoap">
<security mode="Transport">
<transport clientCredentialType=""/>
</security>
</binding>
</basicHttpBinding>
<customBinding>
<binding name="FastApiSoap12">
<textMessageEncoding messageVersion="Soap12" />
<httpTransport />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="http://fastsms.codec.com.tr/FastApi.asmx"
binding="basicHttpBinding" bindingConfiguration="FastApiSoap"
contract="SmsServices.FastApiSoap" name="FastApiSoap" />
<endpoint address="http://fastsms.codec.com.tr/FastApi.asmx"
binding="customBinding" bindingConfiguration="FastApiSoap12"
contract="SmsServices.FastApiSoap" name="FastApiSoap12" />
</client>
</system.serviceModel>
I found the solition. it was a bug, you can find fix on https://support.microsoft.com/en-us/help/2801679/ssl-tls-communication-problems-after-you-install-kb-931125

Multiple sites in Azure web app

My Azure web app (example.azurewebsites.net) has one custom domain, applicationhost.config:
<sites>
<site name="example" id="111111111">
<bindings>
<binding protocol="http" bindingInformation="*:80:customdomain.com" />
<binding protocol="https" bindingInformation="*:443:customdomain.com" />
<binding protocol="http" bindingInformation="*:80:example.azurewebsites.net" />
<binding protocol="https" bindingInformation="*:443:example.azurewebsites.net" />
</bindings>
<application path="/" applicationPool="example" preloadEnabled="true">
<virtualDirectory path="/" physicalPath="D:\home\site\wwwroot" />
<virtualDirectory path="/iisnodedebugger" physicalPath="C:\DWASFiles\Sites\example\Temp\iisnode" />
</application>
<traceFailedRequestsLogging enabled="false" customActionsEnabled="true" directory="D:\home\LogFiles" />
<detailedErrorLogging enabled="true" directory="D:\home\LogFiles\DetailedErrors" />
<logFile logSiteId="false" />
</site>
...
</sites>
The custom domain's bindigs are automatically added to the default site (example).
I would like to change it, i would like to create a new site with bindings to the custom domain (customdomain.com).
applicationHost.xdt (created with IIS Manager):
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<system.applicationHost>
<sites>
<site name="example" xdt:Locator="Match(name)">
<bindings>
<binding bindingInformation="*:443:customdomain.com" xdt:Locator="Match(bindingInformation)" xdt:Transform="Remove" />
<binding bindingInformation="*:80:customdomain.com" xdt:Locator="Match(bindingInformation)" xdt:Transform="Remove" />
</bindings>
</site>
<site name="customdomain" id="222222222" xdt:Transform="InsertAfter(/configuration/system.applicationHost/sites/site[(#name='example')])">
<bindings>
<binding protocol="http" bindingInformation="*:80:customdomain.com" />
<binding protocol="https" bindingInformation="*:443:customdomain.com" />
</bindings>
<application path="/" applicationPool="example" preloadEnabled="true">
<virtualDirectory path="/" physicalPath="D:\home\site\wwwroot2" />
<virtualDirectory path="/iisnodedebugger" physicalPath="C:\DWASFiles\Sites\example\Temp\iisnode" />
</application>
</site>
</sites>
</system.applicationHost>
</configuration>
After restart the transform is successfull.
The problem: it has no effect. The customdomain.com is still served from "D:\home\site\wwwroot" and not "D:\home\site\wwwroot2".
After that i deleted only the bindigs without adding the new site, customdomain still working... After that i deleted the whole site (example), example.azurewebsites.net and customdomain.com still working.
Where am I mistaken? Isn't it possible to manipulate the sites section?
May i ask why are you trying to make your life hard?
Why don't you deploy your 2nd application to a new Web App? You can share the same App Service Plan (same VM) if cost is the essence here.
Every Web App has its own custom domain settings which you can configure visually through the Portal:
https://azure.microsoft.com/en-gb/documentation/articles/web-sites-custom-domain-name/
i did this in the webconfig and it seems to work:
**<rule name="REDIRECT To Site Within a Site" enabled="true" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}"pattern="^www\.SiteWithinSiteName\.com$" />
<add input="{PATH_INFO}" pattern="^/path/SiteWithinSiteRoot/" negate="true" />
</conditions>
<action type="Rewrite" url="\path\SiteWithinSiteRoot\{R:0}" />
</rule>**

The project is not registered in applicationhost.config on IIS Express , VS 2015, 2017

I need change some confing on my project in iis express
When i opened C:\Users\Documents\IISExpress\config -> applicationhost.config file
I can not see site element of my projects.
There is only one site element in this file and its is:
<sites>
<site name="WebSite1" id="1" serverAutoStart="true">
<application path="/">
<virtualDirectory path="/" physicalPath="%IIS_SITES_HOME%\WebSite1" />
</application>
</site>
<siteDefaults>
<logFile logFormat="W3C" directory="%IIS_USER_HOME%\Logs" />
<traceFailedRequestsLogging directory="%IIS_USER_HOME%\TraceLogFiles" enabled="true" maxLogFileSizeKB="1024" />
</siteDefaults>
<applicationDefaults applicationPool="Clr4IntegratedAppPool" />
<virtualDirectoryDefaults allowSubDirConfig="true" />
</sites>
And when a new project is created, the file specification will not be logged.
I use vs 2015 , where is the problem?
VS2015 uses the file under your solution folder .vs\config\applicationHost.config.
By the way, Jexus Manager allows you to manage IIS Express settings with UI,
http://jexusmanager.com
Add the solution file or config file as a new server and then you can see the settings visually.

Resources