Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/301.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Visual Studio-.NET Framework 4.6.1问题,适用于使用Windows 8.1或更高版本的用户_C#_.net_Vb.net_Visual Studio_Visual Studio 2015 - Fatal编程技术网

C# Visual Studio-.NET Framework 4.6.1问题,适用于使用Windows 8.1或更高版本的用户

C# Visual Studio-.NET Framework 4.6.1问题,适用于使用Windows 8.1或更高版本的用户,c#,.net,vb.net,visual-studio,visual-studio-2015,C#,.net,Vb.net,Visual Studio,Visual Studio 2015,tl;dr-它只在Windows 10之前的版本上打开、不显示/执行任何内容,并关闭任何内容,因为它在Windows 10上运行得非常好。 自己测试一下: 在Windows 10上工作: 不处理比Windows 10旧的任何内容: (这显示了我是否使启动表单不是4.6.1中新的包含方法/函数的表单,然后使用{MainForm}.Show()调用包含新方法/函数的表单) (也是Windows 8.1:) 我有一个用VB.NET制作的程序,它使用了.NET Framework 4.6.1,因为我认

tl;dr-它只在Windows 10之前的版本上打开、不显示/执行任何内容,并关闭任何内容,因为它在Windows 10上运行得非常好。

自己测试一下:

在Windows 10上工作:

不处理比Windows 10旧的任何内容:

(这显示了我是否使启动表单不是4.6.1中新的包含方法/函数的表单,然后使用{MainForm}.Show()调用包含新方法/函数的表单) (也是Windows 8.1:)

我有一个用VB.NET制作的程序,它使用了.NET Framework 4.6.1,因为我认为它的问题最少,但我错了,如果Windows 7/8/8.1上的任何人试图运行我的应用程序,由于它只在.NET Framework 4.6.1上使用了一些函数,因此不会加载任何内容

我可以确认这是因为使用了.NET Framework 4.6.1,就好像我在.NET Framework 4.6.1中加载了一个表单,但在.NET Framework 4.6.1中没有新的函数,那么它可以正常加载,但是如果我加载了一个表单,像.tounixtimeinmillizes()这样的函数,那么它会加载、显示并执行任何内容,然后关闭。我知道它至少加载了一些东西,因为当我打开它的时候,你可以看到窗口焦点消失了,比如说Windows资源管理器到刚刚打开的应用程序,但是没有任何执行或显示它最终关闭(我假设),因为我在任务管理器中找不到任何相关的进程

这应该不是问题,Windows 7/8/8.1可以安装.NET Framework 4.6.1,那么为什么不在Windows 7/8/8.1上加载呢


有没有人意识到这个问题,因为我在谷歌上搜索了很长时间,却没有发现任何与此相关的信息。我是否遗漏了一些明显的内容?

您引用的ActiveX组件未安装
0x80040154(REGDB\u E\u CLASSNOTREG)

