zoule 6 сар өмнө
parent
commit
d6cf478bf3

BIN
Microsoft.Owin.Security.dll


BIN
System.Net.Http.dll


BIN
System.Web.Cors.dll


+ 0 - 12
XdCxRhDW.App/App.config

@@ -32,16 +32,4 @@
 	<startup>
 		<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
 	</startup>
-	<runtime>
-		<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
-			<dependentAssembly>
-				<assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" />
-				<bindingRedirect oldVersion="0.0.0.0-4.2.2.0" newVersion="4.2.2.0" />
-			</dependentAssembly>
-			<dependentAssembly>
-				<assemblyIdentity name="System.Web.Cors" publicKeyToken="31bf3856ad364e35" culture="neutral" />
-				<bindingRedirect oldVersion="0.0.0.0-5.3.0.0" newVersion="5.3.0.0" />
-			</dependentAssembly>
-		</assemblyBinding>
-	</runtime>
 </configuration>

+ 0 - 1
XdCxRhDW.App/Controllers/TaskController.cs

@@ -15,7 +15,6 @@ using XdCxRhDW.Entity;
 using XdCxRhDW.Repostory;
 using XdCxRhDW.WebApi;
 using System.Threading;
-using Microsoft.Owin;
 using System.Diagnostics;
 
 namespace XdCxRhDW.App.Controllers

+ 3 - 1
XdCxRhDW.App/MainForm.cs

