Create a IIS Log Using MSBuild Script

Feb 8, 2013 at 9:10 AM
Hi,

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
Coordinator
Feb 8, 2013 at 9:33 AM
can you post sample code of how you are using the task
Feb 8, 2013 at 10:46 AM
Hi,

<?xml version="1.0" encoding="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" 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"/>

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

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

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

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

<MSBuild.ExtensionPack.Web.Iis7Website TaskAction="AddApplication"
    Name="$(WebSiteName)"
    Applications="@(WebApplication)"/>  
<CallTarget Targets="ConfigureWebConfigConnectionStrings" />
<CallTarget Targets="ConfigureWebConfigAppSettings" />
<CallTarget Targets="ConfigureWebConfigSystemServiceModels" />
</Target>

<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>
<Target Name="Help">
<Message Text="

msbuild BuildDevIIS7.xml /t:CreateIISWebApps

Targets:
 - CreateIISWebApps

" />
</Target>

</Project>
Coordinator
Feb 8, 2013 at 11:53 AM
Right so what do you mean by "IIS log is not created " ?
Coordinator
Feb 8, 2013 at 12:00 PM
Ah, what if you use the LogDirectory property?
Feb 11, 2013 at 6:39 AM
Hi,

please tell me the syntax LogDirectory property.
Feb 15, 2013 at 5: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
Coordinator
Feb 15, 2013 at 11:05 AM
Its just a path. What have you tried?
Feb 15, 2013 at 11:13 AM
Hi Mikefourie,

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

Thanks & Regards,
Ramesh
Coordinator
Feb 15, 2013 at 12:10 PM
LogDirectoryis a path

from the help:
LogDirectory
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 10:27 AM
Hi Mikefourie,

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

Please help me.