MSBuild Create Virtual Directory on XP (IIS 5.1) - iis

Our process for creating a new development (get latest, setup db, setup IIS directories with permissions) environment has got a little complicated and I want to automate it.
The only bit I am stuck on is creating an IIS Virtual Directory for the WCF service layer. We develop with windows XP (IIS 5.1) but will be moving to Windows 7 (IIS 7) soon.
Can anyone help please?

You can use SDC tasks for XP. Here is a sample.
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<TasksPath>$(MSBuildExtensionsPath)\MSBuildCommunityTasks\</TasksPath>
</PropertyGroup>
<Import Project="$(TasksPath)Microsoft.Sdc.Common.tasks"/>
<Target Name="Demo">
<Microsoft.Sdc.Tasks.Web.WebSite.CreateVirtualDirectory
VirtualDirectoryName="SampleVDir"
WebSiteName="Default Web Site"
Path="C:\temp\SampleWeb"
AppCreate="true" />
</Target>
</Project>
Then to exeucte msbuild.exe CreateVDir.proj /t:Demo
Where CreateVDir.proj is the name of the file.
For IIS 7 you can use MSBuild Extension Pack.
Also if you're up to it, another option is MSDeploy which is the way I would do it.

Related

IIS Virtual Directory Error After Service Pack Update

I have a Windows Server 2008 R2 server that was recently updated to SP1. For some reason this SP update broke a virtual directory hosted via IIS on that server. This virtual directory is pointed to a folder that houses some JPEG images. There's no website with it. Just a web.config file in a folder with 100 images. The server is on IIS version 7.5.
This is the error we get now.
Below is the entire contents of the web.config file.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<directoryBrowse enabled="true" />
</system.webServer>
</configuration>
What am I missing here?
I found the answer. For some reason with Windows Server 2008 R2 SP1 a Virtual Directory must be converted to an Application before it will work. Once I converted it to an application it worked just fine.

How do I configure a .net core API to work in IIS?

I've got a .net core API created in Visual Studio 2017 that's working fine. When I go to deploy it I get error message HTTP Error 500.19 with error code 0x8007000d. I've found multiple solutions online such as making sure windows features are installed, removing the .net CLR version, changing the application pool identity, changes to web.config and applicationHost.config, but nothing has worked. Is there a way to definitively find what the problem is or am I stuck doing trial and error with the myriad of possible solutions? Any specific solutions you know of?
Here are screenshots of the IIS settings and my Windows features:
Here's my web.config file:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!--
Configure your application settings in appsettings.json. Learn more at http://go.microsoft.com/fwlink/?LinkId=786380
-->
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*"
modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet"
arguments=".\DishbooksAPI.dll"
stdoutLogEnabled="false"
stdoutLogFile=".\logs\stdout"
forwardWindowsAuthToken="false" />
</system.webServer>
</configuration>
Here's the IIS error:
Some stackoverflow pages I've tried (this is not an exhaustive list):
HTTP Error 500.19 when publish .net core project into iis
HTTP Error 500.19 with Error Code 0x8007000d visual studio 2017 while deploying .net core application
ASP.NET: HTTP Error 500.19 – Internal Server Error 0x8007000d
HTTP Error 500.19 - Internal Server Error web config .net core web api
asp.net core web api published in IIS after moved to different IIS server pc gives error 500.19
First of all, you need to install ASP.NET Core Module in web server.
Here is the download link.
Then install either SDK or Runtime in web server.
Trouble Shooting
If it still doesn't work, open a command prompt. Navigate to the web application folder and type dotnet YOUR_APP.dll. You should see something like this -
C:\APIs> dotnet YOUR_APP.dll
Hosting environment: Production
Content root path: C:\APIs
Now listening on: http://localhost:5000
Application started: Press Ctrl+C to shut down.
It means your application can run in the web server without IIS. Then you need to trouble shoot in IIS or some other things.
You would need the hosting bundle to be installed on IIS
https://dotnet.microsoft.com/download/dotnet-core
Steps :
click the preferred version
Search for 'Hosting Bundle' word (should be on the right side)
Install the same
re-start IIS. And validate your site and see the magic
Why Hosting bundle is needed? Check following article
https://dotnetcoretutorials.com/2019/12/23/hosting-an-asp-net-core-web-application-in-iis/
How to check if hosting is installed?
How to determine if asp.net core has been installed on a windows server

Core 2.0 Publish IIS HTTP Error 500.19 - Internal Server Error

