Browse Source

Fixed build errors on Windows Server

Pēteris Ņikiforovs 12 years ago
parent
commit
d4b3905f66
2 changed files with 8 additions and 6 deletions
  1. 7 5
      aspnet/setup_iis.ps1
  2. 1 1
      aspnet/src/Benchmarks.AspNet.csproj

+ 7 - 5
aspnet/setup_iis.ps1

@@ -2,18 +2,20 @@ param($action)
 
 
 $wwwroot = "C:\FrameworkBenchmarks\aspnet\www"
 $wwwroot = "C:\FrameworkBenchmarks\aspnet\www"
 $source = "C:\FrameworkBenchmarks\aspnet\src"
 $source = "C:\FrameworkBenchmarks\aspnet\src"
+$msbuild = "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe"
 
 
 # Stop
 # Stop
 if (Get-WebSite -Name Benchmarks) { Remove-WebSite -Name Benchmarks }
 if (Get-WebSite -Name Benchmarks) { Remove-WebSite -Name Benchmarks }
-Get-ChildItem -Path $wwwroot -Recurse -ErrorAction 'SilentlyContinue' | Remove-Item -Force -Recurse -ErrorAction 'SilentlyContinue'; 
-Remove-Item -Force -Recurse $wwwroot -ErrorAction 'SilentlyContinue'
+Get-ChildItem -Path $wwwroot -Recurse -ErrorAction 'SilentlyContinue' | Remove-Item -Force -Recurse -ErrorAction 'SilentlyContinue' | Out-Null 
+Remove-Item -Force -Recurse $wwwroot -ErrorAction 'SilentlyContinue' | Out-Null
 
 
 if ($action -eq 'start') {
 if ($action -eq 'start') {
     # Create a website in IIS
     # Create a website in IIS
-    New-Item -Path $wwwroot -Type directory | Out-Null
+    New-Item -Path $wwwroot -Type Directory -ErrorAction 'SilentlyContinue' | Out-Null
     New-WebSite -Name Benchmarks -Port 8080 -PhysicalPath $wwwroot
     New-WebSite -Name Benchmarks -Port 8080 -PhysicalPath $wwwroot
     
     
     # Build the project
     # Build the project
-    C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe "$source\Benchmarks.AspNet.csproj" /p:Configuration=Release /p:Platform="x64" /t:Clean
-    C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe "$source\Benchmarks.AspNet.csproj" /p:Configuration=Release /p:Platform="x64" /p:DeployOnBuild=true /p:PublishProfile=IIS
+    &$msbuild "$source\Benchmarks.AspNet.csproj" /t:RestorePackages
+    &$msbuild "$source\Benchmarks.AspNet.csproj" /p:Configuration=Release /p:Platform=x64 /t:Clean
+    &$msbuild "$source\Benchmarks.AspNet.csproj" /p:Configuration=Release /p:Platform=x64 /p:DeployOnBuild=true /p:PublishProfile=IIS
 }
 }

+ 1 - 1
aspnet/src/Benchmarks.AspNet.csproj

@@ -140,7 +140,7 @@
   </PropertyGroup>
   </PropertyGroup>
   <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
   <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
   <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != '' And Exists('$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets')" />
   <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != '' And Exists('$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets')" />
-  <Import Project="..\lib\MSBuild.Microsoft.VisualStudio.Web.targets.11.0.2.1\tools\VSToolsPath\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' == '' Or !Exists('$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets')" />
+  <Import Project="..\lib\MSBuild.Microsoft.VisualStudio.Web.targets.11.0.2.1\tools\VSToolsPath\WebApplications\Microsoft.WebApplication.targets" Condition="('$(VSToolsPath)' == '' Or !Exists('$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets')) And Exists('..\lib\MSBuild.Microsoft.VisualStudio.Web.targets.11.0.2.1\tools\VSToolsPath\WebApplications\Microsoft.WebApplication.targets')" />
   <Import Project="..\lib\.nuget\NuGet.targets" Condition="Exists('..\lib\.nuget\NuGet.targets')" />
   <Import Project="..\lib\.nuget\NuGet.targets" Condition="Exists('..\lib\.nuget\NuGet.targets')" />
   <Target Name="MvcBuildViews" AfterTargets="AfterBuild" Condition="'$(MvcBuildViews)' == 'true'">
   <Target Name="MvcBuildViews" AfterTargets="AfterBuild" Condition="'$(MvcBuildViews)' == 'true'">
     <AspNetCompiler VirtualPath="/" PhysicalPath="$(WebProjectOutputDir)" />
     <AspNetCompiler VirtualPath="/" PhysicalPath="$(WebProjectOutputDir)" />