AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / computer / 问题

问题[.net-framework](computer)

Martin Hope
KyleMit
Asked: 2024-10-31 23:06:32 +0800 CST

有没有办法在.net fiddle 上运行单元测试?

  • 5

我很想使用 dotnet fiddle(https://dotnetfiddle.net/)通过单元测试演示一些行为

Fiddle 通常构建为控制台应用程序,通过 Program.Main 调用

但测试通常在类库中运行,调用方式如下dotnet test

有没有什么办法可以让测试顺利进行?

示例小提琴 (测试不起作用)

示例测试

public class CalculatorTests
{
    [Fact]
    public void Add_WhenCalledWithTwoIntegers_ReturnsTheirSum()
    {
        // Arrange
        var calculator = new Calculator();
        
        // Act
        var result = calculator.Add(2, 3);

        // Assert
        Assert.Equal(5, result);
    }

    private class Calculator
    {
        public int Add(int a, int b)
        {
            return a + b;
        }
    }
}

注意:这个问题的代码部分可能也与 StackOverflow 相关,但我特别想在 dotnetfiddle 的上下文中实现它。代码在本地运行良好

.net-framework
  • 1 个回答
  • 56 Views
Martin Hope
Johan Ahlqvist
Asked: 2024-05-15 14:27:08 +0800 CST

如何使用 API 通过 JetBrains dotTrace 2024.1 开始逐行分析?

  • 6

我正在尝试分析 .NET 应用程序中类的性能。我有 JetBrains dotTrace 2024.1,它可以分析:采样、时间轴、跟踪和逐行。

我想使用 API 在应用程序内以编程方式开始和结束逐行分析。

但是,文档没有说明如何逐行配置分析。有谁知道如何做到这一点?

https://www.jetbrains.com/help/profiler/2024.1/Profiling_Guidelines__Advanced_Profiling_Using_dotTrace_API.html#self-profiled-applications

.net-framework
  • 1 个回答
  • 33 Views
Martin Hope
Andrew Stephens
Asked: 2022-09-21 02:29:09 +0800 CST

.Net 6 运行时和 Windows 更新

  • 5

我使用 Visual Studio 2022 和 .Net SDK 6.0.6 编写了一个 WPF 桌面应用程序。我不想创建“自包含”应用程序,因此有必要在客户 PC 上安装 .Net Desktop Runtime。我是否说可以安装任何版本> = 6.0.6,并且不必特别是6.0.6?

此外,.Net6 运行时似乎每个月都会更新。Windows 更新是否包括对 .Net6 的更新,特别是考虑到现在有多种运行时类型:“SDK”、“ASP.Net Core 运行时”、“.Net 桌面运行时”、“.Net 运行时”(参见此处)?

所有PC都是Win10,没有计划开始使用Win11。

.net-framework windows-update
  • 2 个回答
  • 60 Views
Martin Hope
paulgutten
Asked: 2021-11-07 02:15:33 +0800 CST

windows update 不再更新.net framework 4.8

  • 5

到目前为止,我一直依赖于windows update为.net framework 4.8.
但这不再发生在我的带有“windows 10 pro”(在工作组模式下运行)的机器上。

这是该机器的 Windows 更新历史记录的简化列表:

 - 2020-xx-xx windows 10
 - 2020-08-14 .net update 2020-08 KB4569745
 - 2020-08-14 windows 10 upgrade to 2004
 - 2020-10-20 .net update 2020-10 KB4578968
 - 2021-01-19 windows 10 upgrade to 20H2
 - 2021-02-23 .net update 2021-02 KB4601050 (<------)
 - 2021-09-21 windows 10 upgrade to 21H1
 - 2021-10-27 windows 10 21H1 cumulative update KB5006670
 - 2021-11-03 update for windows 10 21H1 KB5005463

在撰写本文时是2021 年11月。最后
一次 .net 框架更新(KB4601050

最近有 .net 框架更新。例如累积更新KB5005539(2021 年 10 月)。
但 Windows 更新只是没有找到和安装这些。

这些自动更新不再起作用的原因是什么?

--

注释注释:
我不是在谈论 NDP 下面的注册表项(对我来说显示为“4.8.04084”)。
相反,我说的是更新各个 .net 框架程序集的“累积更新”。例如:转到“%windir%\Microsoft.NET\Framework64\v4.0.30319”并检查“System.Windows.Forms.dll”的文件版本属性,
在顶层我只是在查看“Windows 更新”历史”。

--

更新:

我发现的最接近的匹配是在讨论中:https ://www.askwoody.com/forums/topic/net-update-confusion/

讨论摘要:
在撰写本文时,KB4601056 / KB4601050(2021 年 2 月)是最后一个被微软归类为 .netsecurity更新的版本。
所有以后的累积更新都归类为 .netquality and reliability improvement更新。

根据您配置“Windows 更新”服务的方式,Windows 更新不会显示/下载后一个类别。

--

所以挑战可能是选择正确的配置:

  • 我不想要任何“预览”更新
  • 但我确实想要质量和可靠性的更新(发布后延迟 7 天)

不幸的是,“gpedit.msc -> Windows Update for Business”中的以下设置仍然无法显示 .net 框架更新:
在此处输入图像描述

所以也许毕竟它仍然是 .NET Framework 更新的取代链中的一些小故障或错误?

.net-framework windows-update
  • 1 个回答
  • 741 Views
Martin Hope
dolor3sh4ze
Asked: 2020-12-31 14:52:18 +0800 CST

MsBuild shell 反复打开

  • 5

几周以来,我遇到了一个相当烦人的问题:我有一个 MSBuild shell 窗口,它会定期打开(大约每 3 分钟一次)并立即关闭。没有办法让它消失。我试图卸载 MSBuild 但它是不可能的,重新安装 .NET Framework 但我仍然有同样的事情。

这是显示的窗口(几毫秒): 窗户

windows .net-framework
  • 1 个回答
  • 64 Views
Martin Hope
Lluser
Asked: 2020-10-06 04:44:18 +0800 CST

Windows 10 - 程序不适用于当前的 .NET 框架版本

  • 5

我的程序 ( AutoCAD 2012) 在实际的 .NET Framework 版本 (4.7x) 中无法正常工作(一段时间后它一直在崩溃)。(最低要求的版本是.NET Framework 4.0)

对于旧版本(据我所知,截至 2010 年),有一个技巧可以定义必须acad.exe.config在程序根目录中的文件中使用哪个版本的 .NET Framework。但是这些旧版本是创建的.NET Framework 3.5,可以安装在旁边1.x,4.x因为向后兼容。

我不知道.NET Framework 4.x在我的系统中有两个不同版本的可能性。

我想到的唯一解决方案是模拟 Windows 的第二个 Windows 实例,仅针对该程序及时冻结(但这可能会导致显着的性能损失和文件访问问题)。

有没有办法.NET Framework只为这个程序提供旧版本的服务?

感谢您的建议。

PS:我使用的是 Windows 10 专业版。

windows-10 .net-framework
  • 1 个回答
  • 675 Views
Martin Hope
Firestar464
Asked: 2020-08-08 01:02:35 +0800 CST

程序安装程序需要 .NET 框架 3.5,但我有 4.8

  • 5

我尝试安装 PEBrowse Professional,但出现以下错误消息。

呃

我尝试在线安装 .NET 框架,但安装程序说我已经有了 .NET 4.8。我该如何解决这个问题?谢谢您的帮助!

windows-10 .net-framework
  • 1 个回答
  • 1441 Views
Martin Hope
ozsh83
Asked: 2020-06-28 22:18:23 +0800 CST

如何删除 .NET 并在 Windows 10 上安装早期版本

  • 7

我在注册表中遇到了 .net 4.8.03761 (528049)

我需要为我的特定项目安装 .net 4.7.2 但我不能,因为我无法删除 .net 4.8。

有什么提示吗?

windows-10 .net-framework
  • 2 个回答
  • 6581 Views
Martin Hope
params
Asked: 2020-06-27 11:58:26 +0800 CST

项目未在 Visual Studio 2019 中加载:工具版本和 SDK 参考问题

  • 6

我最近从 Visual Studio 2017 切换到 2019。但是,我无法加载任何项目。当我加载解决方案时,该解决方案中的每个项目在解决方案资源管理器中显示为“已卸载”。右键单击并选择“重新加载”会产生以下错误之一:

C:\<path>\<file>.csproj : error : The tools version "15.0" is unrecognized. Available tools versions are "2.0", "3.5", "4.0". C:\<path>\<file>.csproj

对于指定工具版本的项目,或

C:\<path>\<file>.csproj : error : The project file cannot be opened by the project system, because it is missing some critical imports or the referenced SDK cannot be found.

对于指定 SDK 的项目。

一些相关问题建议修改 global.json 文件、卸载/重新安装 MSBuild、将 PATH 设置为指向 Program Files/dotnet 文件夹或安装最新的 SDK。我安装了最新版本的 .NET 核心 SDK 以及许多其他 SDK,并且我的 PATH 环境变量指向 Program Files/dotnet。我没有安装邪恶的 MSBuild 15,添加 global.json 文件并没有解决任何项目。

这些都是在 VS 2019 和 VS 2017 的其他副本中加载的所有项目。我不知道该怎么做。感谢所有帮助。

visual-studio .net-framework
  • 1 个回答
  • 677 Views
Martin Hope
aaa
Asked: 2020-03-12 04:02:44 +0800 CST

用 Wine 安装 MSI

  • 8

当我尝试安装 MSI 时,无论是 MSIstart还是msiexec什么都没有,它告诉我there is no Windows program configured to open this type of file

它也告诉我MS.NET F4.5 needs to be installed,但我已经wine-mono安装了

继承人一些日志:

0009:fixme:ntdll:NtLockFile I/O completion on lock not implemented yet
0009:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION
0009:err:mscoree:LoadLibraryShim error reading registry key for installroot
0009:err:msi:ITERATE_Actions Execution halted, action L"LaunchConditions" returned 1603
0009:err:ole:CoGetClassObject class {cacaf262-9370-4615-a13b-9f5539da4c0a} not registered
0009:err:ole:CoGetClassObject no class object {cacaf262-9370-4615-a13b-9f5539da4c0a} could be created for context 0x1
0009:err:olepicture:OleLoadPicture IPersistStream_Load failed
0009:err:msi:msi_load_picture failed to load picture
0009:err:msi:msi_dialog_bitmap_control Failed to load bitmap L"NewBinary5"
.net-framework windows-installer
  • 2 个回答
  • 14341 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何减少“vmmem”进程的消耗?

    • 11 个回答
  • Marko Smith

    从 Microsoft Stream 下载视频

    • 4 个回答
  • Marko Smith

    Google Chrome DevTools 无法解析 SourceMap:chrome-extension

    • 6 个回答
  • Marko Smith

    Windows 照片查看器因为内存不足而无法运行?

    • 5 个回答
  • Marko Smith

    支持结束后如何激活 WindowsXP?

    • 6 个回答
  • Marko Smith

    远程桌面间歇性冻结

    • 7 个回答
  • Marko Smith

    子网掩码 /32 是什么意思?

    • 6 个回答
  • Marko Smith

    鼠标指针在 Windows 中按下的箭头键上移动?

    • 1 个回答
  • Marko Smith

    VirtualBox 无法以 VERR_NEM_VM_CREATE_FAILED 启动

    • 8 个回答
  • Marko Smith

    应用程序不会出现在 MacBook 的摄像头和麦克风隐私设置中

    • 5 个回答
  • Martin Hope
    Vickel Firefox 不再允许粘贴到 WhatsApp 网页中? 2023-08-18 05:04:35 +0800 CST
  • Martin Hope
    Saaru Lindestøkke 为什么使用 Python 的 tar 库时 tar.xz 文件比 macOS tar 小 15 倍? 2021-03-14 09:37:48 +0800 CST
  • Martin Hope
    CiaranWelsh 如何减少“vmmem”进程的消耗? 2020-06-10 02:06:58 +0800 CST
  • Martin Hope
    Jim Windows 10 搜索未加载,显示空白窗口 2020-02-06 03:28:26 +0800 CST
  • Martin Hope
    andre_ss6 远程桌面间歇性冻结 2019-09-11 12:56:40 +0800 CST
  • Martin Hope
    Riley Carney 为什么在 URL 后面加一个点会删除登录信息? 2019-08-06 10:59:24 +0800 CST
  • Martin Hope
    zdimension 鼠标指针在 Windows 中按下的箭头键上移动? 2019-08-04 06:39:57 +0800 CST
  • Martin Hope
    jonsca 我所有的 Firefox 附加组件突然被禁用了,我该如何重新启用它们? 2019-05-04 17:58:52 +0800 CST
  • Martin Hope
    MCK 是否可以使用文本创建二维码? 2019-04-02 06:32:14 +0800 CST
  • Martin Hope
    SoniEx2 更改 git init 默认分支名称 2019-04-01 06:16:56 +0800 CST

热门标签

windows-10 linux windows microsoft-excel networking ubuntu worksheet-function bash command-line hard-drive

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve