Skip to content

Commit 2524e0d

Browse files
committed
Fixed FunnelWeb running on all other hosts again
1 parent fbcd9be commit 2524e0d

File tree

13 files changed

+162
-114
lines changed

13 files changed

+162
-114
lines changed

.hgignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,4 @@ glob:build/NuGet/*
7373
AppHarbourConfig.xml
7474
packages/*
7575
src/_NCrunch_FunnelWeb
76+
GitRepoConfig.xml

Deploy_AppHarbour.ps1

Lines changed: 0 additions & 92 deletions
This file was deleted.

Deploy_To_Git.ps1

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
param([switch]$InitialDeploy)
2+
3+
$ErrorActionPreference = "Stop";
4+
5+
function Get-ScriptDirectory
6+
{
7+
$Invocation = (Get-Variable MyInvocation -Scope 1).Value
8+
Split-Path $Invocation.MyCommand.Path
9+
}
10+
11+
$root = Get-ScriptDirectory
12+
13+
#Get Configuration File
14+
if (!(Test-Path $root\GitRepoConfig.xml))
15+
{
16+
$config = [xml]'<gitRepoConfig>
17+
<repository></repository>
18+
</gitRepoConfig>'
19+
20+
$config.Save("$root\GitRepoConfig.xml")
21+
}
22+
else
23+
{
24+
$config = New-Object XML
25+
$config.Load("$root\GitRepoConfig.xml")
26+
}
27+
28+
#Get repo
29+
if ([string]::IsNullOrEmpty($config.gitRepoConfig.repository))
30+
{
31+
$repo = Read-Host "Enter git repository url"
32+
$config.gitRepoConfig.repository = [string]$repo
33+
$config.Save("$root\GitRepoConfig.xml")
34+
}
35+
else
36+
{
37+
$repo = $config.gitRepoConfig.repository
38+
}
39+
40+
$x86git = "C:\Program Files (x86)\Git\bin\git.exe"
41+
$git = "C:\Program Files (x86)\Git\bin\git.exe"
42+
if (Test-Path "C:\Program Files (x86)\Git\bin\git.exe")
43+
{
44+
$git = $x86git
45+
}
46+
47+
$deployTempDir = "$env:temp\FunnelWebGitDeploy"
48+
if (Test-Path "$deployTempDir")
49+
{
50+
Remove-Item "$deployTempDir\*" -recurse -force
51+
Remove-Item "$deployTempDir" -force
52+
}
53+
54+
if (!(Test-Path "$deployTempDir"))
55+
{
56+
[System.IO.Directory]::CreateDirectory("$deployTempDir")
57+
}
58+
pushd "$deployTempDir"
59+
60+
if ($InitialDeploy -eq $false)
61+
{
62+
& $git clone $repo .
63+
& $git checkout
64+
}
65+
else
66+
{
67+
& $git init
68+
& $git remote add origin $repo
69+
}
70+
# copy new stuff over
71+
copy "$root\build\published\*" "$deployTempDir" -recurse -force
72+
73+
if (!(Test-Path "$deployTempDir\my.config"))
74+
{
75+
$myConfig = New-Object XML
76+
$myConfig.Load("$deployTempDir\my.config.sample")
77+
78+
$funnelWebUsername = Read-Host "SETUP: Enter your FunnelWeb Administrator Username"
79+
$funnelWebPassword = Read-Host "SETUP: Enter your FunnelWeb Administrator Password"
80+
81+
foreach($setting in $myConfig.selectnodes("/funnelweb/setting"))
82+
{
83+
switch($setting.key)
84+
{
85+
"funnelweb.configuration.authentication.username" { $setting.SetAttribute("value", $funnelWebUsername) }
86+
"funnelweb.configuration.authentication.password" { $setting.SetAttribute("value", $funnelWebPassword) }
87+
}
88+
}
89+
90+
$myConfig.Save("$deployTempDir\my.config")
91+
}
92+
93+
### Compatibility Steps
94+
#Remove Obsolete Extensions
95+
96+
97+
#Update repo
98+
& $git add "-A"
99+
& $git commit "-m Update FunnelWeb build"
100+
& $git push origin master
101+
102+
popd
103+

build/build.proj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@
9696
<MSBuild Projects="$(Root)\src\FunnelWeb.Web\FunnelWeb.Web.csproj"
9797
Targets="ResolveReferences;_CopyWebApplication;_CopyBinDeployableAssemblies"
9898
Properties="Configuration=Release;WebProjectOutputDir=$(Root)\build\Published\;OutDir=$(Root)\build\Published\bin\" />
99+
100+
<MSBuild Projects="$(Root)\src\FunnelWeb.Azure\FunnelWeb.Azure.ccproj"
101+
Targets="Publish"
102+
Properties="Configuration=Release;PublishDir=$(Root)\build\Artifacts\" />
99103
<!-- Also copy extensions -->
100104
<ItemGroup>
101105
<ExtensionsToPublish Include="$(Root)\src\FunnelWeb.Web\bin\Extensions\*.dll" />

src/FunnelWeb.Web/FunnelWeb.Web.csproj

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,6 @@
2828
<IISExpressWindowsAuthentication />
2929
<IISExpressUseClassicPipelineMode />
3030
</PropertyGroup>
31-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
32-
<DebugSymbols>true</DebugSymbols>
33-
<DebugType>full</DebugType>
34-
<Optimize>false</Optimize>
35-
<OutputPath>bin\</OutputPath>
36-
<DefineConstants>DEBUG;TRACE</DefineConstants>
37-
<ErrorReport>prompt</ErrorReport>
38-
<WarningLevel>4</WarningLevel>
39-
</PropertyGroup>
40-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
41-
<DebugType>pdbonly</DebugType>
42-
<Optimize>true</Optimize>
43-
<OutputPath>bin\</OutputPath>
44-
<DefineConstants>TRACE</DefineConstants>
45-
<ErrorReport>prompt</ErrorReport>
46-
<WarningLevel>4</WarningLevel>
47-
</PropertyGroup>
4831
<ItemGroup>
4932
<Reference Include="Autofac, Version=2.6.3.862, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">
5033
<SpecificVersion>False</SpecificVersion>
@@ -97,6 +80,15 @@
9780
<HintPath>C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies\Microsoft.Web.Infrastructure.dll</HintPath>
9881
<Private>False</Private>
9982
</Reference>
83+
<Reference Include="Microsoft.WindowsAzure.Configuration, Version=1.7.0.0, Culture=neutral, processorArchitecture=MSIL">
84+
<HintPath>..\packages\Microsoft.WindowsAzure.ConfigurationManager.1.7.0.1\lib\net35-full\Microsoft.WindowsAzure.Configuration.dll</HintPath>
85+
</Reference>
86+
<Reference Include="Microsoft.WindowsAzure.ServiceRuntime, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
87+
<Private>True</Private>
88+
</Reference>
89+
<Reference Include="Microsoft.WindowsAzure.StorageClient, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
90+
<HintPath>..\packages\WindowsAzure.Storage.1.7.0.0\lib\net35-full\Microsoft.WindowsAzure.StorageClient.dll</HintPath>
91+
</Reference>
10092
<Reference Include="MiniProfiler, Version=2.0.2.0, Culture=neutral, PublicKeyToken=b44f9351044011a3, processorArchitecture=MSIL">
10193
<SpecificVersion>False</SpecificVersion>
10294
<HintPath>..\packages\MiniProfiler.2.0.2\lib\net40\MiniProfiler.dll</HintPath>
@@ -512,6 +504,24 @@
512504
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
513505
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
514506
</PropertyGroup>
507+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
508+
<DebugSymbols>true</DebugSymbols>
509+
<OutputPath>bin\</OutputPath>
510+
<DefineConstants>DEBUG;TRACE</DefineConstants>
511+
<DebugType>full</DebugType>
512+
<PlatformTarget>AnyCPU</PlatformTarget>
513+
<ErrorReport>prompt</ErrorReport>
514+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
515+
</PropertyGroup>
516+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
517+
<OutputPath>bin\</OutputPath>
518+
<DefineConstants>TRACE</DefineConstants>
519+
<Optimize>true</Optimize>
520+
<DebugType>pdbonly</DebugType>
521+
<PlatformTarget>AnyCPU</PlatformTarget>
522+
<ErrorReport>prompt</ErrorReport>
523+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
524+
</PropertyGroup>
515525
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
516526
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
517527
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />

src/FunnelWeb.Web/Global.asax.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ namespace FunnelWeb.Web
3333
public class MvcApplication : HttpApplication
3434
{
3535
private static string extensionsPath;
36+
private static string basePath;
3637

3738
public static void BeforeApplicationStart()
3839
{
@@ -95,6 +96,24 @@ private void Application_Start()
9596
ViewEngines.Engines.Add(new FunnelWebViewEngine());
9697

9798
ControllerBuilder.Current.SetControllerFactory(new FunnelWebControllerFactory(container));
99+
basePath = Server.MapPath("/");
100+
AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
101+
}
102+
103+
// Unfortunately this unmanaged dll is required by azure to check if we are running in azure
104+
// There is also a x86 and x64 version which is why we have to take this approach
105+
static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
106+
{
107+
if (args.Name.StartsWith("msshrtmi,", StringComparison.OrdinalIgnoreCase))
108+
{
109+
var fileName = Path.Combine(basePath, "bin", ((IntPtr.Size == 4) ? "x86" : "amd64"), "msshrtmi.dll");
110+
111+
AppDomain.CurrentDomain.AssemblyResolve -= CurrentDomain_AssemblyResolve;
112+
113+
return Assembly.LoadFile(fileName);
114+
}
115+
116+
return null;
98117
}
99118

100119
protected void Application_EndRequest()
261 KB
Binary file not shown.
239 KB
Binary file not shown.

src/FunnelWeb.Web/packages.config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@
1212
<package id="jQuery.UI.Combined" version="1.8.20" targetFramework="net40" />
1313
<package id="jQuery.Validation" version="1.9" />
1414
<package id="Microsoft.SqlServer.Compact" version="4.0.8854.2" targetFramework="net40" />
15+
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="1.7.0.1" targetFramework="net40" />
1516
<package id="MiniProfiler" version="2.0.2" targetFramework="net40" />
1617
<package id="NHibernate" version="3.3.1.4000" targetFramework="net40" />
1718
<package id="SqlServerCompact" version="4.0.8854.1" targetFramework="net40" />
19+
<package id="WindowsAzure.Storage" version="1.7.0.0" targetFramework="net40" />
1820
<package id="xmlrpcnet" version="3.0.0.266" targetFramework="net40" />
1921
<package id="xmlrpcnet-server" version="3.0.0.266" targetFramework="net40" />
2022
</packages>

src/FunnelWeb.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{19CE1D
1515
.nuget\NuGet.targets = .nuget\NuGet.targets
1616
EndProjectSection
1717
EndProject
18-
Project("{868A99DF-6AFA-3F46-9F74-A7FB69C37E31}") = "FunnelWeb.Azure", "FunnelWeb.Azure\FunnelWeb.Azure.ccproj", "{9C40F45A-2834-49C4-8304-0E30751D8BF2}"
18+
Project("{CC5FD16D-436D-48AD-A40C-5A424C6E3E79}") = "FunnelWeb.Azure", "FunnelWeb.Azure\FunnelWeb.Azure.ccproj", "{9C40F45A-2834-49C4-8304-0E30751D8BF2}"
1919
EndProject
2020
Global
2121
GlobalSection(SolutionConfigurationPlatforms) = preSolution

0 commit comments

Comments
 (0)