Commit 51ba273a authored by Mehmet Umut Kürtül's avatar Mehmet Umut Kürtül
Browse files

Initial commit

parents
<configuration>
<system.web>
<pages>
<controls>
<add assembly="Microsoft.AspNet.Web.Optimization.WebForms"
namespace="Microsoft.AspNet.Web.Optimization.WebForms"
tagPrefix="webopt" />
</controls>
</pages>
</system.web>
</configuration>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<RoslynToolPath Condition=" '$(RoslynToolPath)' == '' ">$(MSBuildThisFileDirectory)..\..\tools\roslyn45</RoslynToolPath>
</PropertyGroup>
</Project>
\ No newline at end of file
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Extensions.props"/>
<ItemGroup>
<RoslynCompilerFiles Include="$(RoslynToolPath)\*">
<Link>roslyn\%(RecursiveDir)%(Filename)%(Extension)</Link>
</RoslynCompilerFiles>
</ItemGroup>
<Target Name="IncludeRoslynCompilerFilesToFilesForPackagingFromProject" BeforeTargets="PipelineCollectFilesPhase" >
<ItemGroup>
<FilesForPackagingFromProject Include="@(RoslynCompilerFiles)">
<DestinationRelativePath>bin\roslyn\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
<FromTarget>IncludeRoslynCompilerFilesToFilesForPackagingFromProject</FromTarget>
<Category>Run</Category>
</FilesForPackagingFromProject>
</ItemGroup>
</Target>
<Target Name="LocateRoslynToolsDestinationFolder" Condition=" '$(RoslynToolsDestinationFolder)' == '' ">
<PropertyGroup>
<RoslynToolsDestinationFolder>$(WebProjectOutputDir)\bin\roslyn</RoslynToolsDestinationFolder>
<RoslynToolsDestinationFolder Condition=" '$(WebProjectOutputDir)' == '' ">$(OutputPath)\roslyn</RoslynToolsDestinationFolder>
</PropertyGroup>
</Target>
<Target Name="CopyRoslynCompilerFilesToOutputDirectory" AfterTargets="CopyFilesToOutputDirectory" DependsOnTargets="LocateRoslynToolsDestinationFolder">
<Copy SourceFiles="@(RoslynCompilerFiles)" DestinationFolder="$(RoslynToolsDestinationFolder)" ContinueOnError="true" SkipUnchangedFiles="true" Retries="0" />
<ItemGroup Condition="'$(MSBuildLastTaskResult)' == 'True'" >
<FileWrites Include="$(RoslynToolsDestinationFolder)\*" />
</ItemGroup>
</Target>
<Target Name="CheckIfShouldKillVBCSCompiler">
<CheckIfVBCSCompilerWillOverride src="$(RoslynToolPath)\VBCSCompiler.exe" dest="$(RoslynToolsDestinationFolder)\VBCSCompiler.exe">
<Output TaskParameter="WillOverride" PropertyName="ShouldKillVBCSCompiler" />
</CheckIfVBCSCompilerWillOverride>
</Target>
<Target Name = "KillVBCSCompilerBeforeCopy" BeforeTargets="CopyRoslynCompilerFilesToOutputDirectory" DependsOnTargets="LocateRoslynToolsDestinationFolder;CheckIfShouldKillVBCSCompiler" >
<KillProcess ProcessName="VBCSCompiler" ImagePath="$(RoslynToolsDestinationFolder)" Condition="'$(ShouldKillVBCSCompiler)' == 'True'" />
</Target>
<Target Name = "KillVBCSCompilerBeforeClean" AfterTargets="BeforeClean" DependsOnTargets="LocateRoslynToolsDestinationFolder">
<KillProcess ProcessName="VBCSCompiler" ImagePath="$(RoslynToolsDestinationFolder)" />
</Target>
<UsingTask TaskName="KillProcess" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<ParameterGroup>
<ProcessName ParameterType="System.String" Required="true" />
<ImagePath ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Reference Include="System" />
<Reference Include="System.Management" />
<Using Namespace="System" />
<Using Namespace="System.Linq" />
<Using Namespace="System.Diagnostics" />
<Using Namespace="System.Management" />
<Code Type="Fragment" Language="cs">
<![CDATA[
try
{
foreach(var p in Process.GetProcessesByName(ProcessName))
{
var wmiQuery = "SELECT ProcessId, ExecutablePath FROM Win32_Process WHERE ProcessId = " + p.Id;
using(var searcher = new ManagementObjectSearcher(wmiQuery))
{
using(var results = searcher.Get())
{
var mo = results.Cast<ManagementObject>().FirstOrDefault();
Log.LogMessage("ExecutablePath is {0}", (string)mo["ExecutablePath"]);
if(mo != null && ((string)mo["ExecutablePath"]).StartsWith(ImagePath, StringComparison.OrdinalIgnoreCase))
{
p.Kill();
p.WaitForExit();
Log.LogMessage("{0} is killed", (string)mo["ExecutablePath"]);
break;
}
}
}
}
}
catch (Exception ex)
{
Log.LogErrorFromException(ex);
}
return true;
]]>
</Code>
</Task>
</UsingTask>
<UsingTask TaskName="CheckIfVBCSCompilerWillOverride" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<ParameterGroup>
<Src ParameterType="System.String" Required="true" />
<Dest ParameterType="System.String" Required="true" />
<WillOverride ParameterType="System.Boolean" Output="true" />
</ParameterGroup>
<Task>
<Reference Include="System.IO" />
<Code Type="Fragment" Language="cs">
<![CDATA[
WillOverride = false;
try {
WillOverride = File.Exists(Src) && File.Exists(Dest) && (File.GetLastWriteTime(Src) != File.GetLastWriteTime(Dest));
}
catch { }
]]>
</Code>
</Task>
</UsingTask>
</Project>
\ No newline at end of file
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<RoslynToolPath Condition=" '$(RoslynToolPath)' == '' ">$(MSBuildThisFileDirectory)..\..\tools\roslynlatest</RoslynToolPath>
</PropertyGroup>
</Project>
\ No newline at end of file
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Extensions.props"/>
<ItemGroup>
<RoslynCompilerFiles Include="$(RoslynToolPath)\*">
<Link>roslyn\%(RecursiveDir)%(Filename)%(Extension)</Link>
</RoslynCompilerFiles>
</ItemGroup>
<Target Name="IncludeRoslynCompilerFilesToFilesForPackagingFromProject" BeforeTargets="PipelineCollectFilesPhase" >
<ItemGroup>
<FilesForPackagingFromProject Include="@(RoslynCompilerFiles)">
<DestinationRelativePath>bin\roslyn\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
<FromTarget>IncludeRoslynCompilerFilesToFilesForPackagingFromProject</FromTarget>
<Category>Run</Category>
</FilesForPackagingFromProject>
</ItemGroup>
</Target>
<Target Name="LocateRoslynToolsDestinationFolder" Condition=" '$(RoslynToolsDestinationFolder)' == '' ">
<PropertyGroup>
<RoslynToolsDestinationFolder>$(WebProjectOutputDir)\bin\roslyn</RoslynToolsDestinationFolder>
<RoslynToolsDestinationFolder Condition=" '$(WebProjectOutputDir)' == '' ">$(OutputPath)\roslyn</RoslynToolsDestinationFolder>
</PropertyGroup>
</Target>
<Target Name="CopyRoslynCompilerFilesToOutputDirectory" AfterTargets="CopyFilesToOutputDirectory" DependsOnTargets="LocateRoslynToolsDestinationFolder">
<Copy SourceFiles="@(RoslynCompilerFiles)" DestinationFolder="$(RoslynToolsDestinationFolder)" ContinueOnError="true" SkipUnchangedFiles="true" Retries="0" />
<ItemGroup Condition="'$(MSBuildLastTaskResult)' == 'True'" >
<FileWrites Include="$(RoslynToolsDestinationFolder)\*" />
</ItemGroup>
</Target>
<Target Name="CheckIfShouldKillVBCSCompiler">
<CheckIfVBCSCompilerWillOverride src="$(RoslynToolPath)\VBCSCompiler.exe" dest="$(RoslynToolsDestinationFolder)\VBCSCompiler.exe">
<Output TaskParameter="WillOverride" PropertyName="ShouldKillVBCSCompiler" />
</CheckIfVBCSCompilerWillOverride>
</Target>
<Target Name = "KillVBCSCompilerBeforeCopy" BeforeTargets="CopyRoslynCompilerFilesToOutputDirectory" DependsOnTargets="LocateRoslynToolsDestinationFolder;CheckIfShouldKillVBCSCompiler" >
<KillProcess ProcessName="VBCSCompiler" ImagePath="$(RoslynToolsDestinationFolder)" Condition="'$(ShouldKillVBCSCompiler)' == 'True'" />
</Target>
<Target Name = "KillVBCSCompilerBeforeClean" AfterTargets="BeforeClean" DependsOnTargets="LocateRoslynToolsDestinationFolder">
<KillProcess ProcessName="VBCSCompiler" ImagePath="$(RoslynToolsDestinationFolder)" />
</Target>
<UsingTask TaskName="KillProcess" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<ParameterGroup>
<ProcessName ParameterType="System.String" Required="true" />
<ImagePath ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Reference Include="System" />
<Reference Include="System.Management" />
<Using Namespace="System" />
<Using Namespace="System.Linq" />
<Using Namespace="System.Diagnostics" />
<Using Namespace="System.Management" />
<Code Type="Fragment" Language="cs">
<![CDATA[
try
{
foreach(var p in Process.GetProcessesByName(ProcessName))
{
var wmiQuery = "SELECT ProcessId, ExecutablePath FROM Win32_Process WHERE ProcessId = " + p.Id;
using(var searcher = new ManagementObjectSearcher(wmiQuery))
{
using(var results = searcher.Get())
{
var mo = results.Cast<ManagementObject>().FirstOrDefault();
Log.LogMessage("ExecutablePath is {0}", (string)mo["ExecutablePath"]);
if(mo != null && ((string)mo["ExecutablePath"]).StartsWith(ImagePath, StringComparison.OrdinalIgnoreCase))
{
p.Kill();
p.WaitForExit();
Log.LogMessage("{0} is killed", (string)mo["ExecutablePath"]);
break;
}
}
}
}
}
catch (Exception ex)
{
Log.LogErrorFromException(ex);
}
return true;
]]>
</Code>
</Task>
</UsingTask>
<UsingTask TaskName="CheckIfVBCSCompilerWillOverride" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<ParameterGroup>
<Src ParameterType="System.String" Required="true" />
<Dest ParameterType="System.String" Required="true" />
<WillOverride ParameterType="System.Boolean" Output="true" />
</ParameterGroup>
<Task>
<Reference Include="System.IO" />
<Code Type="Fragment" Language="cs">
<![CDATA[
WillOverride = false;
try {
WillOverride = File.Exists(Src) && File.Exists(Dest) && (File.GetLastWriteTime(Src) != File.GetLastWriteTime(Dest));
}
catch { }
]]>
</Code>
</Task>
</UsingTask>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<appSettings xdt:Transform="InsertIfMissing">
</appSettings>
<appSettings>
<add key="aspnet:RoslynCompilerLocation" xdt:Transform="Remove" xdt:Locator="Match(key)" />
<add key="aspnet:RoslynCompilerLocation" value="roslyn" xdt:Transform="Insert" />
</appSettings>
<!-- If system.codedom tag is absent -->
<system.codedom xdt:Transform="InsertIfMissing">
</system.codedom>
<!-- If compilers tag is absent -->
<system.codedom>
<compilers xdt:Transform="InsertIfMissing">
</compilers>
</system.codedom>
<!-- If a .cs compiler is already present, the existing entry needs to be removed before inserting the new entry -->
<system.codedom>
<compilers>
<compiler
extension=".cs"
xdt:Transform="Remove"
xdt:Locator="Match(extension)" />
</compilers>
</system.codedom>
<!-- Inserting the new compiler -->
<system.codedom>
<compilers>
<compiler
language="c#;cs;csharp"
extension=".cs"
type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
warningLevel="4"
compilerOptions="/langversion:6 /nowarn:1659;1699;1701"
xdt:Transform="Insert" />
</compilers>
</system.codedom>
<!-- If a .vb compiler is already present, the existing entry needs to be removed before inserting the new entry -->
<system.codedom>
<compilers>
<compiler
extension=".vb"
xdt:Transform="Remove"
xdt:Locator="Match(extension)" />
</compilers>
</system.codedom>
<!-- Inserting the new compiler -->
<system.codedom>
<compilers>
<compiler
language="vb;vbs;visualbasic;vbscript"
extension=".vb"
type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
warningLevel="4"
compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+"
xdt:Transform="Insert" />
</compilers>
</system.codedom>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<appSettings>
<add key="aspnet:RoslynCompilerLocation" value="roslyn" xdt:Transform="Remove" xdt:Locator="Match(key)" />
</appSettings>
<appSettings xdt:Transform="Remove" xdt:Locator="Condition(count(child::*) = 0)">
</appSettings>
<system.codedom>
<compilers>
<compiler
extension=".cs"
xdt:Transform="Remove"
xdt:Locator="Match(extension)" />
</compilers>
</system.codedom>
<system.codedom>
<compilers>
<compiler
extension=".vb"
xdt:Transform="Remove"
xdt:Locator="Match(extension)" />
</compilers>
</system.codedom>
<system.codedom>
<compilers xdt:Transform="Remove" xdt:Locator="Condition(count(child::*) = 0)" />
</system.codedom>
<system.codedom xdt:Transform="Remove" xdt:Locator="Condition(count(child::*) = 0)" />
</configuration>
\ No newline at end of file
  • Glad to have the trusted blogging updates for the people who need the help about coding easily grab it here. I’m sure the information on https://bestwritingsclues.com/reviews/elitewritings-review/ blog quite updated and we able to learn something new. Thanks for the wise recommendation keep posting such trusted updates here.

Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment