Explorar o código

Merge branch 'aspnet' of https://github.com/pdonald/FrameworkBenchmarks into pdonald-aspnet

# Conflicts:
#	.travis.yml
#	toolset/setup/linux/languages/mono.sh
Hamilton Turner %!s(int64=10) %!d(string=hai) anos
pai
achega
a41af8e694

+ 0 - 1
.travis.yml

@@ -165,4 +165,3 @@ install:
 script: 
   # Pick one test in this directory and verify
   - time ./toolset/run-ci.py verify "$TESTDIR"
-  

+ 2 - 2
frameworks/CSharp/aspnet/.gitignore

@@ -2,5 +2,5 @@
 *.suo
 */bin/*
 */obj/*
-lib/*
-!lib/.nuget
+*/packages/*
+nginx.upstream.conf

+ 7 - 28
frameworks/CSharp/aspnet/README.md

@@ -18,7 +18,7 @@
 **Platforms**
 
 * .NET Framework 4.5 (Windows)
-* Mono 3.2.8 (Linux)
+* Mono 3.99.0 (Linux)
 
 **Web Servers**
 
@@ -29,37 +29,16 @@
 **Web Stack**
 
 * ASP.NET 4.5
-* ASP.NET MVC Framework 5.1.0
+* ASP.NET MVC Framework 5.2.2
+* ASP.NET Razor 3.2.2
 
 **Databases**
 
-* MySQL Connector/Net 6.8.3
-* Npgsql 2.0.14.3
-* Entity Framework 6.0.2
-* Mongo C# Driver 1.8.3
+* MySQL Connector/Net 6.9.5
+* Npgsql 2.2.3
+* Entity Framework 6.1.1
+* Mongo C# Driver 1.9.2
 
 **Developer Tools**
 
 * Visual Studio 2012
-
-## Mono Installation
-
-    sudo apt-get install git-core build-essential autoconf automake libtool zlib1g-dev pkg-config gettext
-
-    git clone git://github.com/mono/mono
-    cd mono
-    git checkout mono-3.2.8
-    ./autogen.sh --prefix=/usr/local
-    make get-monolite-latest
-    make EXTERNAL_MCS=${PWD}/mcs/class/lib/monolite/gmcs.exe
-    sudo make install
-
-    cd ..
-
-    git clone git://github.com/mono/xsp
-    cd xsp
-    ./autogen.sh --prefix=/usr/local
-    make
-    sudo make install
-    
-    mozroots --import --sync

+ 0 - 8
frameworks/CSharp/aspnet/bash_profile.sh

@@ -1,8 +0,0 @@
-#!/bin/bash
-
-export MONO_ROOT=${IROOT}/mono-3.6.0-install
-
-# Needed to find Mono's shared libraries
-export LD_LIBRARY_PATH="$MONO_ROOT/lib"
-
-export NGINX_HOME=${IROOT}/nginx

BIN=BIN
frameworks/CSharp/aspnet/lib/.nuget/NuGet.exe


+ 0 - 135
frameworks/CSharp/aspnet/lib/.nuget/NuGet.targets

@@ -1,135 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-    <PropertyGroup>
-        <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>
-        
-        <!-- Enable the restore command to run before builds -->
-        <RestorePackages Condition="  '$(RestorePackages)' == '' ">false</RestorePackages>
-
-        <!-- Property that enables building a package from a project -->
-        <BuildPackage Condition=" '$(BuildPackage)' == '' ">false</BuildPackage>
-
-        <!-- Determines if package restore consent is required to restore packages -->
-        <RequireRestoreConsent Condition=" '$(RequireRestoreConsent)' != 'false' ">false</RequireRestoreConsent>
-        
-        <!-- Download NuGet.exe if it does not already exist -->
-        <DownloadNuGetExe Condition=" '$(DownloadNuGetExe)' == '' ">true</DownloadNuGetExe>
-    </PropertyGroup>
-    
-    <ItemGroup Condition=" '$(PackageSources)' == '' ">
-        <!-- Package sources used to restore packages. By default, registered sources under %APPDATA%\NuGet\NuGet.Config will be used -->
-        <!-- The official NuGet package source (https://nuget.org/api/v2/) will be excluded if package sources are specified and it does not appear in the list -->
-        <!--
-            <PackageSource Include="https://nuget.org/api/v2/" />
-            <PackageSource Include="https://my-nuget-source/nuget/" />
-        -->
-    </ItemGroup>
-
-    <PropertyGroup Condition=" '$(OS)' == 'Windows_NT'">
-        <!-- Windows specific commands -->
-        <NuGetToolsPath>$([System.IO.Path]::Combine($(SolutionDir), "..", "lib", ".nuget"))</NuGetToolsPath>
-        <PackagesConfig>$([System.IO.Path]::Combine($(ProjectDir), "..", "lib", "packages.config"))</PackagesConfig>
-        <RepositoryPath>$([System.IO.Path]::Combine($(SolutionDir), "..", "lib"))</RepositoryPath>
-    </PropertyGroup>
-    
-    <PropertyGroup Condition=" '$(OS)' != 'Windows_NT'">
-        <!-- We need to launch nuget.exe with the mono command if we're not on windows -->
-        <NuGetToolsPath>$(SolutionDir)..\lib\.nuget</NuGetToolsPath>
-        <PackagesConfig>$(SolutionDir)..\lib\packages.config</PackagesConfig>
-        <RepositoryPath>$(SolutionDir)..\lib</RepositoryPath>
-    </PropertyGroup>
-    
-    <PropertyGroup>
-        <!-- NuGet command -->
-        <NuGetExePath Condition=" '$(NuGetExePath)' == '' ">$(NuGetToolsPath)\NuGet.exe</NuGetExePath>
-        <PackageSources Condition=" $(PackageSources) == '' ">@(PackageSource)</PackageSources>
-        
-        <NuGetCommand Condition=" '$(OS)' == 'Windows_NT'">"$(NuGetExePath)"</NuGetCommand>
-        <NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono $(NuGetExePath)</NuGetCommand>
-
-        <PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>
-        
-        <RequireConsentSwitch Condition=" $(RequireRestoreConsent) == 'true' ">-RequireConsent</RequireConsentSwitch>
-        <NonInteractiveSwitch Condition=" '$(VisualStudioVersion)' != '' AND '$(OS)' == 'Windows_NT' ">-NonInteractive</NonInteractiveSwitch>
-        
-        <!-- Commands -->
-        <RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)"  $(NonInteractiveSwitch) $(RequireConsentSwitch) -OutputDirectory "$(RepositoryPath)"</RestoreCommand>
-        <BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" -Properties Configuration=$(Configuration) $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols</BuildCommand>
-
-        <!-- We need to ensure packages are restored prior to assembly resolve -->
-        <BuildDependsOn Condition="$(RestorePackages) == 'true'">
-            RestorePackages;
-            $(BuildDependsOn);
-        </BuildDependsOn>
-
-        <!-- Make the build depend on restore packages -->
-        <BuildDependsOn Condition="$(BuildPackage) == 'true'">
-            $(BuildDependsOn);
-            BuildPackage;
-        </BuildDependsOn>
-    </PropertyGroup>
-
-    <Target Name="CheckPrerequisites">
-        <!-- Raise an error if we're unable to locate nuget.exe  -->
-        <Error Condition="'$(DownloadNuGetExe)' != 'true' AND !Exists('$(NuGetExePath)')" Text="Unable to locate '$(NuGetExePath)'" />
-        <!--
-        Take advantage of MsBuild's build dependency tracking to make sure that we only ever download nuget.exe once.
-        This effectively acts as a lock that makes sure that the download operation will only happen once and all
-        parallel builds will have to wait for it to complete.
-        -->
-        <MsBuild Targets="_DownloadNuGet" Projects="$(MSBuildThisFileFullPath)" Properties="Configuration=NOT_IMPORTANT;DownloadNuGetExe=$(DownloadNuGetExe)" />
-    </Target>
-
-    <Target Name="_DownloadNuGet">
-        <DownloadNuGet OutputFilename="$(NuGetExePath)" Condition=" '$(DownloadNuGetExe)' == 'true' AND !Exists('$(NuGetExePath)')" />
-    </Target>
-
-    <Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
-        <Exec Command="$(RestoreCommand)"
-              Condition="'$(OS)' != 'Windows_NT' And Exists('$(PackagesConfig)')" />
-              
-        <Exec Command="$(RestoreCommand)"
-              LogStandardErrorAsError="true"
-              Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" />
-    </Target>
-
-    <Target Name="BuildPackage" DependsOnTargets="CheckPrerequisites">
-        <Exec Command="$(BuildCommand)" 
-              Condition=" '$(OS)' != 'Windows_NT' " />
-              
-        <Exec Command="$(BuildCommand)"
-              LogStandardErrorAsError="true"
-              Condition=" '$(OS)' == 'Windows_NT' " />
-    </Target>
-    
-    <UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
-        <ParameterGroup>
-            <OutputFilename ParameterType="System.String" Required="true" />
-        </ParameterGroup>
-        <Task>
-            <Reference Include="System.Core" />
-            <Using Namespace="System" />
-            <Using Namespace="System.IO" />
-            <Using Namespace="System.Net" />
-            <Using Namespace="Microsoft.Build.Framework" />
-            <Using Namespace="Microsoft.Build.Utilities" />
-            <Code Type="Fragment" Language="cs">
-                <![CDATA[
-                try {
-                    OutputFilename = Path.GetFullPath(OutputFilename);
-
-                    Log.LogMessage("Downloading latest version of NuGet.exe...");
-                    WebClient webClient = new WebClient();
-                    webClient.DownloadFile("https://nuget.org/nuget.exe", OutputFilename);
-
-                    return true;
-                }
-                catch (Exception ex) {
-                    Log.LogErrorFromException(ex);
-                    return false;
-                }
-            ]]>
-            </Code>
-        </Task>
-    </UsingTask>
-</Project>

+ 17 - 1
frameworks/CSharp/aspnet/nginx.conf

@@ -19,7 +19,23 @@ http {
 
         location / {
             fastcgi_pass mono;
-            include /usr/local/nginx/conf/fastcgi_params;
+            fastcgi_param  QUERY_STRING       $query_string;
+            fastcgi_param  REQUEST_METHOD     $request_method;
+            fastcgi_param  CONTENT_TYPE       $content_type;
+            fastcgi_param  CONTENT_LENGTH     $content_length;
+            fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
+            fastcgi_param  REQUEST_URI        $request_uri;
+            fastcgi_param  DOCUMENT_URI       $document_uri;
+            fastcgi_param  DOCUMENT_ROOT      $document_root;
+            fastcgi_param  SERVER_PROTOCOL    $server_protocol;
+            fastcgi_param  HTTPS              $https if_not_empty;
+            fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
+            fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;
+            fastcgi_param  REMOTE_ADDR        $remote_addr;
+            fastcgi_param  REMOTE_PORT        $remote_port;
+            fastcgi_param  SERVER_ADDR        $server_addr;
+            fastcgi_param  SERVER_PORT        $server_port;
+            fastcgi_param  SERVER_NAME        $server_name;
             fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
         }
     }

+ 0 - 45
frameworks/CSharp/aspnet/setup_nginx.py

@@ -1,45 +0,0 @@
-import subprocess
-import sys
-import setup_util
-import os
-
-def start(args, logfile, errfile):
-  if os.name == 'nt':
-    return 1
-  
-  setup_util.replace_text("aspnet/src/Web.config", "localhost", args.database_host)
-
-  # build
-  subprocess.check_call("rm -rf bin obj", shell=True, cwd="aspnet", stderr=errfile, stdout=logfile)
-  subprocess.check_call("xbuild /p:Configuration=Release", shell=True, cwd="aspnet/src", stderr=errfile, stdout=logfile)
-  subprocess.check_call("sudo chown -R $USER:$USER $MONO_ROOT", shell=True, stderr=errfile, stdout=logfile)
-  
-  # nginx
-  workers = 'worker_processes ' + str(args.max_threads) + ';'
-  logfile.write("Setting up workers as %s\n\n" % workers)
-  subprocess.check_call("echo Hello there", shell=True, stderr=errfile, stdout=logfile);
-  command = 'echo "upstream mono {\n' + ';\n'.join('\tserver 127.0.0.1:' + str(port) for port in range(9001, 9001 + args.max_threads)) + ';\n}" > $TROOT/nginx.upstream.conf'
-  logfile.write("Using command %s" % command)
-  subprocess.check_call(command, shell=True, stderr=errfile, stdout=logfile);
-  subprocess.check_call('sudo /usr/local/nginx/sbin/nginx -c $TROOT/nginx.conf -g "' + workers + '"', shell=True, stderr=errfile, stdout=logfile)
-  
-  # Start fastcgi for each thread
-  # To debug, use --printlog --verbose --loglevels=All
-  for port in range(9001, 9001 + args.max_threads):
-    subprocess.Popen("MONO_OPTIONS=--gc=sgen fastcgi-mono-server4 --applications=/:%s/src --socket=tcp:127.0.0.1:%s " % (args.directory, port), shell=True, cwd="aspnet", stderr=errfile, stdout=logfile)
-
-def stop(logfile, errfile):
-  if os.name == 'nt':
-    return 0
-  
-  subprocess.check_call("sudo /usr/local/nginx/sbin/nginx -c $TROOT/nginx.conf -s stop", shell=True, stderr=errfile, stdout=logfile)
-  subprocess.check_call("rm -f $TROOT/nginx.upstream.conf", shell=True, stderr=errfile, stdout=logfile)
-  #
-  # stop mono
-  #
-  p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
-  out, err = p.communicate()
-  for line in out.splitlines():
-    if 'mono-server' in line and not 'run-ci' in line and not 'run-tests' in line:
-      pid = int(line.split(None, 2)[1])
-      os.kill(pid, 15)

+ 23 - 16
frameworks/CSharp/aspnet/setup_nginx.sh

@@ -1,30 +1,37 @@
 #!/bin/bash
 
+set -e
+
+# mono environment variables
+. ${IROOT}/mono.installed
+
+export NGINX_HOME=${IROOT}/nginx
+
 sed -i 's|localhost|'"$DBHOST"'|g' src/Web.config
 
-# build
-rm -rf bin obj
-cd src
-$MONO_ROOT/bin/xbuild /p:Configuration=Release
+# extra cleaning
+rm -rf src/bin src/obj
+rm -rf /tmp/nuget
+
+xbuild src/Benchmarks.build.proj /t:Clean
+xbuild src/Benchmarks.build.proj /t:Build
+
+# one fastcgi instance for each thread
+# load balanced by nginx
+port_start=9001
+port_end=$(($port_start+$MAX_THREADS))
 
 # nginx
 conf="upstream mono {\n"
-current=9001
-end=$(($current+$MAX_THREADS))
-while [ $current -lt $end ]; do
-  conf+="\tserver 127.0.0.1:${current};\n"
-  let current=current+1
+for port in $(seq $port_start $port_end); do
+  conf+="\tserver 127.0.0.1:${port};\n"
 done
 conf+="}"
 echo -e $conf > $TROOT/nginx.upstream.conf
 
-$NGINX_HOME/sbin/nginx -c $TROOT/nginx.conf -g "${MAX_THREADS}"
+$NGINX_HOME/sbin/nginx -c $TROOT/nginx.conf -g "worker_processes ${MAX_THREADS};"
 
-# Start fastcgi for each thread
 # To debug, use --printlog --verbose --loglevels=All
-current=9001
-end=$(($current+$MAX_THREADS))
-while [ $current -lt $end ]; do
-  MONO_OPTIONS=--gc=sgen fastcgi-mono-server4 --applications=/:$(pwd)/src --socket=tcp:127.0.0.1:$current
-  let current=current+1
+for port in $(seq $port_start $port_end); do
+  fastcgi-mono-server4 --applications=/:${TROOT}/src --socket=tcp:127.0.0.1:$port &
 done

+ 0 - 34
frameworks/CSharp/aspnet/setup_xsp.py

@@ -1,34 +0,0 @@
-import subprocess
-import sys
-import setup_util
-import os
-
-def start(args, logfile, errfile):
-  if os.name == 'nt':
-    return 1
-  
-  setup_util.replace_text("aspnet/src/Web.config", "localhost", args.database_host)
-
-  try:
-    subprocess.check_call("rm -rf bin obj", shell=True, cwd="aspnet/src", stderr=errfile, stdout=logfile)
-    subprocess.check_call("xbuild /p:Configuration=Release", shell=True, cwd="aspnet/src", stderr=errfile, stdout=logfile)
-    subprocess.check_call("sudo chown -R ubuntu:ubuntu /usr/local/etc/mono", shell=True, stderr=errfile, stdout=logfile)
-    subprocess.Popen("MONO_OPTIONS=--gc=sgen xsp4 --nonstop", shell=True, cwd="aspnet/src", stderr=errfile, stdout=logfile)
-    return 0
-  except subprocess.CalledProcessError:
-    return 1
-
-def stop(logfile, errfile):
-  if os.name == 'nt':
-    return 0
-  
-  p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
-  out, err = p.communicate()
-  for line in out.splitlines():
-    if 'xsp4' in line:
-      pid = int(line.split(None, 2)[1])
-      try:
-        os.kill(pid, 15)
-      except OSError:
-        pass
-  return 0

+ 56 - 0
frameworks/CSharp/aspnet/src/Benchmarks.build.proj

@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+
+  <PropertyGroup>
+    <SolutionDir>$(MSBuildThisFileDirectory)</SolutionDir>
+    <Configuration Condition=" '$(Configuration)'=='' ">Release</Configuration>
+    <NuGetExe Condition=" '$(NuGetExe)'=='' ">packages/nuget.exe</NuGetExe>
+    <NuGetExeDir>packages/</NuGetExeDir>
+    <NuGetDownloadAddress Condition=" '$(NuGetDownloadAddress)'=='' ">http://nuget.org/nuget.exe</NuGetDownloadAddress>
+    <NuGetCommand Condition=" '$(NuGetCommand)'=='' AND '$(OS)' == 'Windows_NT'">"$(NuGetExe)"</NuGetCommand>
+    <NuGetCommand Condition=" '$(NuGetCommand)'=='' AND '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 "$(NuGetExe)"</NuGetCommand>
+    <Properties>Configuration=$(Configuration);SolutionDir=$(SolutionDir)</Properties>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <Solution Include="*.sln" />
+  </ItemGroup>
+
+  <UsingTask TaskName="DownloadFile" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll" Condition=" '$(OS)' == 'Windows_NT' ">
+    <ParameterGroup>
+      <Address ParameterType="System.String" Required="true"/>
+      <OutputFilename ParameterType="System.String" Required="true" />
+    </ParameterGroup>
+    <Task>
+      <Reference Include="System" />
+      <Code Type="Fragment" Language="cs">
+        <![CDATA[
+            new System.Net.WebClient().DownloadFile(Address, OutputFilename);
+        ]]>
+      </Code>
+    </Task>
+  </UsingTask>
+
+  <Target Name="DownloadNuGet">
+    <MakeDir Directories="$(NuGetExeDir)" Condition=" !Exists('$(NuGetExeDir)') " />
+    <DownloadFile Address="$(NuGetDownloadAddress)" OutputFilename="$(NuGetExe)" Condition=" '$(OS)' == 'Windows_NT' AND !Exists('$(NuGetExe)')" />
+    <Exec Command="wget $(NuGetDownloadAddress) -O $(NuGetExe)" Condition=" '$(OS)' != 'Windows_NT' AND !Exists('$(NuGetExe)') " />
+  </Target>
+
+  <Target Name="RestorePackages" DependsOnTargets="DownloadNuGet">
+    <Exec Command="$(NuGetCommand) restore &quot;%(Solution.Identity)&quot;" />
+  </Target>
+
+  <Target Name="Clean">
+    <MSBuild Targets="Clean" Projects="@(Solution)" Properties="$(Properties)" />
+  </Target>
+
+  <Target Name="Build" DependsOnTargets="RestorePackages">
+    <MSBuild Targets="Build" Projects="@(Solution)" Properties="$(Properties)" />
+  </Target>
+
+  <Target Name="Rebuild" DependsOnTargets="RestorePackages">
+    <MSBuild Targets="Rebuild" Projects="@(Solution)" Properties="$(Properties)" />
+  </Target>
+
+</Project>

+ 24 - 28
frameworks/CSharp/aspnet/src/Benchmarks.AspNet.csproj → frameworks/CSharp/aspnet/src/Benchmarks.csproj

@@ -45,69 +45,61 @@
     <Reference Include="System.Web.Extensions" />
     <Reference Include="System.Web.Mvc">
       <Private>True</Private>
-      <HintPath>..\lib\Microsoft.AspNet.Mvc.5.1.0\lib\net45\System.Web.Mvc.dll</HintPath>
-    </Reference>
-    <Reference Include="System.Web.Helpers">
-      <Private>True</Private>
-      <HintPath>..\lib\Microsoft.AspNet.WebPages.3.1.0\lib\net45\System.Web.Helpers.dll</HintPath>
+      <HintPath>$(SolutionDir)\packages\Microsoft.AspNet.Mvc.5.2.2\lib\net45\System.Web.Mvc.dll</HintPath>
     </Reference>
     <Reference Include="System.Web.Razor">
       <Private>True</Private>
-      <HintPath>..\lib\Microsoft.AspNet.Razor.3.1.0\lib\net45\System.Web.Razor.dll</HintPath>
+      <HintPath>$(SolutionDir)\packages\Microsoft.AspNet.Razor.3.2.2\lib\net45\System.Web.Razor.dll</HintPath>
     </Reference>
     <Reference Include="System.Web.WebPages">
       <Private>True</Private>
-      <HintPath>..\lib\Microsoft.AspNet.WebPages.3.1.0\lib\net45\System.Web.WebPages.dll</HintPath>
-    </Reference>
-    <Reference Include="System.Web.WebPages.Deployment">
-      <Private>True</Private>
-      <HintPath>..\lib\Microsoft.AspNet.WebPages.3.1.0\lib\net45\System.Web.WebPages.Deployment.dll</HintPath>
+      <HintPath>$(SolutionDir)\packages\Microsoft.AspNet.WebPages.3.2.2\lib\net45\System.Web.WebPages.dll</HintPath>
     </Reference>
     <Reference Include="System.Web.WebPages.Razor">
       <Private>True</Private>
-      <HintPath>..\lib\Microsoft.AspNet.WebPages.3.1.0\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
-    </Reference>
-    <Reference Include="Microsoft.Web.Infrastructure">
-      <Private>True</Private>
-      <HintPath>..\lib\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
+      <HintPath>$(SolutionDir)\packages\Microsoft.AspNet.WebPages.3.2.2\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
     </Reference>
     <Reference Include="Newtonsoft.Json">
-      <HintPath>..\lib\Newtonsoft.Json.5.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
+      <HintPath>$(SolutionDir)\packages\Newtonsoft.Json.6.0.6\lib\net45\Newtonsoft.Json.dll</HintPath>
     </Reference>
     <Reference Include="ServiceStack.Text">
-      <HintPath>..\lib\ServiceStack.Text.4.0.8\lib\net40\ServiceStack.Text.dll</HintPath>
+      <HintPath>$(SolutionDir)\packages\ServiceStack.Text.4.0.34\lib\net40\ServiceStack.Text.dll</HintPath>
     </Reference>
     <Reference Include="EntityFramework">
       <Private>True</Private>
-      <HintPath>..\lib\EntityFramework.6.0.2\lib\net45\EntityFramework.dll</HintPath>
+      <HintPath>$(SolutionDir)\packages\EntityFramework.6.1.1\lib\net45\EntityFramework.dll</HintPath>
     </Reference>
     <Reference Include="EntityFramework">
       <Private>True</Private>
-      <HintPath>..\lib\EntityFramework.6.0.2\lib\net45\EntityFramework.SqlServer.dll</HintPath>
+      <HintPath>$(SolutionDir)\packages\EntityFramework.6.1.1\lib\net45\EntityFramework.SqlServer.dll</HintPath>
     </Reference>
     <Reference Include="MySql">
       <Private>True</Private>
-      <HintPath>..\lib\MySql.Data.6.8.3\lib\net45\MySql.Data.dll</HintPath>
+      <HintPath>$(SolutionDir)\packages\MySql.Data.6.9.5\lib\net45\MySql.Data.dll</HintPath>
     </Reference>
     <Reference Include="MySql">
       <Private>True</Private>
-      <HintPath>..\lib\MySql.Data.Entities.6.8.3.0\lib\net45\mysql.data.entity.EF6.dll</HintPath>
+      <HintPath>$(SolutionDir)\packages\MySql.Data.Entity.6.9.5\lib\net45\MySql.Data.Entity.EF6.dll</HintPath>
     </Reference>
     <Reference Include="Npgsql">
       <Private>True</Private>
-      <HintPath>..\lib\Npgsql.2.0.14.3\lib\net45\Npgsql.dll</HintPath>
+      <HintPath>$(SolutionDir)\packages\Npgsql.2.2.3\lib\net45\Npgsql.dll</HintPath>
     </Reference>
     <Reference Include="Npgsql">
       <Private>True</Private>
-      <HintPath>..\lib\Npgsql.2.0.14.3\lib\net45\Mono.Security.dll</HintPath>
+      <HintPath>$(SolutionDir)\packages\Npgsql.EntityFramework.2.2.3\lib\net45\Npgsql.EntityFramework.dll</HintPath>
+    </Reference>
+    <Reference Include="Npgsql">
+      <Private>True</Private>
+      <HintPath>$(SolutionDir)\packages\Npgsql.2.2.3\lib\net45\Mono.Security.dll</HintPath>
     </Reference>
     <Reference Include="MongoDB">
       <Private>True</Private>
-      <HintPath>..\lib\mongocsharpdriver.1.8.3\lib\net35\MongoDB.Bson.dll</HintPath>
+      <HintPath>$(SolutionDir)\packages\mongocsharpdriver.1.9.2\lib\net35\MongoDB.Bson.dll</HintPath>
     </Reference>
     <Reference Include="MongoDB">
       <Private>True</Private>
-      <HintPath>..\lib\mongocsharpdriver.1.8.3\lib\net35\MongoDB.Driver.dll</HintPath>
+      <HintPath>$(SolutionDir)\packages\mongocsharpdriver.1.9.2\lib\net35\MongoDB.Driver.dll</HintPath>
     </Reference>
   </ItemGroup>
   <ItemGroup>
@@ -137,6 +129,11 @@
       <SubType>Designer</SubType>
     </Content>
   </ItemGroup>
+  <ItemGroup>
+    <None Include="packages.config">
+      <SubType>Designer</SubType>
+    </None>
+  </ItemGroup>
   <ItemGroup>
     <None Include="Properties\PublishProfiles\IIS.pubxml" />
   </ItemGroup>
@@ -147,8 +144,7 @@
   </PropertyGroup>
   <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.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')) 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="$(SolutionDir)\packages\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('$(SolutionDir)\packages\MSBuild.Microsoft.VisualStudio.Web.targets.11.0.2.1\tools\VSToolsPath\WebApplications\Microsoft.WebApplication.targets')" />
   <Target Name="MvcBuildViews" AfterTargets="AfterBuild" Condition="'$(MvcBuildViews)' == 'true'">
     <AspNetCompiler VirtualPath="/" PhysicalPath="$(WebProjectOutputDir)" />
   </Target>

+ 1 - 1
frameworks/CSharp/aspnet/src/Benchmarks.sln

@@ -1,7 +1,7 @@
 
 Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio 2012
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Benchmarks.AspNet", "Benchmarks.AspNet.csproj", "{62C3DEA2-2696-4200-BD83-011679316847}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Benchmarks", "Benchmarks.csproj", "{62C3DEA2-2696-4200-BD83-011679316847}"
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution

+ 1 - 1
frameworks/CSharp/aspnet/src/Models/MongoDB.cs

@@ -48,6 +48,6 @@ namespace Benchmarks.AspNet.Models
     public class MongoWorld : World
     {
         [ScriptIgnore]
-        public ObjectId _id { get; set; }
+        public object _id { get; set; }
     }
 }

+ 0 - 1
frameworks/CSharp/aspnet/src/Views/Fortunes.cshtml

@@ -3,7 +3,6 @@
 <!DOCTYPE html>
 <html>
 <head>
-    <meta charset="utf-8">
     <title>Fortunes</title>
 </head>
 <body>

+ 4 - 4
frameworks/CSharp/aspnet/src/Views/Web.config

@@ -1,13 +1,13 @@
 <?xml version="1.0"?>
 <configuration>
   <configSections>
-    <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
-      <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
-      <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
+    <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
+      <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
+      <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
     </sectionGroup>
   </configSections>
   <system.web.webPages.razor>
-    <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
+    <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.2.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
     <pages pageBaseType="System.Web.Mvc.WebViewPage">
       <namespaces>
         <add namespace="System.Web.Mvc" />

+ 4 - 4
frameworks/CSharp/aspnet/src/Web.config

@@ -15,16 +15,16 @@
   <system.data>
     <DbProviderFactories>
       <clear/>
-      <add name="MySql.Data.MySqlClient" description="Data Provider for MySQL" invariant="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.7.2.0"/>
-      <add name="Npgsql" description="Data Provider for PostgreSQL" invariant="Npgsql" type="Npgsql.NpgsqlFactory, Npgsql, Version=2.0.13.91"/>
+      <add name="MySql.Data.MySqlClient" description="Data Provider for MySQL" invariant="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.5"/>
+      <add name="Npgsql" description="Data Provider for PostgreSQL" invariant="Npgsql" type="Npgsql.NpgsqlFactory, Npgsql, Version=2.2.3"/>
       <add name="System.Data.SqlClient" description="Data Provider for Microsoft SQL Server" invariant="System.Data.SqlClient" type="System.Data.SqlClient.SqlClientFactory, System.Data, Version=4.0.0.0"/>
     </DbProviderFactories>
   </system.data>
   <!-- Entity Framework -->
   <entityFramework>
     <providers>
-      <provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity, Version=6.7.2.0"/>
-      <provider invariantName="Npgsql" type="Npgsql.NpgsqlServices, Npgsql, Version=2.0.13.91"/>
+      <provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.9.5"/>
+      <provider invariantName="Npgsql" type="Npgsql.NpgsqlServices, Npgsql.EntityFramework, Version=2.2.3"/>
       <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
     </providers>
   </entityFramework>

+ 15 - 0
frameworks/CSharp/aspnet/src/packages.config

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="EntityFramework" version="6.1.1" targetFramework="net45" />
+  <package id="Microsoft.AspNet.Mvc" version="5.2.2" targetFramework="net45" />
+  <package id="Microsoft.AspNet.Razor" version="3.2.2" targetFramework="net45" />
+  <package id="Microsoft.AspNet.WebPages" version="3.2.2" targetFramework="net45" />
+  <package id="MSBuild.Microsoft.VisualStudio.Web.targets" version="11.0.2.1" />
+  <package id="mongocsharpdriver" version="1.9.2" targetFramework="net45" />
+  <package id="MySql.Data" version="6.9.5" targetFramework="net45" />
+  <package id="MySql.Data.Entity" version="6.9.5" targetFramework="net45" />
+  <package id="Npgsql" version="2.2.3" targetFramework="net45" />
+  <package id="Npgsql.EntityFramework" version="2.2.3" targetFramework="net45" />
+  <package id="Newtonsoft.Json" version="6.0.6" targetFramework="net45" />
+  <package id="ServiceStack.Text" version="4.0.34" targetFramework="net45" />
+</packages>

+ 49 - 22
toolset/setup/linux/languages/mono.sh

@@ -1,31 +1,58 @@
 #!/bin/bash
 
-set -x
+set -ex
 
-RETCODE=$(fw_exists ${IROOT}/mono.installed)
+RETCODE=$(fw_exists $IROOT/mono.installed)
 [ ! "$RETCODE" == 0 ] || { \
   echo "Installing RootCAs from Mozilla..."; 
-  sudo $IROOT/mono-3.6.0-install/bin/mozroots --import --sync;
+  # Load environment variables
+  . $IROOT/mono.installed
+  mozroots --import --sync;
   return 0; }
 
-sudo apt-get install -qqy build-essential \
-             autoconf \
-             automake \
-             libtool \
-             zlib1g-dev \
-             pkg-config \
-             gettext
-
-fw_get http://download.mono-project.com/sources/mono/mono-3.6.0.tar.bz2 -O mono-3.6.0.tar.bz2
-fw_untar mono-3.6.0.tar.bz2
-
-cd mono-3.6.0
-./autogen.sh --prefix=${IROOT}/mono-3.6.0-install
-echo -n "Installing Mono"
-make -j4 EXTERNAL_MCS=${IROOT}/mono-3.6.0/mcs/class/lib/monolite/basic.exe 2>&1 | tee $IROOT/mono-install.log | awk '{ if (NR%100 == 0) printf "."}'
-make install 2>&1 | tee -a $IROOT/mono-install.log | awk '{ if (NR%100 == 0) printf "."}'
-
-echo "Installing RootCAs from Mozilla..."; 
-sudo ${IROOT}/mono-3.6.0-install/bin/mozroots --import --sync;
+# what do we want? latest mono
+# how do we want it? already compiled from packages but without sudo
+
+# save environment
+cat > $IROOT/mono.installed <<'END'
+export SNAPDATE=20150302140547
+export MONO_HOME=$IROOT/mono-snapshot-$SNAPDATE
+export MONO_PATH=$MONO_HOME/lib/mono/4.5
+export MONO_CFG_DIR=$MONO_HOME/etc
+export PATH=$MONO_HOME/bin:$PATH
+export LD_LIBRARY_PATH=$MONO_HOME/lib:$LD_LIBRARY_PATH
+export PKG_CONFIG_PATH=$MONO_HOME/lib/pkgconfig:$PKG_CONFIG_PATH
+END
+
+# load environment
+. $IROOT/mono.installed
+
+# temp dir for extracting archives
+TEMP=$IROOT/mono-snapshot-${SNAPDATE}-temp
+
+# start fresh
+rm -rf $TEMP && mkdir -p $TEMP
+rm -rf $MONO_HOME && mkdir -p $MONO_HOME
+
+# download .debs and extract them into $TEMP dir
+fw_get http://jenkins.mono-project.com/repo/debian/pool/main/m/mono-snapshot-${SNAPDATE}/mono-snapshot-${SNAPDATE}_${SNAPDATE}-1_amd64.deb
+fw_get http://jenkins.mono-project.com/repo/debian/pool/main/m/mono-snapshot-${SNAPDATE}/mono-snapshot-${SNAPDATE}-assemblies_${SNAPDATE}-1_all.deb
+dpkg-deb -x mono-*amd64.deb $TEMP
+dpkg-deb -x mono-*assemblies*.deb $TEMP
+
+# move /opt/mono-$SNAPDATE to /installs
+mv $TEMP/opt/mono-*/* $MONO_HOME
+
+# cleanup
+rm mono-*.deb
+rm -rf $TEMP
+
+# replace /opt/mono-$SNAPDATE path
+file $MONO_HOME/bin/* | grep "POSIX shell script" | awk -F: '{print $1}' | xargs sed -i "s|/opt/mono-$SNAPDATE|$MONO_HOME|g"
+sed -i "s|/opt/mono-$SNAPDATE|$MONO_HOME|g" $MONO_HOME/lib/pkgconfig/*.pc $MONO_HOME/etc/mono/config
+
+# import SSL certificates
+mozroots --import --sync
+#echo -e 'y\ny\ny\n' | certmgr -ssl https://nuget.org
 
 touch $IROOT/mono.installed

+ 14 - 5
toolset/setup/linux/languages/xsp.sh

@@ -1,18 +1,27 @@
 #!/bin/bash
 
+set -e
+
 RETCODE=$(fw_exists ${IROOT}/xsp.installed)
 [ ! "$RETCODE" == 0 ] || { return 0; }
 
 fw_depends mono
+
+# mono environment variables
+. ${IROOT}/mono.installed
+
+# get
 git clone git://github.com/mono/xsp
 cd xsp
-git checkout 8a31bc625727594d42f94173768bee5cf8afd0a4
+git checkout e272a2c006211b6b03be2ef5bbb9e3f8fefd0768
 
-export PKG_CONFIG_PATH=${IROOT}/mono-3.6.0-install/lib/pkgconfig
-export PATH=${IROOT}/mono-3.6.0-install/bin:$PATH
-
-./autogen.sh --prefix=${IROOT}/mono-3.6.0-install
+# build
+./autogen.sh --prefix=${MONO_HOME} --disable-docs
 make
 make install
 
+# cleanup
+cd ..
+rm -rf xsp
+
 touch ${IROOT}/xsp.installed