I have read a lot of post with the same error I have. The problem I have is that I have it running on the same machine I developed the solution.
I have Windows 8.1 and IIS 7.5. Express I am running several MVC Framework XXX solutions on me IIS and I do not have problems. The problems appears when I publish a solution Core 2.0...
I have created a basic Web Core 2.0 MVC solution. Just the same project it is created by Default. (Created an Core 2.0 MVC and Publish it).
I have Visual Studio 2017, so I have installed SDK installed.
I have created a site in IIS (inetpub/wwwroot) for it, drop in the published code, and configure the App Pool to run "No Managed Code". I set port to 5010.
When I run the Project from cmd: dotnet core20.dll it says it is running listening on port 5000, instead on port 5010.
So, i set port 5000, but when i run it from cmd it shows an error.
Microsft.AspNetCore.Server.Kestrel[0] Unable to bind to localhost:5000 on the IPv4 loopback interface: Error 4092 EACCES permission denied. Unabled to start Kestrel.
Why it runs on port 5000 if I set on port 5010?
When I run it from Browser i have this error
My web.Config is the basic web.config created ruting the publishing..
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\core20.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</configuration>
<!--ProjectGuid: 21dc60b6-a958-447d-8ed3-25a6195a06ea-->
On Windows Features turn on or off--> IIS Services--> Application Development Features, all options are selected
The error I have
I have the same problem with Core 2.0 Angular Application... So I miss to install something.
I have not installed the .NET Core Windows Server Hosting bundle. I do not know it is necessary.
I do not know if i have to install Kestrel, or how to install it.
I asume all this has to be installed when I installed Visual Studio 2017.
Any ideas what I am missing?
thanks
I have not installed the .NET Core Windows Server Hosting bundle. I do not know it is necessary.
There's your problem. Install the hosting bundle. Without it, IIS has no idea how to handle an ASP.NET Core app. In particular, your error here is because the <aspNetCore> tag doesn't exist for usage by Web.config, without that bundle either. So, while the error is a bit obtuse, it is technically telling you what the issue is.
Additionally, after installing the bundle, you must either restart your server or completely stop and restart the IIS service (not iisreset):
> net stop was /y
> net start w3svc
It's better to restart the server entirely, if you can, just to make sure everything is fresh, but starting and stopping web services should be enough to load in the ASP.NET Core module.
All of this is covered in the documentation.

MVC 6 Hosted on IIS HTTP Error 500.19

Am getting HTTP Error 500.19 when accessing MVC 6 app in IIS on Windows 10.
In IIS I have set the App pool to 'No Managed Code'
The app is hosted in the root of a new Web Site.
I published the app using Visual Studio 2015 with the following settings.
Configuration : Debug
Target DNX Version: dnx-clr-win-x64.1.0.0-rc1-update1
The web.config is the boilerplate provided by Visual Studio
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified"/>
</handlers>
<httpPlatform processPath="%DNX_PATH%" arguments="%DNX_ARGS%" stdoutLogEnabled="false" startupTimeLimit="3600"/>
</system.webServer>
</configuration>
Any ideas what is going wrong?
Thanks
Mike
For RC2 and above, HttpPlatformHandler has been replaced by ASP.NET Core Module
Install the new module from here.
The announcement can be found here.
Figured it out, I needed to install the httpplatformhandler
http://www.iis.net/downloads/microsoft/httpplatformhandler
You have to install the "Hosting Bundle Installer". Without this, IIS doesn't understand routing and cannot host your application.
Go to microsoft site "https://www.microsoft.com/net/download/dotnet-core/runtime-2.1.0-rc1" and install "Hosting Bundle Installer":
Before installing this you have to install the right version of runtime:
https://www.microsoft.com/net/download/dotnet-core/runtime-2.1.0-rc1
Than install the right version of "Hosting Bundle Installer".
"Hosting Bundle Installer" is:
.NET Core Windows Server Hosting bundle installs the .NET Core Runtime, .NET Core Library,
and the ASP.NET Core Module. The module creates a reverse proxy between IIS and the Kestrel server on Windows platforms.

How to configure IIS with IBM WebSphere Application Server Liberty Profile?