异常对象:02499020 异常类型:System.Runtime.InteropServices.COMException 消息:Klasse nicht registriert(来自HRESULT:0x80040154(REGDB_E_CLASSNOTREG)的异常) 内部异常: StackTrace(已生成): SP IP功能 00000000000001系统\u窗口\u表单\u ni!System.Windows.Forms.UnsafentiveMethods.CoCreateInstance(System.Guid ByRef,System.Object,Int32,System.Guid ByRef)+0x2 0037E2A0 6B2B0992系统窗口表单!System.Windows.Forms.AxHost.CreateWithLicense(System.String,System.Guid)+0xc2 0037E2EC 6B2B0A86系统Windows窗体!System.Windows.Forms.AxHost.CreateInstanceCore(System.Guid)+0x2e 0037E320 6B2B0A45系统\u Windows\u表单\u ni!System.Windows.Forms.AxHost.CreateInstance()+0x99 0037E348 6B2B1D63系统\u Windows\u表单\u ni!System.Windows.Forms.AxHost.GetOcxCreate()+0x17 0037E354 6B2 EE74系统\u窗口\u表单\u ni!System.Windows.Forms.AxHost.TransitionUpTo(Int32)+0xc0 0037E3A0 6B2AE08A系统\u窗口\u表单\u ni!System.Windows.Forms.AxHost.CreateHandle()+0x2a 0037E3C0 6ACDD215系统\u Windows\u表单\u ni!System.Windows.Forms.Control.CreateControl(布尔)+0x75 0037E3FC 6ACDD2E8系统\u窗口\u表单\u ni!System.Windows.Forms.Control.CreateControl(布尔)+0x148 0037E438 6B2AC785系统Windows窗体!System.Windows.Forms.AxHost.EndInit()+0x2d 0037E444 001E50D2 PRAGMA!PRAGMA.PRAGMA.InitializeComponent()+0x3a62 0037EC70 001E0F58 PRAGMA!PRAGMA.PRAGMA..ctor()+0x1b0
您的信息中不清楚您的应用程序用户是否确实安装了.NET 4.6.1?是的,Windows 7和Windows 8可以安装.NET 4.6.1,但这并不意味着它已经自动安装。@Dmitry我在TeamViewer上有另一个用户,我们都可以确认.NET Framework 4.6.1是在我尝试运行Web安装程序时安装的,它说:“此系统上已经安装了.NET Framework 4.6.1或更新版本。”我还有另外两个测试我的项目的用户告诉我,他们的项目也没有加载,他们也安装了。您是否检查了Windows事件日志以查看您的程序在那里记录了什么?如果它崩溃了,那么一些调用堆栈信息可以在那里供您分析。如果收集得当,崩溃转储会给您更多提示。@LexLi否,因为我没有听说过这样的事情,但当我加载不同的启动窗体并使用调用主窗体时。Show显示一个错误框,其中包含以下代码:您可以看到它调用UpdateForm,并且打开良好,然后执行MainForm.Show()调用,但最终在打开时会出现错误,因为该窗体具有仅在4.6中提供的函数。1@ShinyMK此异常显示错误类型转换的典型编码问题。我不认为这是相关的,但你可能会修复它,然后再试一次。是的,我刚刚确认这是因为ActiveX VLC。如果VLC本身没有安装在电脑上,那么它会给出这个错误。我怎样才能缓存/复制activex VLC所需的文件,然后将其放入.exe中,这样,如果他们没有安装VLC,那么它仍然可以工作?(我需要vlc 2.2.1中的文件,而不是最新版本的2.2.2,因为它实际上有更多的错误,信不信由你)。尝试将其作为资源嵌入,在运行期间,提取资源并注册dll/ocx。完成此操作后,调用InitializeComponent()在constructor.Im中尝试这样做,但由于某种原因,当我卸载2.2.2并安装2.2.1时,以及当我尝试选择Items>VLC>拖放时,会说它无法正确导入:/将文件添加到项目中,并配置VS将dll复制到输出文件夹中。在InitializeComponent()之前运行regsvr32.exe命令以注册dll。不知道如何注册dll。但无论采用哪种方式,我都只是更新回了2.2.2,因为拖放可以在其上运行,并且我在AXVLC和AXVLC上将其设置为“嵌入互操作类型”,当我尝试构建时,我得到了以下结果:
Exception object: 02499020
Exception type:   System.Runtime.InteropServices.COMException
Message:          Klasse nicht registriert (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
InnerException:   <none>
StackTrace (generated):
    SP       IP       Function
    00000000 00000001 System_Windows_Forms_ni!System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(System.Guid ByRef, System.Object, Int32, System.Guid ByRef)+0x2
    0037E2A0 6B2B0992 System_Windows_Forms_ni!System.Windows.Forms.AxHost.CreateWithLicense(System.String, System.Guid)+0xc2
    0037E2EC 6B2B0A86 System_Windows_Forms_ni!System.Windows.Forms.AxHost.CreateInstanceCore(System.Guid)+0x2e
    0037E320 6B2B0A45 System_Windows_Forms_ni!System.Windows.Forms.AxHost.CreateInstance()+0x99
    0037E348 6B2B1D63 System_Windows_Forms_ni!System.Windows.Forms.AxHost.GetOcxCreate()+0x17
    0037E354 6B2AEE74 System_Windows_Forms_ni!System.Windows.Forms.AxHost.TransitionUpTo(Int32)+0xc0
    0037E3A0 6B2AE08A System_Windows_Forms_ni!System.Windows.Forms.AxHost.CreateHandle()+0x2a
    0037E3C0 6ACDD215 System_Windows_Forms_ni!System.Windows.Forms.Control.CreateControl(Boolean)+0x75
    0037E3FC 6ACDD2E8 System_Windows_Forms_ni!System.Windows.Forms.Control.CreateControl(Boolean)+0x148
    0037E438 6B2AC785 System_Windows_Forms_ni!System.Windows.Forms.AxHost.EndInit()+0x2d
    0037E444 001E50D2 PRAGMA!PRAGMA.Pragma.InitializeComponent()+0x3a62
    0037EC70 001E0F58 PRAGMA!PRAGMA.Pragma..ctor()+0x1b0