@@ -512,7 +512,9 @@ namespace XdCxRhDW
             {
                 KillProcess();
                 Process pro = new Process();
-                var servicesDir = Directory.GetDirectories(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Service\\"), "*", SearchOption.TopDirectoryOnly);
+                string serviceDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Service\\");
+                Directory.CreateDirectory(serviceDir);
+                var servicesDir = Directory.GetDirectories(serviceDir, "*", SearchOption.TopDirectoryOnly);
                 foreach (var item in servicesDir)
                 {
                     try

+ 0 - 21
XdCxRhDW.App/XdCxRhDW.App.csproj

@@ -93,22 +93,13 @@
     <Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
       <HintPath>..\packages\EntityFramework.6.5.1\lib\net45\EntityFramework.SqlServer.dll</HintPath>
     </Reference>
-    <Reference Include="Microsoft.Owin, Version=4.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-      <HintPath>..\packages\Microsoft.Owin.4.2.2\lib\net45\Microsoft.Owin.dll</HintPath>
-    </Reference>
     <Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
       <HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
     </Reference>
-    <Reference Include="Owin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f0ebd12fd5e55cc5, processorArchitecture=MSIL">
-      <HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
-    </Reference>
     <Reference Include="PresentationCore" />
     <Reference Include="PresentationFramework" />
     <Reference Include="System" />
-    <Reference Include="System.Buffers, Version=4.0.4.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
-      <HintPath>..\packages\System.Buffers.4.6.0\lib\net462\System.Buffers.dll</HintPath>
-    </Reference>
     <Reference Include="System.ComponentModel" />
     <Reference Include="System.ComponentModel.DataAnnotations" />
     <Reference Include="System.Configuration" />
@@ -118,16 +109,10 @@
       <HintPath>..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.118.0\lib\net46\System.Data.SQLite.dll</HintPath>
     </Reference>
     <Reference Include="System.Deployment" />
-    <Reference Include="System.Diagnostics.DiagnosticSource, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
-      <HintPath>..\packages\System.Diagnostics.DiagnosticSource.9.0.0\lib\net462\System.Diagnostics.DiagnosticSource.dll</HintPath>
-    </Reference>
     <Reference Include="System.Management" />
     <Reference Include="Microsoft.CSharp" />
     <Reference Include="System.Data" />
     <Reference Include="System.Drawing" />
-    <Reference Include="System.Memory, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
-      <HintPath>..\packages\System.Memory.4.6.0\lib\net462\System.Memory.dll</HintPath>
-    </Reference>
     <Reference Include="System.Net.Http">
       <Private>True</Private>
     </Reference>
@@ -136,12 +121,6 @@
       <HintPath>..\System.Net.Http.Formatting.dll</HintPath>
     </Reference>
     <Reference Include="System.Numerics" />
-    <Reference Include="System.Numerics.Vectors, Version=4.1.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\packages\System.Numerics.Vectors.4.6.0\lib\net462\System.Numerics.Vectors.dll</HintPath>
-    </Reference>
-    <Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.1.0\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
-    </Reference>
     <Reference Include="System.Runtime.Remoting" />
     <Reference Include="System.Runtime.Serialization" />
     <Reference Include="System.Runtime.Serialization.Formatters.Soap" />

+ 0 - 7
XdCxRhDW.App/packages.config

@@ -1,16 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>
 <packages>
   <package id="EntityFramework" version="6.5.1" targetFramework="net472" />
-  <package id="Microsoft.Owin" version="4.2.2" targetFramework="net472" />
-  <package id="Owin" version="1.0" targetFramework="net472" />
   <package id="Stub.System.Data.SQLite.Core.NetFramework" version="1.0.118.0" targetFramework="net472" />
-  <package id="System.Buffers" version="4.6.0" targetFramework="net472" />
   <package id="System.Data.SQLite" version="1.0.118.0" targetFramework="net472" />
   <package id="System.Data.SQLite.Core" version="1.0.118.0" targetFramework="net472" />
   <package id="System.Data.SQLite.EF6" version="1.0.118.0" targetFramework="net472" />
   <package id="System.Data.SQLite.Linq" version="1.0.118.0" targetFramework="net472" />
-  <package id="System.Diagnostics.DiagnosticSource" version="9.0.0" targetFramework="net472" />
-  <package id="System.Memory" version="4.6.0" targetFramework="net472" />
-  <package id="System.Numerics.Vectors" version="4.6.0" targetFramework="net472" />
-  <package id="System.Runtime.CompilerServices.Unsafe" version="6.1.0" targetFramework="net472" />
 </packages>

+ 28 - 1
XdCxRhDW.WebApi/Startup.cs

@@ -65,8 +65,32 @@ namespace XdCxRhDW.WebApi
         /// <param name="timeZoneUtc">时区</param>
         public static void Start(int port, string controllerXmlName, string dtoXmlName, string timeZoneUtc = "UTC+08:00")
         {
-            //不要删除这句代码,VS引用优化检测到没有使用Microsoft.Owin.Host.HttpListener.dll则可能不会将此dll复制到本地导致http服务启动失败
+            AppDomain.CurrentDomain.AssemblyResolve += (sender, args) =>
+            {
+                string path1 = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "AddIns");
+                string path2 = AppDomain.CurrentDomain.BaseDirectory;
+                string dll1 = Path.Combine(path1, args.Name.Split(',')[0] + ".dll");
+                string dll2 = Path.Combine(path2, args.Name.Split(',')[0] + ".dll");
+                if (dll1.StartsWith("Microsoft.Owin.Security"))
+                { 
+                }
+                if (File.Exists(dll1))
+                {
+                    return Assembly.LoadFrom(dll1);
+                }
+                if(File.Exists(dll2))
+                {
+                    return Assembly.LoadFrom(dll2);
+                }
+                return null;
+            };
+            //不要删除Console.WriteLine代码,VS引用优化检测到没有使用dll不会将其复制到本地导致http服务启动失败
             Console.WriteLine(typeof(Microsoft.Owin.Host.HttpListener.OwinHttpListener));
+            Console.WriteLine(typeof(System.Web.Cors.CorsConstants));
+            Console.WriteLine(typeof(Microsoft.Owin.Security.AuthenticateResult));
+            Console.WriteLine(typeof(System.Diagnostics.Activity));
+            Console.WriteLine(typeof(Microsoft.Owin.Security.AuthenticationTicket));
+
             _timeZoneUtc = timeZoneUtc;
             _controllerXmlName = controllerXmlName;
             _dtoXmlName = dtoXmlName;
@@ -103,6 +127,9 @@ namespace XdCxRhDW.WebApi
             svrs.Add(svr);
             GC.Collect();
         }
+
+
+
         /// <summary>
         /// 
         /// </summary>