Merge Commit
This commit is contained in:
commit
836527047c
1 changed files with 29 additions and 4 deletions
|
@ -29,6 +29,8 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Xml;
|
||||
using Microsoft.Win32;
|
||||
using WebsitePanel.Providers.SharePoint;
|
||||
using WebsitePanel.Providers.Utils;
|
||||
|
@ -306,13 +308,13 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
|
||||
try
|
||||
{
|
||||
Type type = typeof (HostedSharePointServer2013Impl);
|
||||
var info = new AppDomainSetup {ApplicationBase = Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory), PrivateBinPath = "bin; bin/debug"};
|
||||
Type type = typeof(HostedSharePointServer2013Impl);
|
||||
var info = new AppDomainSetup { ApplicationBase = Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory), PrivateBinPath = GetPrivateBinPath() };
|
||||
domain = AppDomain.CreateDomain("WSS30", null, info);
|
||||
var impl = (HostedSharePointServer2013Impl) domain.CreateInstanceAndUnwrap(type.Assembly.FullName, type.FullName);
|
||||
var impl = (HostedSharePointServer2013Impl)domain.CreateInstanceAndUnwrap(type.Assembly.FullName, type.FullName);
|
||||
|
||||
return action(impl);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (domain != null)
|
||||
|
@ -320,6 +322,29 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
AppDomain.Unload(domain);
|
||||
}
|
||||
}
|
||||
|
||||
throw new ArgumentNullException("action");
|
||||
}
|
||||
|
||||
/// <summary> Getting PrivatePath from web.config. </summary>
|
||||
/// <returns> The PrivateBinPath.</returns>
|
||||
private static string GetPrivateBinPath()
|
||||
{
|
||||
var lines = new List<string>{ "bin", "bin/debug" };
|
||||
string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "web.config");
|
||||
|
||||
if (File.Exists(path))
|
||||
{
|
||||
using (var reader = new StreamReader(path))
|
||||
{
|
||||
string content = reader.ReadToEnd();
|
||||
var pattern = new Regex(@"(?<=probing .*?privatePath\s*=\s*"")[^""]+(?="".*?>)");
|
||||
Match match = pattern.Match(content);
|
||||
lines.AddRange(match.Value.Split(';'));
|
||||
}
|
||||
}
|
||||
|
||||
return string.Join(Path.PathSeparator.ToString(), lines.ToArray());
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue