Browse Source

Deprecate AppDomainLaunchHelper (it's much better to manually launch AppDomains inside AddIns).

Copyright end date 2008->2009.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@3746 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 17 years ago
parent
commit
c3cc141fe4
  1. 69
      doc/AssemblyBaseAddresses.txt
  2. 2
      src/AddIns/Misc/CodeAnalysis/Src/FxCopRule.cs
  3. 45
      src/AddIns/Misc/CodeAnalysis/Src/FxCopWrapper.cs
  4. 4
      src/AddIns/Misc/StartPage/Project/Src/ICSharpCodePage.cs
  5. 2
      src/Main/Base/Project/Resources/CommonAboutDialog.xfrm
  6. 3
      src/Main/Core/Project/Src/Util/AppDomainLaunchHelper.cs
  7. 2
      src/Main/GlobalAssemblyInfo.template

69
doc/AssemblyBaseAddresses.txt

@ -1,69 +0,0 @@ @@ -1,69 +0,0 @@
To be on the safe side and leave enough space for the future,
the in-memory size of an assembly used here should be 8 times the disk image size.
That should allow an assembly to grow to more than twice its old size without having to update this list.
Sysinternals Processexplorer can show relocated assemblies in yellow in the DLL View.
adr = 0x5000000
def AddModule(kbsize as int):
print "0x${adr.ToString('x')} - 0x${(adr + 3 * kbsize * 1024).ToString('x')}"
adr += 8 * kbsize * 1024
adr = 0x80000 * System.Math.Ceiling(cast(double,adr) / 0x80000)
def AddModules(*names as (string)):
for name in names:
System.Console.Write("${name}:\t")
AddModule(System.IO.FileInfo("d:\\serralongue\\sharpdevelop\\bin\\" + name + ".dll").Length / 1024)
All addresses are between 0x0500 0000 and 0x0fff ffff
AssemblyName: startaddress - endaddress
ICSharpCode.Core: 0x5000000 - 0x504e000
ICSharpCode.SharpDevelop: 0x5100000 - 0x5472000
ICSharpCode.NRefactory: 0x5a80000 - 0x5b9a000
ICSharpCode.TextEditor: 0x5d80000 - 0x5e67000
ICSharpCode.SharpDevelop.Sda: 0x6000000 - 0x601e000
WeifenLuo.WinFormsUI.Docking: 0x6080000 - 0x6107000
ICSharpCode.Build.Tasks: 0x6200000 - 0x621b000
CSharpBinding: 0x6280000 - 0x62bc000
ILAsmBinding: 0x6380000 - 0x639b000
VBNetBinding: 0x6400000 - 0x643f000
NRefactoryToBooConverter: 0x6500000 - 0x6536000
BooBinding: 0x6600000 - 0x664e000
FormsDesigner: 0x6700000 - 0x676f000
ResourceEditor: 0x6880000 - 0x689e000
XmlEditor: 0x6900000 - 0x6948000
ICSharpCode.AddInMananger: 0x6a00000 - 0x6a24000
AddInScout: 0x6a80000 - 0x6a8b400
CodeCoverage: 0x6b00000 - 0x6b30000
TreeListView (debugger): 0x6b80000 - 0x6be6000
Debugger.Code: 0x6d00000 - 0x6ddb000
Debugger.AddIn: 0x6f80000 - 0x6faa000
FileTypeRegisterer: 0x7000000 - 0x7009000
HighlightingEditor: 0x7080000 - 0x70ec000
HtmlHelp2: 0x7200000 - 0x723f000
HtmlHelp2JScriptGlobals: 0x7300000 - 0x7306c00
MonoAddIn: 0x7380000 - 0x7395000
NAntAddIn: 0x7400000 - 0x7427000
PInvokeAddIn: 0x7480000 - 0x749b000
RegExpTk: 0x7500000 - 0x7524000
SharpQuery: 0x7580000 - 0x75b0000
SharpReportCore: 0x7600000 - 0x7654000
SharpReport: 0x7700000 - 0x773c000
SharpReportAddIn: 0x7800000 - 0x781e000
ReportGenerator: 0x7880000 - 0x78a1000
StartPage: 0x7900000 - 0x791e000
UnitTesting: 0x7980000 - 0x799b000
Mono.Cecil: 0x7a00000 - 0x7b38000
WixBinding: 0x7d80000 - 0x7dc2000
ICSharpCode.SharpDevelop.Dom: 0x7e80000 - 0x7f19000
CodeAnalysis: 0x8000000 - 0x8021000
IconEditor: 0x8080000 - 0x80a1000
IconEditor.AddIn: 0x8100000 - 0x810c000
SharpDbTools: 0x8180000 - 0x819e000
ICSharpCode.SD.Widgets: 0x8240000 - 0x827c000
Next free address: 0x08300000

2
src/AddIns/Misc/CodeAnalysis/Src/FxCopRule.cs

@ -10,6 +10,7 @@ using System.Collections.Generic; @@ -10,6 +10,7 @@ using System.Collections.Generic;
namespace ICSharpCode.CodeAnalysis
{
[Serializable]
public class FxCopRule : IComparable
{
readonly string checkId;
@ -73,6 +74,7 @@ namespace ICSharpCode.CodeAnalysis @@ -73,6 +74,7 @@ namespace ICSharpCode.CodeAnalysis
}
}
[Serializable]
public class FxCopCategory
{
readonly string name;

45
src/AddIns/Misc/CodeAnalysis/Src/FxCopWrapper.cs

@ -16,7 +16,7 @@ using Microsoft.Win32; @@ -16,7 +16,7 @@ using Microsoft.Win32;
namespace ICSharpCode.CodeAnalysis
{
public static class FxCopWrapper
public class FxCopWrapper : MarshalByRefObject
{
static Dictionary<string[], List<FxCopCategory>> ruleDict = new Dictionary<string[], List<FxCopCategory>>(new ArrayHashCodeProvider());
@ -178,20 +178,24 @@ namespace ICSharpCode.CodeAnalysis @@ -178,20 +178,24 @@ namespace ICSharpCode.CodeAnalysis
setup.ApplicationBase = fxCopPath;
AppDomain domain = AppDomain.CreateDomain("FxCop Rule Loading Domain", AppDomain.CurrentDomain.Evidence, setup);
string[][] ruleTextList;
ResolveEventHandler onResolve = delegate(object sender, ResolveEventArgs args) {
if (args.Name == typeof(FxCopWrapper).Assembly.FullName) {
return typeof(FxCopWrapper).Assembly;
} else {
return null;
}
};
FxCopRule[] ruleList;
try {
ruleTextList = (string[][])AppDomainLaunchHelper.LaunchInAppDomain(domain, typeof(FxCopWrapper), "GetRuleListInCurrentAppDomain", fxCopPath, ruleAssemblies);
AppDomain.CurrentDomain.AssemblyResolve += onResolve;
FxCopWrapper wrapper = (FxCopWrapper)domain.CreateInstanceFromAndUnwrap(typeof(FxCopWrapper).Assembly.Location, typeof(FxCopWrapper).FullName);
ruleList = wrapper.GetRuleListInstanceMethod(fxCopPath, ruleAssemblies);
} finally {
AppDomain.CurrentDomain.AssemblyResolve -= onResolve;
AppDomain.Unload(domain);
}
FxCopRule[] ruleList = new FxCopRule[ruleTextList.Length];
for (int i = 0; i < ruleTextList.Length; i++) {
ruleList[i] = new FxCopRule(ruleTextList[i][0], ruleTextList[i][1],
ruleTextList[i][2], ruleTextList[i][3],
ruleTextList[i][4]);
}
Array.Sort(ruleList);
List<FxCopCategory> rules = new List<FxCopCategory>();
lock (ruleDict) {
@ -236,7 +240,7 @@ namespace ICSharpCode.CodeAnalysis @@ -236,7 +240,7 @@ namespace ICSharpCode.CodeAnalysis
return v.ToString();
}
public static string[][] GetRuleListInCurrentAppDomain(string fxCopPath, string[] ruleAssemblies)
FxCopRule[] GetRuleListInstanceMethod(string fxCopPath, string[] ruleAssemblies)
{
Assembly asm = Assembly.LoadFrom(Path.Combine(fxCopPath, "FxCopCommon.dll"));
@ -253,20 +257,21 @@ namespace ICSharpCode.CodeAnalysis @@ -253,20 +257,21 @@ namespace ICSharpCode.CodeAnalysis
object exceptionList = CallMethod(project, "Initialize");
foreach (Exception ex in ((IEnumerable)exceptionList)) {
LoggingService.Warn(ex);
Console.WriteLine(ex.ToString());
}
IEnumerable ruleList = (IEnumerable)GetProp(GetProp(project, "AllRules"), "Values");
List<string[]> rules = new List<string[]>();
List<FxCopRule> rules = new List<FxCopRule>();
foreach (object ruleContainer in ruleList) {
object rule = GetProp(ruleContainer, "IRule");
rules.Add(new string[] {
GetSProp(rule, "CheckId"),
GetSProp(rule, "Name"),
GetSProp(rule, "Category"),
GetSProp(rule, "Description"),
GetSProp(rule, "Url")
});
rules.Add(new FxCopRule(
GetSProp(rule, "CheckId"),
GetSProp(rule, "Name"),
GetSProp(rule, "Category"),
GetSProp(rule, "Description"),
GetSProp(rule, "Url")
));
}
return rules.ToArray();

4
src/AddIns/Misc/StartPage/Project/Src/ICSharpCodePage.cs

@ -202,7 +202,7 @@ namespace ICSharpCode.StartPage @@ -202,7 +202,7 @@ namespace ICSharpCode.StartPage
StaticStyleSheet = startPageLocation + "/Layout/default.css";
MetaAuthor = "Christoph Wille - christophw@alphasierrapapa.com";
MetaCopyright = "(c) 2001-2008 AlphaSierraPapa";
MetaCopyright = "(c) 2001-2009 AlphaSierraPapa";
ShowLeftMenu = false;
ShowRightBox = false;
@ -475,7 +475,7 @@ namespace ICSharpCode.StartPage @@ -475,7 +475,7 @@ namespace ICSharpCode.StartPage
builder.Append(m_strMainColColor);
builder.Append("\" class=\"copy\"><img src=\""+ startPageLocation + "/Layout/Common/blind.gif\" width=15 height=1>");
builder.Append("<font size=\"-2\">");
builder.Append("Copyright &copy;2000-2008 <A HREF=\"mailto:webmaster@icsharpcode.net\" title=\"");
builder.Append("Copyright &copy;2000-2009 <A HREF=\"mailto:webmaster@icsharpcode.net\" title=\"");
builder.Append(StringParser.Parse("${res:StartPage.ContactUs}"));
builder.Append("\">IC#SharpCode</a>. ");
builder.Append(ICSharpCode.SharpDevelop.Gui.AboutSharpDevelopTabPage.LicenseSentence);

2
src/Main/Base/Project/Resources/CommonAboutDialog.xfrm

@ -26,7 +26,7 @@ @@ -26,7 +26,7 @@
<!-- The copyright label -->
<System.Windows.Forms.Label>
<Text value = "(c) 2000-2008 by icsharpcode.net"/>
<Text value = "(c) 2000-2009 by icsharpcode.net"/>
<Width value = "400"/>
<Height value = "20"/>
<Location value = "{X=8, Y=234}"/>

3
src/Main/Core/Project/Src/Util/AppDomainLaunchHelper.cs

@ -35,10 +35,11 @@ namespace ICSharpCode.Core @@ -35,10 +35,11 @@ namespace ICSharpCode.Core
/// [Serializable] class Request { ... } // must be serializable !!!
/// [Serializable] class ResultClass { ... } // must be serializable !!!
/// </code></example>
[Obsolete("This class is broken, serialization does not work and addin dependencies are not loaded in the AppDomain")]
public class AppDomainLaunchHelper : MarshalByRefObject
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")]
public object LaunchMethod(string assemblyFile, string typeName, string methodName, object[] arguments)
object LaunchMethod(string assemblyFile, string typeName, string methodName, object[] arguments)
{
Type t = Assembly.LoadFrom(assemblyFile).GetType(typeName);
return t.InvokeMember(methodName, (BindingFlags.Public | BindingFlags.Static | BindingFlags.InvokeMethod), null, null, arguments, CultureInfo.InvariantCulture);

2
src/Main/GlobalAssemblyInfo.template

@ -20,7 +20,7 @@ using System.Reflection; @@ -20,7 +20,7 @@ using System.Reflection;
[assembly: System.Runtime.InteropServices.ComVisible(false)]
[assembly: AssemblyCompany("ic#code")]
[assembly: AssemblyProduct("SharpDevelop")]
[assembly: AssemblyCopyright("2000-2008 AlphaSierraPapa")]
[assembly: AssemblyCopyright("2000-2009 AlphaSierraPapa")]
[assembly: AssemblyVersion(RevisionClass.FullVersion)]
[assembly: NeutralResourcesLanguage("en-US")]

Loading…
Cancel
Save