小编Sve*_*ven的帖子

如何在 STA 线程中运行 NUnit 测试?

我们正在将 WPF 应用程序移植到 .NET Core 3,预览版 5。一些 NUnit 测试需要在 STA 线程中运行。如何才能做到这一点?

[STAThread]、[RequiresSTA] 等属性都不起作用。这也不起作用:[程序集:RequiresThread(ApartmentState.STA)]

Appparent 命名空间似乎没有在 .NET Core 3 中公开。

有没有人做过这个?

c# nunit sta .net-core

5
推荐指数
1
解决办法
1268
查看次数

用于绑定重定向的框架配置在哪里?

我的ASP.NET MVC网络后端消耗System.Security.Cryptography.Algorithms.dll. 在构建时,该 dll 位于:

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.1\Facades

在运行时,dll 被解析为:

C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Security.Cryptography.Algorithms\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Security.Cryptography.Algorithms.dll

fuslogvw显示的是:

...
LOG: Assembly download was successful. Attempting setup of file: path\to\bin\System.Security.Cryptography.Algorithms.dll
LOG: Entering download cache setup phase.
LOG: Assembly Name is: System.Security.Cryptography.Algorithms, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
LOG: A partially-specified assembly bind succeeded from the application directory. Need to re-apply policy.
LOG: Using application configuration file: path\to\web.config
LOG: Using host configuration file: C:\Users\xxx\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: …
Run Code Online (Sandbox Code Playgroud)

.net dll assembly-binding-redirect .net-standard

4
推荐指数
1
解决办法
573
查看次数