Browse Source

Merge pull request #435 from kppullin/nancyfx_updates

Nancyfx updates
Brian Hauer 12 years ago
parent
commit
489a0eb5e0

+ 4 - 0
nancy/.gitignore

@@ -2,3 +2,7 @@
 *.suo
 */bin/*
 */obj/*
+obj/
+[Bb]in
+[Dd]ebug*/
+[Rr]elease*/

+ 2 - 2
nancy/setup_iis.ps1

@@ -14,6 +14,6 @@ if ($action -eq 'start') {
     New-WebSite -Name Benchmarks -Port 8080 -PhysicalPath $wwwroot
     
     # Build the project
-    C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe "$source\NancyBenchmark.csproj" /p:Configuration=Release /p:Platform="x64" /t:Clean
-    C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe "$source\NancyBenchmark.csproj" /p:Configuration=Release /p:Platform="x64" /p:DeployOnBuild=true /p:PublishProfile=IIS
+    C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe "$source\NancyBenchmark.csproj" /p:Configuration=Release /p:Platform="AnyCPU" /t:Clean
+    C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe "$source\NancyBenchmark.csproj" /p:Configuration=Release /p:Platform="AnyCPU" /p:DeployOnBuild=true /p:PublishProfile=IIS
 }

+ 4 - 1
nancy/src/Global.asax.cs

@@ -3,6 +3,7 @@ using System.Collections.Generic;
 using System.Web;
 using Nancy;
 using Nancy.ErrorHandling;
+using System.Threading;
 
 namespace NancyBenchmark
 {
@@ -10,7 +11,9 @@ namespace NancyBenchmark
     {
         protected void Application_Start()
         {
-            
+            var threads = 40 * Environment.ProcessorCount;
+            ThreadPool.SetMaxThreads(threads, threads);
+            ThreadPool.SetMinThreads(threads, threads);
         }
     }
 }

+ 3 - 0
nancy/src/NancyBenchmark.csproj

@@ -69,6 +69,9 @@
       <SubType>Designer</SubType>
     </Content>
   </ItemGroup>
+  <ItemGroup>
+    <None Include="Properties\PublishProfiles\IIS.pubxml" />
+  </ItemGroup>
   <ItemGroup>
     <Compile Include="DbModule.cs" />
     <Content Include="Global.asax" />

+ 28 - 0
nancy/src/Properties/PublishProfiles/IIS.pubxml

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+This file is used by the publish/package process of your Web project. You can customize the behavior of this process
+by editing this MSBuild file. In order to learn more about this please visit http://go.microsoft.com/fwlink/?LinkID=208121. 
+-->
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <WebPublishMethod>MSDeploy</WebPublishMethod>
+    <MSDeployServiceURL>localhost</MSDeployServiceURL>
+    <DeployIisAppPath>Benchmarks</DeployIisAppPath>
+    <RemoteSitePhysicalPath />
+    <SkipExtraFilesOnServer>False</SkipExtraFilesOnServer>
+    <MSDeployPublishMethod>InProc</MSDeployPublishMethod>
+    <UserName />
+    <_SavePWD>False</_SavePWD>
+    <PublishDatabaseSettings>
+    </PublishDatabaseSettings>
+    <LastUsedBuildConfiguration>Debug</LastUsedBuildConfiguration>
+    <LastUsedPlatform>x64</LastUsedPlatform>
+    <ExcludeApp_Data>True</ExcludeApp_Data>
+    <EnableMSDeployBackup>False</EnableMSDeployBackup>
+    <SiteUrlToLaunchAfterPublish>/</SiteUrlToLaunchAfterPublish>
+    <PrecompileBeforePublish>True</PrecompileBeforePublish>
+    <EnableUpdateable>False</EnableUpdateable>
+    <DebugSymbols>False</DebugSymbols>
+    <WDPMergeOption>DonotMerge</WDPMergeOption>
+  </PropertyGroup>
+</Project>

+ 1 - 1
nancy/src/Web.config

@@ -7,7 +7,7 @@
   </appSettings>
   <system.web>
     <customErrors mode="Off"/>
-    <compilation debug="true" targetFramework="4.5"/>
+    <compilation debug="false" targetFramework="4.5"/>
     <pages controlRenderingCompatibilityVersion="4.0"/>
     <httpHandlers>
       <add verb="*" type="Nancy.Hosting.Aspnet.NancyHttpRequestHandler" path="*"/>