I am trying to setup IIS (version 8.x, windows 2008) in front of IBM WAS(Liberty Profile) server so that it can route all specific requests to IBM WebSphere application server(Liberty Profile).
I have already installed & configured following items :
Installed IBM WebSphere Application Server Liberty Core (Version 8.5.5)
Installed IBM MobileFirst Platform Server (Verison 7.1)
Installed WebServer Plugins for IBM WAS
Installed IBM WebSphere Customization Toolbox (Version 8.5)
I have also deployed one MobileFirst Runtime and it's working totally fine. Now the only step remaining is configuration with IIS.
I am following below link, But could not understand it thoroughly :
https://www-01.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.nd.doc/ae/tins_manualWebIIS.html
As I have installed IBM WAS Liberty Core, It did note come up with any IBM JAVA SDK. Is It required? How can I install IBM Java SDK for IBM WAS Liberty?
I am really lost about what should be the first step.
Edit on 24/09/2015 :
I downloaded & installed IBM Java SDK for Liberty Core.
I generated plugin-cfg.xml
I configured IIS with plugin-cfg.xml using this link : https://www-01.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.nd.doc/ae/tins_manualWebIIS.html
Now all application requests are redirecting to IBM WAS.
When I hit, localhost/HelloWorld/apps/services/www/HelloWorld/desktopbrowser/default/index.html, HelloWorld app is working totally fine.
Now the only problem is when I hit /worklightconsole, It is not able to get deployed application and adapters.
My plugin-cfg.xml looks like this :
<?xml version="1.0" encoding="UTF-8"?>
<Config ASDisableNagle="false" AcceptAllContent="false" AppServerPortPreference="HostHeader" ChunkedResponse="false" FIPSEnable="false" IISDisableNagle="false" IISPluginPriority="High" IgnoreDNSFailures="false" RefreshInterval="60" ResponseChunkSize="64" SSLConsolidate="false" TrustedProxyEnable="false" VHostMatchingCompat="false">
<Log LogLevel="Error" Name=".\logs\defaultServer\http_plugin.log"/>
<Property Name="ESIEnable" Value="true"/>
<Property Name="ESIMaxCacheSize" Value="1024"/>
<Property Name="ESIInvalidationMonitor" Value="false"/>
<Property Name="ESIEnableToPassCookies" Value="false"/>
<Property Name="PluginInstallRoot" Value="."/>
<VirtualHostGroup Name="default_host">
<VirtualHost Name="*:443"/>
<VirtualHost Name="*:9443"/>
<VirtualHost Name="*:80"/>
<VirtualHost Name="*:9080"/>
</VirtualHostGroup>
<ServerCluster CloneSeparatorChange="false" GetDWLMTable="false" IgnoreAffinityRequests="true" LoadBalance="Round Robin" Name="defaultServer_default_node_Cluster" PostBufferSize="0" PostSizeLimit="-1" RemoveSpecialHeaders="true" RetryInterval="60">
<Server CloneID="89f03a0d-7c05-4c33-a82c-12da20477cdd" ConnectTimeout="5" ExtendedHandshake="false" MaxConnections="-1" Name="default_node_defaultServer0" ServerIOTimeout="900" WaitForContinue="false">
<Transport Hostname="localhost" Port="9080" Protocol="http"/>
<Transport Hostname="localhost" Port="9443" Protocol="https">
<Property Name="keyring" Value="keyring.kdb"/>
<Property Name="stashfile" Value="keyring.sth"/>
<Property Name="certLabel" Value="LibertyCert"/>
</Transport>
</Server>
<PrimaryServers>
<Server Name="default_node_defaultServer0"/>
</PrimaryServers>
</ServerCluster>
<UriGroup Name="default_host_defaultServer_default_node_Cluster_URIs">
<Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/RestProject/*"/>
<Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/wladmin/*"/>
<Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/HelloWorld/*"/>
<Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/IBMJMXConnectorREST/*"/>
<Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/worklightconsole/*"/>
</UriGroup>
<Route ServerCluster="defaultServer_default_node_Cluster" UriGroup="default_host_defaultServer_default_node_Cluster_URIs" VirtualHostGroup="default_host"/>
</Config>
I am getting following errors :
Failed request: /worklightconsole/services/management-apis/1.0/runtimes/HelloWorld/applications
Failed request: /worklightconsole/services/management-apis/1.0/runtimes/HelloWorld
Failed request: /worklightconsole/services/management-apis/1.0/runtimes/HelloWorld/adapters?offset=0&pageSize=15
Any help would be highly appreciated.
Just to summarize all the links and steps:
On the machine that you have IIS you have to install WebSphere plugin and WebSphere Customization Toolbox - follow steps provided in Configuring a web server plug-in for the Liberty profile and in Installing and using the WebSphere Customization Toolbox
You should be able to configure IIS automatically via Toolbox, if you cant for some reason, here are manual stepsConfiguring Microsoft Internet Information Services (IIS)
On your Liberty Core machine, you probably already have Java configured if the MobileFirst runtime is working fine, if not you have to download WebSphere Java SDK also via Installation Manager for details see Installing and uninstalling SDK Java Technology Edition Version 7.0 or 7.1 for Liberty
If your applications are working directly, but not via IIS, you have to generate new plugin configuration file in Liberty via jconsole (follow the steps in the first link) and copy it to the path pointed in the IIS WebSphere plugin configuration.

Resources