Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono-addins.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLluis Sanchez <llsan@microsoft.com>2021-07-14 18:24:27 +0300
committerLluis Sanchez <llsan@microsoft.com>2021-07-14 18:24:27 +0300
commit69fb254622ad4aabaef822ac86ebe4070dfe6be5 (patch)
tree0d309ba75bca0ffa1e9619872549ac6a33548451
parent380cce0bc9e2f8ae8ea117937583eb8f7f0248cd (diff)
Mono.Addins is now using multitargetting
Bring back SetupDomain to be used only when targeting .net framework. When target is .net core, use the local scanner, but for the use of the cecil loader.
-rw-r--r--Mono.Addins.MSBuild/Mono.Addins.MSBuild.csproj2
-rw-r--r--Mono.Addins.SetupProcess/Mono.Addins.SetupProcess.csproj38
-rw-r--r--Mono.Addins.SetupProcess/SetupProcessTool.cs75
-rw-r--r--Mono.Addins.sln47
-rw-r--r--Mono.Addins/Mono.Addins.Database/AddinDatabase.cs6
-rw-r--r--Mono.Addins/Mono.Addins.Database/AddinFileSystemExtension.cs9
-rw-r--r--Mono.Addins/Mono.Addins.Database/ProcessFailedException.cs69
-rw-r--r--Mono.Addins/Mono.Addins.Database/SetupDomain.cs3
-rw-r--r--Mono.Addins/Mono.Addins.Database/SetupProcess.cs154
-rw-r--r--Mono.Addins/Mono.Addins.csproj9
-rw-r--r--Test/CommandExtension/CommandExtension.csproj4
-rw-r--r--Test/FileContentExtension/FileContentExtension.csproj4
-rw-r--r--Test/FileExtender/FileExtender.csproj6
-rw-r--r--Test/HelloWorldExtension/HelloWorldExtension.csproj6
-rw-r--r--Test/MultiAssemblyAddin/MultiAssemblyAddin.csproj6
-rw-r--r--Test/MultiAssemblyAddin/OptionalModule/OptionalModule.csproj4
-rw-r--r--Test/MultiAssemblyAddin/SecondAssembly/SecondAssembly.csproj4
-rw-r--r--Test/SystemInfoExtension/SystemInfoExtension.csproj6
18 files changed, 106 insertions, 346 deletions
diff --git a/Mono.Addins.MSBuild/Mono.Addins.MSBuild.csproj b/Mono.Addins.MSBuild/Mono.Addins.MSBuild.csproj
index 7d3c8e6..1883042 100644
--- a/Mono.Addins.MSBuild/Mono.Addins.MSBuild.csproj
+++ b/Mono.Addins.MSBuild/Mono.Addins.MSBuild.csproj
@@ -36,8 +36,6 @@
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="16.8.0" />
<ProjectReference Include="..\Mono.Addins.Setup\Mono.Addins.Setup.csproj" />
<ProjectReference Include="..\Mono.Addins\Mono.Addins.csproj">
- <Project>{91DD5A2D-9FE3-4C3C-9253-876141874DAD}</Project>
- <Name>Mono.Addins</Name>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
diff --git a/Mono.Addins.SetupProcess/Mono.Addins.SetupProcess.csproj b/Mono.Addins.SetupProcess/Mono.Addins.SetupProcess.csproj
deleted file mode 100644
index 9d1b59f..0000000
--- a/Mono.Addins.SetupProcess/Mono.Addins.SetupProcess.csproj
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project Sdk="Microsoft.NET.Sdk">
- <Import Project="..\TargetFrameworks.props" />
- <Import Project="..\Version.props" />
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.30703</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{303D2716-94AA-4067-8111-F478D26DFAFE}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <RootNamespace>Mono.Addins.SetupProcess</RootNamespace>
- <AssemblyName>Mono.Addins.SetupProcess</AssemblyName>
- <SignAssembly>True</SignAssembly>
- <AssemblyOriginatorKeyFile>..\mono-addins.snk</AssemblyOriginatorKeyFile>
- <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>..\bin</OutputPath>
- <DefineConstants>DEBUG;</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <ExternalConsole>true</ExternalConsole>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <Optimize>true</Optimize>
- <OutputPath>..\bin</OutputPath>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <ExternalConsole>true</ExternalConsole>
- </PropertyGroup>
- <ItemGroup>
- <ProjectReference Include="..\Mono.Addins\Mono.Addins.csproj" />
- </ItemGroup>
-</Project> \ No newline at end of file
diff --git a/Mono.Addins.SetupProcess/SetupProcessTool.cs b/Mono.Addins.SetupProcess/SetupProcessTool.cs
deleted file mode 100644
index 65f0032..0000000
--- a/Mono.Addins.SetupProcess/SetupProcessTool.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-//
-// SetupProcessTool.cs
-//
-// Author:
-// Marius Ungureanu <maungu@microsoft.com>
-//
-// Copyright (c) 2019 Microsoft Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using Mono.Addins.Database;
-
-namespace Mono.Addins.SetupProcess
-{
- class SetupProcessTool
- {
- public static int Main (string [] args)
- {
- ProcessProgressStatus monitor = new ProcessProgressStatus (int.Parse (args [0]));
-
- try {
- string registryPath = Console.In.ReadLine ();
- string startupDir = Console.In.ReadLine ();
- string addinsDir = Console.In.ReadLine ();
- string databaseDir = Console.In.ReadLine ();
-
- AddinDatabase.RunningSetupProcess = true;
- AddinRegistry reg = new AddinRegistry (registryPath, startupDir, addinsDir, databaseDir);
-
- switch (args [1]) {
- case "scan": {
- string folder = args.Length > 2 ? args [2] : null;
- if (folder.Length == 0) folder = null;
-
- var context = new ScanOptions ();
- context.Read (Console.In);
- reg.ScanFolders (monitor, folder, context);
- break;
- }
- case "pre-scan": {
- string folder = args.Length > 2 ? args [2] : null;
- if (folder.Length == 0) folder = null;
- var recursive = bool.Parse (Console.In.ReadLine ());
- reg.GenerateScanDataFilesInProcess (monitor, folder, recursive);
- break;
- }
- case "get-desc":
- var outFile = Console.In.ReadLine ();
- reg.ParseAddin (monitor, args [2], outFile);
- break;
- }
- } catch (Exception ex) {
- monitor.ReportError ("Unexpected error in setup process", ex);
- return 1;
- }
- return 0;
- }
- }
-}
diff --git a/Mono.Addins.sln b/Mono.Addins.sln
index ad51470..0ba5458 100644
--- a/Mono.Addins.sln
+++ b/Mono.Addins.sln
@@ -29,8 +29,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SecondAssembly", "Test\Mult
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OptionalModule", "Test\MultiAssemblyAddin\OptionalModule\OptionalModule.csproj", "{B051C84E-48CC-448D-B00C-1525EB64E4BE}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GuiTester", "Test\GuiTester\GuiTester.csproj", "{87331208-C6EA-4F1E-99A6-595778EFA39E}"
-EndProject
Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "docs", "docs\docs.mdproj", "{87EADEFB-B389-4479-9C36-CDAA07839983}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Addins.Setup", "Mono.Addins.Setup\Mono.Addins.Setup.csproj", "{A85C9721-C054-4BD8-A1F3-0227615F0A36}"
@@ -39,9 +37,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Addins.CecilReflector"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Addins.MSBuild", "Mono.Addins.MSBuild\Mono.Addins.MSBuild.csproj", "{B4B44F14-32C3-4D50-8C6A-06AA30E56CA3}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Addins.GuiGtk3", "Mono.Addins.GuiGtk3\Mono.Addins.GuiGtk3.csproj", "{410A7DC9-E7DA-43E6-B592-93E2A344B660}"
+Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "GuiTester", "Test\GuiTester\GuiTester.csproj", "{25775384-98F2-474A-B943-71A0872DC53B}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Addins.SetupProcess", "Mono.Addins.SetupProcess\Mono.Addins.SetupProcess.csproj", "{303D2716-94AA-4067-8111-F478D26DFAFE}"
+Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "Mono.Addins.GuiGtk3", "Mono.Addins.GuiGtk3\Mono.Addins.GuiGtk3.csproj", "{416C2B14-E4DB-49D7-865D-2183D0BB526E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -79,13 +77,6 @@ Global
{2FF5459A-495C-4FDF-81EA-D0A6C07E7C0D}.DebugWin32|Any CPU.ActiveCfg = Debug|Any CPU
{2FF5459A-495C-4FDF-81EA-D0A6C07E7C0D}.Release|Any CPU.ActiveCfg = Debug|Any CPU
{2FF5459A-495C-4FDF-81EA-D0A6C07E7C0D}.Release|Any CPU.Build.0 = Debug|Any CPU
- {410A7DC9-E7DA-43E6-B592-93E2A344B660}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {410A7DC9-E7DA-43E6-B592-93E2A344B660}.DebugGtk3|Any CPU.ActiveCfg = Debug|Any CPU
- {410A7DC9-E7DA-43E6-B592-93E2A344B660}.DebugGtk3|Any CPU.Build.0 = Debug|Any CPU
- {410A7DC9-E7DA-43E6-B592-93E2A344B660}.DebugNoGui|Any CPU.ActiveCfg = Debug|Any CPU
- {410A7DC9-E7DA-43E6-B592-93E2A344B660}.DebugWin32|Any CPU.ActiveCfg = Debug|Any CPU
- {410A7DC9-E7DA-43E6-B592-93E2A344B660}.DebugWin32|Any CPU.Build.0 = Debug|Any CPU
- {410A7DC9-E7DA-43E6-B592-93E2A344B660}.Release|Any CPU.ActiveCfg = Release|Any CPU
{42D1CE65-A14B-4218-B787-58AD7AA68513}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{42D1CE65-A14B-4218-B787-58AD7AA68513}.Debug|Any CPU.Build.0 = Debug|Any CPU
{42D1CE65-A14B-4218-B787-58AD7AA68513}.DebugGtk3|Any CPU.ActiveCfg = Debug|Any CPU
@@ -105,13 +96,6 @@ Global
{4F29F0C0-725A-4927-9931-AAB0A595F370}.DebugWin32|Any CPU.ActiveCfg = Debug|Any CPU
{4F29F0C0-725A-4927-9931-AAB0A595F370}.Release|Any CPU.ActiveCfg = Debug|Any CPU
{4F29F0C0-725A-4927-9931-AAB0A595F370}.Release|Any CPU.Build.0 = Debug|Any CPU
- {87331208-C6EA-4F1E-99A6-595778EFA39E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {87331208-C6EA-4F1E-99A6-595778EFA39E}.DebugGtk3|Any CPU.ActiveCfg = Debug|Any CPU
- {87331208-C6EA-4F1E-99A6-595778EFA39E}.DebugGtk3|Any CPU.Build.0 = Debug|Any CPU
- {87331208-C6EA-4F1E-99A6-595778EFA39E}.DebugNoGui|Any CPU.ActiveCfg = Debug|Any CPU
- {87331208-C6EA-4F1E-99A6-595778EFA39E}.DebugWin32|Any CPU.ActiveCfg = Debug|Any CPU
- {87331208-C6EA-4F1E-99A6-595778EFA39E}.DebugWin32|Any CPU.Build.0 = Debug|Any CPU
- {87331208-C6EA-4F1E-99A6-595778EFA39E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{87EADEFB-B389-4479-9C36-CDAA07839983}.Debug|Any CPU.ActiveCfg = Default|Any CPU
{87EADEFB-B389-4479-9C36-CDAA07839983}.DebugGtk3|Any CPU.ActiveCfg = Default|Any CPU
{87EADEFB-B389-4479-9C36-CDAA07839983}.DebugNoGui|Any CPU.ActiveCfg = Default|Any CPU
@@ -210,16 +194,21 @@ Global
{FEC19BDA-4904-4005-8C09-68E82E8BEF6A}.DebugWin32|Any CPU.Build.0 = Debug|Any CPU
{FEC19BDA-4904-4005-8C09-68E82E8BEF6A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FEC19BDA-4904-4005-8C09-68E82E8BEF6A}.Release|Any CPU.Build.0 = Release|Any CPU
- {303D2716-94AA-4067-8111-F478D26DFAFE}.DebugWin32|Any CPU.ActiveCfg = Debug|Any CPU
- {303D2716-94AA-4067-8111-F478D26DFAFE}.DebugWin32|Any CPU.Build.0 = Debug|Any CPU
- {303D2716-94AA-4067-8111-F478D26DFAFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {303D2716-94AA-4067-8111-F478D26DFAFE}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {303D2716-94AA-4067-8111-F478D26DFAFE}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {303D2716-94AA-4067-8111-F478D26DFAFE}.Release|Any CPU.Build.0 = Release|Any CPU
- {303D2716-94AA-4067-8111-F478D26DFAFE}.DebugNoGui|Any CPU.ActiveCfg = Debug|Any CPU
- {303D2716-94AA-4067-8111-F478D26DFAFE}.DebugNoGui|Any CPU.Build.0 = Debug|Any CPU
- {303D2716-94AA-4067-8111-F478D26DFAFE}.DebugGtk3|Any CPU.ActiveCfg = Debug|Any CPU
- {303D2716-94AA-4067-8111-F478D26DFAFE}.DebugGtk3|Any CPU.Build.0 = Debug|Any CPU
+ {FEC19BDA-4904-4005-8C09-68E82E8BEF6A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {25775384-98F2-474A-B943-71A0872DC53B}.DebugWin32|Any CPU.ActiveCfg = Debug|Any CPU
+ {25775384-98F2-474A-B943-71A0872DC53B}.DebugWin32|Any CPU.Build.0 = Debug|Any CPU
+ {25775384-98F2-474A-B943-71A0872DC53B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {25775384-98F2-474A-B943-71A0872DC53B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {25775384-98F2-474A-B943-71A0872DC53B}.DebugNoGui|Any CPU.ActiveCfg = Debug|Any CPU
+ {25775384-98F2-474A-B943-71A0872DC53B}.DebugGtk3|Any CPU.ActiveCfg = Debug|Any CPU
+ {25775384-98F2-474A-B943-71A0872DC53B}.DebugGtk3|Any CPU.Build.0 = Debug|Any CPU
+ {416C2B14-E4DB-49D7-865D-2183D0BB526E}.DebugWin32|Any CPU.ActiveCfg = Debug|Any CPU
+ {416C2B14-E4DB-49D7-865D-2183D0BB526E}.DebugWin32|Any CPU.Build.0 = Debug|Any CPU
+ {416C2B14-E4DB-49D7-865D-2183D0BB526E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {416C2B14-E4DB-49D7-865D-2183D0BB526E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {416C2B14-E4DB-49D7-865D-2183D0BB526E}.DebugNoGui|Any CPU.ActiveCfg = Debug|Any CPU
+ {416C2B14-E4DB-49D7-865D-2183D0BB526E}.DebugGtk3|Any CPU.ActiveCfg = Debug|Any CPU
+ {416C2B14-E4DB-49D7-865D-2183D0BB526E}.DebugGtk3|Any CPU.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{F109148D-849E-4044-8700-5E8EA0AB2476} = {7EFC0684-310E-417D-B8BD-5584C3F34BD5}
@@ -229,10 +218,10 @@ Global
{1CD51E61-1985-4D22-9BFA-D14C8FC61B46} = {7EFC0684-310E-417D-B8BD-5584C3F34BD5}
{A32AFFBA-4B83-4D6E-8CB3-812908BA14A9} = {7EFC0684-310E-417D-B8BD-5584C3F34BD5}
{0CE17344-E7E3-4620-B6D4-B04778EC5739} = {7EFC0684-310E-417D-B8BD-5584C3F34BD5}
- {87331208-C6EA-4F1E-99A6-595778EFA39E} = {7EFC0684-310E-417D-B8BD-5584C3F34BD5}
{8C374D09-E916-4C6C-A01B-43A06A0D0499} = {0CE17344-E7E3-4620-B6D4-B04778EC5739}
{EB38A832-1BA5-4073-910C-7ACC5F1D1AD4} = {0CE17344-E7E3-4620-B6D4-B04778EC5739}
{B051C84E-48CC-448D-B00C-1525EB64E4BE} = {0CE17344-E7E3-4620-B6D4-B04778EC5739}
+ {25775384-98F2-474A-B943-71A0872DC53B} = {7EFC0684-310E-417D-B8BD-5584C3F34BD5}
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
Policies = $0
diff --git a/Mono.Addins/Mono.Addins.Database/AddinDatabase.cs b/Mono.Addins/Mono.Addins.Database/AddinDatabase.cs
index fb7f721..34f931f 100644
--- a/Mono.Addins/Mono.Addins.Database/AddinDatabase.cs
+++ b/Mono.Addins/Mono.Addins.Database/AddinDatabase.cs
@@ -1823,9 +1823,13 @@ namespace Mono.Addins.Database
ISetupHandler GetSetupHandler ()
{
+ // .NET Core doesn't support domains, so it will always use SetupLocal, but it will
+ // avoid loading assemblies by forcing the use of the cecil reflector
+#if NET461
if (fs.RequiresIsolation)
- return new SetupProcess ();
+ return new SetupDomain ();
else
+#endif
return new SetupLocal ();
}
diff --git a/Mono.Addins/Mono.Addins.Database/AddinFileSystemExtension.cs b/Mono.Addins/Mono.Addins.Database/AddinFileSystemExtension.cs
index 6c812c4..5c113b2 100644
--- a/Mono.Addins/Mono.Addins.Database/AddinFileSystemExtension.cs
+++ b/Mono.Addins/Mono.Addins.Database/AddinFileSystemExtension.cs
@@ -189,9 +189,14 @@ namespace Mono.Addins.Database
t = Type.GetType (refName, false);
}
if (t != null)
- reflector = (IAssemblyReflector) Activator.CreateInstance (t);
- else
+ reflector = (IAssemblyReflector)Activator.CreateInstance (t);
+ else {
+#if NETFRAMEWORK
reflector = new DefaultAssemblyReflector ();
+#else
+ throw new InvalidOperationException ("CecilReflector assembly not found (Required when running in .NET Core)");
+#endif
+ }
reflector.Initialize (locator);
return reflector;
diff --git a/Mono.Addins/Mono.Addins.Database/ProcessFailedException.cs b/Mono.Addins/Mono.Addins.Database/ProcessFailedException.cs
new file mode 100644
index 0000000..576be40
--- /dev/null
+++ b/Mono.Addins/Mono.Addins.Database/ProcessFailedException.cs
@@ -0,0 +1,69 @@
+//
+// AddinDatabase.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+using System;
+using System.Threading;
+using System.Collections;
+using System.Collections.Specialized;
+using System.IO;
+using System.Xml;
+using System.Reflection;
+using Mono.Addins.Description;
+using System.Collections.Generic;
+using System.Linq;
+using Mono.Addins.Serialization;
+
+namespace Mono.Addins.Database
+{
+ class ProcessFailedException : Exception
+ {
+ StringCollection progessLog;
+
+ public ProcessFailedException(StringCollection progessLog) : this(progessLog, null)
+ {
+ }
+
+ public ProcessFailedException(StringCollection progessLog, Exception ex) : base("Setup process failed.", ex)
+ {
+ this.progessLog = progessLog;
+ }
+
+ public StringCollection ProgessLog
+ {
+ get { return progessLog; }
+ }
+
+ public string LastLog
+ {
+ get { return progessLog.Count > 0 ? progessLog[progessLog.Count - 1] : ""; }
+ }
+ }
+}
+
+
diff --git a/Mono.Addins/Mono.Addins.Database/SetupDomain.cs b/Mono.Addins/Mono.Addins.Database/SetupDomain.cs
index 1c3c797..77a746f 100644
--- a/Mono.Addins/Mono.Addins.Database/SetupDomain.cs
+++ b/Mono.Addins/Mono.Addins.Database/SetupDomain.cs
@@ -29,6 +29,7 @@ using System.Collections.Specialized;
namespace Mono.Addins.Database
{
+#if NET461
class SetupDomain: ISetupHandler
{
AppDomain domain;
@@ -216,4 +217,6 @@ namespace Mono.Addins.Database
}
}
}
+
+#endif
}
diff --git a/Mono.Addins/Mono.Addins.Database/SetupProcess.cs b/Mono.Addins/Mono.Addins.Database/SetupProcess.cs
deleted file mode 100644
index 6b0255f..0000000
--- a/Mono.Addins/Mono.Addins.Database/SetupProcess.cs
+++ /dev/null
@@ -1,154 +0,0 @@
-//
-// SetupProcess.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.Collections.Specialized;
-using System.IO;
-using System.Text;
-using System.Diagnostics;
-using System.Runtime.Serialization.Formatters.Binary;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Collections.Generic;
-
-namespace Mono.Addins.Database
-{
- class SetupProcess: ISetupHandler
- {
- public void Scan (IProgressStatus monitor, AddinRegistry registry, string scanFolder, ScanOptions context)
- {
- var data = new List<string> (context.Write ());
-
- ExecuteCommand (monitor, registry.RegistryPath, registry.StartupDirectory, registry.DefaultAddinsFolder, registry.AddinCachePath, "scan", scanFolder, data);
- }
-
- public void GenerateScanDataFiles (IProgressStatus monitor, AddinRegistry registry, string scanFolder, bool recursive)
- {
- ExecuteCommand (monitor, registry.RegistryPath, registry.StartupDirectory, registry.DefaultAddinsFolder, registry.AddinCachePath, "pre-scan", scanFolder, new List<string> { recursive.ToString() });
- }
-
- public void GetAddinDescription (IProgressStatus monitor, AddinRegistry registry, string file, string outFile)
- {
- ExecuteCommand (monitor, registry.RegistryPath, registry.StartupDirectory, registry.DefaultAddinsFolder, registry.AddinCachePath, "get-desc", file, new List<string> { outFile });
- }
-
- internal static void ExecuteCommand (IProgressStatus monitor, string registryPath, string startupDir, string addinsDir, string databaseDir, string name, string arg1, List<string> data)
- {
- string verboseParam = monitor.LogLevel.ToString ();
-
- // Arguments string
- StringBuilder sb = new StringBuilder ();
- sb.Append (verboseParam).Append (' ').Append (name);
- sb.Append (" \"").Append (arg1).Append ("\"");
-
- Process process = new Process ();
-
- try {
- process.StartInfo = CreateProcessStartInfo (sb.ToString ());
- process.StartInfo.WorkingDirectory = AppDomain.CurrentDomain.BaseDirectory;
- process.StartInfo.UseShellExecute = false;
- process.StartInfo.CreateNoWindow = true;
- process.StartInfo.RedirectStandardInput = true;
- process.StartInfo.RedirectStandardOutput = true;
- process.StartInfo.RedirectStandardError = true;
- process.EnableRaisingEvents = true;
- process.Start ();
-
- process.StandardInput.WriteLine (registryPath);
- process.StandardInput.WriteLine (startupDir);
- process.StandardInput.WriteLine (addinsDir);
- process.StandardInput.WriteLine (databaseDir);
-
- if (data != null) {
- foreach (var d in data)
- process.StandardInput.WriteLine (d);
- }
- process.StandardInput.Flush ();
-
- StringCollection progessLog = new StringCollection ();
- ProcessProgressStatus.MonitorProcessStatus (monitor, process.StandardOutput, progessLog);
- process.WaitForExit ();
- if (process.ExitCode != 0)
- throw new ProcessFailedException (progessLog);
-
- } catch (Exception ex) {
- Console.WriteLine (ex);
- throw;
- }
- }
-
- static ProcessStartInfo CreateProcessStartInfo (string arguments)
- {
- string thisAsmDir = Path.GetDirectoryName (typeof (SetupProcess).Assembly.Location);
- string asm = Path.Combine (thisAsmDir, "Mono.Addins.SetupProcess.exe");
-
- if (File.Exists (asm)) {
- if (Util.IsMono) {
- asm = asm.Replace (" ", @"\ ");
- return new ProcessStartInfo ("mono", "--debug " + asm + " " + arguments);
- }
- return new ProcessStartInfo (asm, arguments);
- }
-
- asm = Path.Combine(thisAsmDir, "Mono.Addins.SetupProcess");
- if (File.Exists (asm))
- return new ProcessStartInfo (asm, arguments);
-
- asm = Path.Combine (thisAsmDir, "Mono.Addins.SetupProcess.dll");
- if (File.Exists (asm)) {
- asm = asm.Replace (" ", @"\ ");
- return new ProcessStartInfo ("dotnet", asm + " " + arguments);
- }
-
- throw new InvalidOperationException ("Mono.Addins.SetupProcess not found");
- }
- }
-
- class ProcessFailedException: Exception
- {
- StringCollection progessLog;
-
- public ProcessFailedException (StringCollection progessLog): this (progessLog, null)
- {
- }
-
- public ProcessFailedException (StringCollection progessLog, Exception ex): base ("Setup process failed.", ex)
- {
- this.progessLog = progessLog;
- }
-
- public StringCollection ProgessLog {
- get { return progessLog; }
- }
-
- public string LastLog {
- get { return progessLog.Count > 0 ? progessLog [progessLog.Count - 1] : ""; }
- }
- }
-}
diff --git a/Mono.Addins/Mono.Addins.csproj b/Mono.Addins/Mono.Addins.csproj
index 2d2c614..a7412b8 100644
--- a/Mono.Addins/Mono.Addins.csproj
+++ b/Mono.Addins/Mono.Addins.csproj
@@ -9,17 +9,17 @@
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>..\mono-addins.snk</AssemblyOriginatorKeyFile>
<ProductVersion>8.0.30703</ProductVersion>
- <TargetFramework>netstandard2.0</TargetFramework>
+ <TargetFrameworks>net461;net5.0</TargetFrameworks>
<PackageId>Mono.Addins</PackageId>
<Description>Mono.Addins is a framework for creating extensible applications, and for creating add-ins which extend applications.</Description>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
- <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
+ <!--<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>-->
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>True</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
- <OutputPath>..\bin</OutputPath>
+ <OutputPath>..\bin\net461</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
@@ -30,7 +30,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>True</Optimize>
- <OutputPath>..\bin</OutputPath>
+ <OutputPath>..\bin\net461</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
@@ -46,7 +46,6 @@
</ItemGroup>
<ItemGroup>
<Compile Remove="CustomConditionAttribute.cs" />
- <Compile Remove="Mono.Addins.Database\SetupDomain.cs" />
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>Mono.Addins.Setup, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df</_Parameter1>
</AssemblyAttribute>
diff --git a/Test/CommandExtension/CommandExtension.csproj b/Test/CommandExtension/CommandExtension.csproj
index 744505c..f771259 100644
--- a/Test/CommandExtension/CommandExtension.csproj
+++ b/Test/CommandExtension/CommandExtension.csproj
@@ -28,13 +28,9 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\UnitTests\UnitTests.csproj">
- <Project>{1CD51E61-1985-4D22-9BFA-D14C8FC61B46}</Project>
- <Name>UnitTests</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\Mono.Addins\Mono.Addins.csproj">
- <Project>{91DD5A2D-9FE3-4C3C-9253-876141874DAD}</Project>
- <Name>Mono.Addins</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
diff --git a/Test/FileContentExtension/FileContentExtension.csproj b/Test/FileContentExtension/FileContentExtension.csproj
index e3a563d..df1cd8a 100644
--- a/Test/FileContentExtension/FileContentExtension.csproj
+++ b/Test/FileContentExtension/FileContentExtension.csproj
@@ -28,13 +28,9 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\UnitTests\UnitTests.csproj">
- <Project>{1CD51E61-1985-4D22-9BFA-D14C8FC61B46}</Project>
- <Name>UnitTests</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\Mono.Addins\Mono.Addins.csproj">
- <Project>{91DD5A2D-9FE3-4C3C-9253-876141874DAD}</Project>
- <Name>Mono.Addins</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
diff --git a/Test/FileExtender/FileExtender.csproj b/Test/FileExtender/FileExtender.csproj
index 66ae389..deb24cc 100644
--- a/Test/FileExtender/FileExtender.csproj
+++ b/Test/FileExtender/FileExtender.csproj
@@ -36,16 +36,10 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FileContentExtension\FileContentExtension.csproj">
- <Project>{4F29F0C0-725A-4927-9931-AAB0A595F370}</Project>
- <Name>FileContentExtension</Name>
</ProjectReference>
<ProjectReference Include="..\..\Mono.Addins\Mono.Addins.csproj">
- <Project>{91DD5A2D-9FE3-4C3C-9253-876141874DAD}</Project>
- <Name>Mono.Addins</Name>
</ProjectReference>
<ProjectReference Include="..\UnitTests\UnitTests.csproj">
- <Project>{1CD51E61-1985-4D22-9BFA-D14C8FC61B46}</Project>
- <Name>UnitTests</Name>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
diff --git a/Test/HelloWorldExtension/HelloWorldExtension.csproj b/Test/HelloWorldExtension/HelloWorldExtension.csproj
index ca744c8..ea90df7 100644
--- a/Test/HelloWorldExtension/HelloWorldExtension.csproj
+++ b/Test/HelloWorldExtension/HelloWorldExtension.csproj
@@ -27,18 +27,12 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CommandExtension\CommandExtension.csproj">
- <Project>{f109148d-849e-4044-8700-5e8ea0ab2476}</Project>
- <Name>CommandExtension</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\UnitTests\UnitTests.csproj">
- <Project>{1CD51E61-1985-4D22-9BFA-D14C8FC61B46}</Project>
- <Name>UnitTests</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\Mono.Addins\Mono.Addins.csproj">
- <Project>{91DD5A2D-9FE3-4C3C-9253-876141874DAD}</Project>
- <Name>Mono.Addins</Name>
</ProjectReference>
</ItemGroup>
</Project> \ No newline at end of file
diff --git a/Test/MultiAssemblyAddin/MultiAssemblyAddin.csproj b/Test/MultiAssemblyAddin/MultiAssemblyAddin.csproj
index 9e9fee7..7e6e55d 100644
--- a/Test/MultiAssemblyAddin/MultiAssemblyAddin.csproj
+++ b/Test/MultiAssemblyAddin/MultiAssemblyAddin.csproj
@@ -43,18 +43,12 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Mono.Addins\Mono.Addins.csproj">
- <Project>{91DD5A2D-9FE3-4C3C-9253-876141874DAD}</Project>
- <Name>Mono.Addins</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\UnitTests\UnitTests.csproj">
- <Project>{1CD51E61-1985-4D22-9BFA-D14C8FC61B46}</Project>
- <Name>UnitTests</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="SecondAssembly\SecondAssembly.csproj">
- <Project>{EB38A832-1BA5-4073-910C-7ACC5F1D1AD4}</Project>
- <Name>SecondAssembly</Name>
</ProjectReference>
</ItemGroup>
</Project> \ No newline at end of file
diff --git a/Test/MultiAssemblyAddin/OptionalModule/OptionalModule.csproj b/Test/MultiAssemblyAddin/OptionalModule/OptionalModule.csproj
index 5b3fb0b..7a043e2 100644
--- a/Test/MultiAssemblyAddin/OptionalModule/OptionalModule.csproj
+++ b/Test/MultiAssemblyAddin/OptionalModule/OptionalModule.csproj
@@ -37,13 +37,9 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Mono.Addins\Mono.Addins.csproj">
- <Project>{91DD5A2D-9FE3-4C3C-9253-876141874DAD}</Project>
- <Name>Mono.Addins</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\UnitTests\UnitTests.csproj">
- <Project>{1CD51E61-1985-4D22-9BFA-D14C8FC61B46}</Project>
- <Name>UnitTests</Name>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
diff --git a/Test/MultiAssemblyAddin/SecondAssembly/SecondAssembly.csproj b/Test/MultiAssemblyAddin/SecondAssembly/SecondAssembly.csproj
index bd56ae4..331250b 100644
--- a/Test/MultiAssemblyAddin/SecondAssembly/SecondAssembly.csproj
+++ b/Test/MultiAssemblyAddin/SecondAssembly/SecondAssembly.csproj
@@ -37,13 +37,9 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Mono.Addins\Mono.Addins.csproj">
- <Project>{91DD5A2D-9FE3-4C3C-9253-876141874DAD}</Project>
- <Name>Mono.Addins</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\UnitTests\UnitTests.csproj">
- <Project>{1CD51E61-1985-4D22-9BFA-D14C8FC61B46}</Project>
- <Name>UnitTests</Name>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
diff --git a/Test/SystemInfoExtension/SystemInfoExtension.csproj b/Test/SystemInfoExtension/SystemInfoExtension.csproj
index 186544d..2e9a186 100644
--- a/Test/SystemInfoExtension/SystemInfoExtension.csproj
+++ b/Test/SystemInfoExtension/SystemInfoExtension.csproj
@@ -28,17 +28,11 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\UnitTests\UnitTests.csproj">
- <Project>{1CD51E61-1985-4D22-9BFA-D14C8FC61B46}</Project>
- <Name>UnitTests</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\Mono.Addins\Mono.Addins.csproj">
- <Project>{91DD5A2D-9FE3-4C3C-9253-876141874DAD}</Project>
- <Name>Mono.Addins</Name>
</ProjectReference>
<ProjectReference Include="..\CommandExtension\CommandExtension.csproj">
- <Project>{F109148D-849E-4044-8700-5E8EA0AB2476}</Project>
- <Name>CommandExtension</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>