VS2017上的事件错误v4.0.30319 system.io.filenotfoundexception使用包含C ++代码的类库(CLR)DLL的C#windows服务项目 [英] Event error v4.0.30319 system.io.filenotfoundexception on VS2017 C# windows services projects using class library (CLR) DLL including C++ code

查看:209
本文介绍了VS2017上的事件错误v4.0.30319 system.io.filenotfoundexception使用包含C ++代码的类库(CLR)DLL的C#windows服务项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Visual Studio 2017上创建了一个CLR(类库)项目,以获取C ++代码的DLL,供C#开发的几个Windows服务Visual Studio 2017项目使用。开发的Windows服务在开发PC上运行良好,但它们不适用于客户PC。



服务立即完成,您可以在Windows事件管理器上跟踪以下错误。



申请:PcAmpel.exe Framework版本:v4.0.30319描述:由于未处理的异常,进程已终止。异常信息:Code.Anwendung()处的System.Inwendung()处的System.Thread.Thread.ThreadStart_Context(System.Object)的System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext,System.Threading.ContextCallback,System。)中的System.IO.FileNotFoundException。 System.Threading.ExecutionContext.Run的System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,System.Threading.ContextCallback,System.Object,Boolean)中的Object,Boolean)(System.Threading.ExecutionContext,System.Threading。 System.Threading.ThreadHelper.ThreadStart()中的ContextCallback,System.Object)


我在网上发现类似的问题,但要么信息太差了解释或错误或微软提供的链接修复已被删除。



一个好的建议将非常感激。



Best,Marcos



我尝试过:



我已经尝试安装每个.NET Framewor k和任何可分发的Visual Studio软件包,但没有任何帮助,我发现,在客户PC上安装Visual Studio 2017后,每个Windows服务都可以启动并正常工作,但这不是一个解决方案。我已经联系了微软虚拟聊天,并在不同的日子预定了两个电话,但他们的帮助是一个笑话和浪费时间。您正在从一名员工转到另一名员工,最后,电话已关闭。

I've created a CLR (Class Library) project on Visual Studio 2017 to get a DLL for C++ code to be used by several windows services visual studio 2017 projects developed on C#. The developed windows services work fine on the development PC but they don't work in the customer PCs.

The services finished immediately and you can track the error below on the windows event manager.

Application: PcAmpel.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.IO.FileNotFoundException at Code.Anwendung() at System.Threading.ThreadHelper.ThreadStart_Context(System.Object) at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) at System.Threading.ThreadHelper.ThreadStart()

I've found on the web about similar problems, but either the information is too poorly explained or wrong or the link fixes being provided by Microsoft have been removed.

A good advice would be very much appreciated.

Best, Marcos

What I have tried:

I've tried installing every .NET Framework and any distributable Visual Studio packages, but nothing helped, I've found, that after installing Visual Studio 2017 on the customer PC, every windows service can be started and works fine, but this is not a solution. I've contacted Microsoft virtual chat and scheduled two phone calls at different days but their help is a joke and waste of time. You are being passed from one employee to other and at the end, the phone call is off.

推荐答案

您正在查看除您自己的代码之外的所有内容。 />


错误信息显而易见,找不到文件。



你的代码试过打开一个文件或类似的文件,指定的文件不存在你说的那样。



你也没有预料到这种情况并没有包装try / catch块中的任何代码都可以捕获这种可能性,并在任何地方记录异常和任何有用的详细信息,例如您尝试访问的文件路径。
You're looking at everything except your own code.

The error message makes in plainly obvious, "File Not Found".

You're code tried to open a file or similar and the file specified doesn't exist where you said it was going to be.

You also did not anticipate this situation and didn't wrap any of the code in a try/catch block to catch this possibility and log the exception and any useful details anywhere, like the file path you tried to access.


这篇关于VS2017上的事件错误v4.0.30319 system.io.filenotfoundexception使用包含C ++代码的类库(CLR)DLL的C#windows服务项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