测试线程静态前提交

This commit is contained in:
minjQiu
2024-08-07 18:44:46 +08:00
parent b13ae6ec88
commit 4e4316c6dc
33 changed files with 1596 additions and 380 deletions
+13 -14
View File
@@ -1,5 +1,4 @@
using Autofac;
using Autofac.Integration.WebApi;
using Microsoft.JScript;
using Microsoft.Win32;
using System;
@@ -24,7 +23,7 @@ namespace UFIDA.U8.Framework.Api
public WebApiApplication()
{
s_u8Root = __GetU8InstallPath();
s_u8Root = GetU8InstallPath();
s_u8MPath = $@"{s_u8Root}U8M\";
s_u8FrameworkPath = $@"{s_u8Root}Framework\";
s_u8APIFramework = $@"{s_u8Root}UFMOM\U8APIFramework\";
@@ -40,23 +39,23 @@ namespace UFIDA.U8.Framework.Api
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
AppDomain.CurrentDomain.AssemblyResolve -= __CurrentDomain_AssemblyResolve;
AppDomain.CurrentDomain.AssemblyResolve += __CurrentDomain_AssemblyResolve;
AppDomain.CurrentDomain.AssemblyResolve -= CurrentDomain_AssemblyResolve;
AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
}
private void ConfigureDependencyInjection(HttpConfiguration config)
{
var builder = new ContainerBuilder();
//builder.RegisterType<GMUtil>().As<>();
//private void ConfigureDependencyInjection(HttpConfiguration config)
//{
// var builder = new ContainerBuilder();
// //builder.RegisterType<GMUtil>().As<>();
var container = builder.Build();
// var container = builder.Build();
config.DependencyResolver = new AutofacWebApiDependencyResolver(container);
}
// config.DependencyResolver = new AutofacWebApiDependencyResolver(container);
//}
private static string __GetU8InstallPath()
private static string GetU8InstallPath()
{
string root;
var installPath = Registry.LocalMachine.OpenSubKey(GlobalConstDefine.Product_Registry_InstallKey);
@@ -70,7 +69,7 @@ namespace UFIDA.U8.Framework.Api
/// <param name="sender"></param>
/// <param name="args"></param>
/// <returns></returns>
private Assembly __CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
private Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
{
//先在已经加载的程序集中选择
foreach (var asm in AppDomain.CurrentDomain.GetAssemblies())