فهرست منبع

upgrade the frame work version of the OTSExtremum.csproj

gsp 2 سال پیش
والد
کامیت
14a3ce4bf9
3فایلهای تغییر یافته به همراه19 افزوده شده و 9 حذف شده
  1. 7 7
      OTSExtremum/App.config
  2. 2 2
      OTSExtremum/OTSExtremum.csproj
  3. 10 0
      OTSExtremum/Program.cs

+ 7 - 7
OTSExtremum/App.config

@@ -2,22 +2,22 @@
 <configuration>
     <startup> 
         
-    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/></startup>
+    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup>
   <runtime>
     <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
       <publisherPolicy apply="yes"/>
       <probing privatePath="System;Common;SQLiteDll;Oxford;Bruker;FEIAutoScript;OpenCv;OpenCvSharp"/>
       <dependentAssembly>
-        <assemblyIdentity name="SQLitePCLRaw.core" publicKeyToken="1488e028ca7ab535" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-2.0.7.1395" newVersion="2.0.7.1395" />
+        <assemblyIdentity name="SQLitePCLRaw.core" publicKeyToken="1488e028ca7ab535" culture="neutral"/>
+        <bindingRedirect oldVersion="0.0.0.0-2.0.7.1395" newVersion="2.0.7.1395"/>
       </dependentAssembly>
       <dependentAssembly>
-        <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
+        <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
+        <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0"/>
       </dependentAssembly>
       <dependentAssembly>
-        <assemblyIdentity name="SQLitePCLRaw.provider.e_sqlite3" publicKeyToken="9c301db686d0bd12" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-2.0.7.1395" newVersion="2.0.7.1395" />
+        <assemblyIdentity name="SQLitePCLRaw.provider.e_sqlite3" publicKeyToken="9c301db686d0bd12" culture="neutral"/>
+        <bindingRedirect oldVersion="0.0.0.0-2.0.7.1395" newVersion="2.0.7.1395"/>
       </dependentAssembly>
     </assemblyBinding>
   </runtime>

+ 2 - 2
OTSExtremum/OTSExtremum.csproj

@@ -8,7 +8,7 @@
     <OutputType>WinExe</OutputType>
     <RootNamespace>OTSExtremum</RootNamespace>
     <AssemblyName>OTSExtremum</AssemblyName>
-    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
+    <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
     <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
     <Deterministic>true</Deterministic>
@@ -61,7 +61,7 @@
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
     <DebugSymbols>true</DebugSymbols>
-    <OutputPath>bin\x64\Debug\</OutputPath>
+    <OutputPath>..\bin\x64\Debug\</OutputPath>
     <DefineConstants>DEBUG;TRACE</DefineConstants>
     <DebugType>full</DebugType>
     <PlatformTarget>x64</PlatformTarget>

+ 10 - 0
OTSExtremum/Program.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Reflection;
 using System.Threading.Tasks;
 using System.Windows.Forms;
 
@@ -11,6 +12,15 @@ namespace OTSExtremum
         /// <summary>
         /// 应用程序的主入口点。
         /// </summary>
+        static Program()
+        {
+            string privatepath = "System;Common;DevExpress;FEIAutoScript;SQLiteDll;OxfordExtender;OTSCPPDll;OpenCvSharp;CefSharp";
+            AppDomain.CurrentDomain.SetData("PRIVATE_BINPATH", privatepath);
+            AppDomain.CurrentDomain.SetData("BINPATH_PROBE_ONLY", privatepath);
+            var m = typeof(AppDomainSetup).GetMethod("UpdateContextProperty", BindingFlags.NonPublic | BindingFlags.Static);
+            var funsion = typeof(AppDomain).GetMethod("GetFusionContext", BindingFlags.NonPublic | BindingFlags.Instance);
+            m.Invoke(null, new object[] { funsion.Invoke(AppDomain.CurrentDomain, null), "PRIVATE_BINPATH", privatepath });
+        }
         [STAThread]
         static void Main()
         {