允许本地DLL输出标准输出/标准错误在C#控制台应用程序 [英] Allow native DLL to output stdout / stderr in c# console application

查看:407
本文介绍了允许本地DLL输出标准输出/标准错误在C#控制台应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个通过标准输出/标准错误输出机DLL。

I have a native DLL which outputs via stdout / stderr.

我有调用该DLL和二进制数据输出到父C#应用程序中的C#控制台应用程序,开始的C#控制台exe文件,处理标准输出/标准错误。

I have a C# console application which calls this DLL and outputs binary data to a parent C# application which started the C# console exe, processing stdout / stderr.

目前,当我调用C#exe文件只是正常工作(该DLL挂接到我的控制台应用程序的标准输出和放入就好了其数据)。

Currently when I call the C# exe it works just fine (the DLL hooks up to the stdout of my console application and puts its data in just fine).

这是由设计(也不应该在将来的.NET framework版本被打破)?

Is this by design (and shouldn't be broken in future .NET framework versions)?

是否有与此策略(完全信任,权限要求,GAC的问题,等等)?

Are there limitations on my managed code's deployment with this strategy (full-trust, permission requirements, GAC issues, etc)?

我可以对我的托管代码的部署限制不像是会找到一个管理的exe输出和一个非托管的DLL都将数据在MSDN上的标准输出的任何文档。

I can't seem to find any documentation about stdout with a managed exe and an unmanaged dll both putting data in that standard output on MSDN.

谢谢,

推荐答案

这会工作得很好。要知道,你的代码需要在客户机上完全信任权限,但是,为了调用到本机DLL。

This will work just fine. Be aware that your code will need full trust permissions on the client machine in order to call into a native DLL, however.

这篇关于允许本地DLL输出标准输出/标准错误在C#控制台应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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