This project is read-only.

Create a IIS Log Using MSBuild Script

Feb 8, 2013 at 10:10 AM

I am using MSBuild script to deploy the application in IIS7, successfully deploy the application, but IIS log is not created any one knows please help me. This is very urgent application in production.

Thanks & Regards,
Ramesh Kumar K
Feb 8, 2013 at 10:33 AM
can you post sample code of how you are using the task
Feb 8, 2013 at 11:46 AM

<?xml version="1.0" encoding="utf-8" ?>
<Project xmlns="" DefaultTargets="Run" ToolsVersion="3.5">
<!--/////////////////////////// START OF IMPORTS ///////////////////////////////////--> <!-- Imports required for MS Build Extensions --> <Import Project="$(MSBuildExtensionsPath)\ExtensionPack\MSBuild.ExtensionPack.tasks"/>

<Import Project="..\OTS-Config\common.targets"/>
<!-- Location of Env & IIS Web props files --> <Import Project="..\OTS-Config\common.props"/>
<!-- Import Properties file to applicable environment --> <Import Project="..\OTS-Config\local.props"/>

<WebConfigFiles Include="$(MSBuildProjectDirectory)\**\Web.Config" />   
<!--/////////////////////////// START OF TARGETS ///////////////////////////////////--> <Target Name="CreateIISWebApps">
    <WebApplication Include="/Boss01">

<MSBuild.ExtensionPack.Web.Iis7Website TaskAction="CheckExists" Name="$(WebSiteName)">
    <Output TaskParameter="Exists"  PropertyName="WebApplicationExists"/>

<MSBuild.ExtensionPack.Web.Iis7Website TaskAction="Delete" Name="$(WebSiteName)" Condition="'$(WebApplicationExists)'=='True'">

<MSBuild.ExtensionPack.Web.Iis7Website TaskAction="Create" Name="$(WebSiteName)" Port="$(PortNumber)" Path="$(WebSitePath)" AppPool="$(AppPool)">

<MSBuild.ExtensionPack.Web.Iis7Website TaskAction="AddApplication"
<CallTarget Targets="ConfigureWebConfigConnectionStrings" />
<CallTarget Targets="ConfigureWebConfigAppSettings" />
<CallTarget Targets="ConfigureWebConfigSystemServiceModels" />

<Target Name="ConfigureWebConfigSystemServiceModels">
    <MSBuild.ExtensionPack.Xml.XmlFile TaskAction="UpdateAttribute" File="$(MSBuildProjectDirectory)\project\IMS\web.config"
     XPath="/configuration/system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters/add/@prefix" Value="http://$(IMS_URL)/"/> 

<Target Name="Help">
<Message Text="

msbuild BuildDevIIS7.xml /t:CreateIISWebApps

 - CreateIISWebApps

" />

Feb 8, 2013 at 12:53 PM
Right so what do you mean by "IIS log is not created " ?
Feb 8, 2013 at 1:00 PM
Ah, what if you use the LogDirectory property?
Feb 11, 2013 at 7:39 AM

please tell me the syntax LogDirectory property.
Feb 15, 2013 at 6:45 AM
Hi Mikefourie,

Please tell me the sample syntax for LogDirectory property.This is very urgent application in production.

Thanks & Regards,
Ramesh Kumar K
Feb 15, 2013 at 12:05 PM
Its just a path. What have you tried?
Feb 15, 2013 at 12:13 PM
Hi Mikefourie,

<MSBuild.ExtensionPack.Web.Iis7Website TaskAction="Create" Name="IISLog" LogDirectory="True"/>

Thanks & Regards,
Feb 15, 2013 at 1:10 PM
LogDirectoryis a path

from the help:
Sets the directory the website writes logfiles to.

so you want something like LogFirectory="C:\mylog\mypath"
Marked as answer by mikeFourie on 10/15/2013 at 12:18 AM
Feb 28, 2013 at 11:27 AM
Hi Mikefourie,

Please Provide the whole syntax for LogDirectory property. Because floder only create does not create log file.

Please help me.