简体   繁体   English

通过网络共享并使用驱动器号访问时,我的 WPF C# Exe 有效,但仅使用共享驱动器则无效

[英]My WPF C# Exe when shared over network and accessed with drive letter works but with just the shared drive does not

My executable developed on C#, WPF is shared on network.我在 C# 上开发的可执行文件,WPF 在网络上共享。 When I input this and run, \\192.168.0.15\\D$\\App\\WinApp.exe the application kicks off, but when I just do \\192.168.0.15\\App\\WinApp.exe the application does not kicks off.当我输入并运行 \\192.168.0.15\\D$\\App\\WinApp.exe 时,应用程序启动,但是当我执行 \\192.168.0.15\\App\\WinApp.exe 时,应用程序不会启动。 I have logger implementation in the App() constructor but it does not even reach that point.我在 App() 构造函数中有记录器实现,但它甚至没有达到那个点。 On the event viewer, got exception code 0xc0000005在事件查看器上,得到异常代码 0xc0000005

0xc0000005 reads a security issue, in fact you cannot run .Net code from a network share unless you explicitly allow for it. 0xc0000005读到一个安全问题,实际上你不能从网络共享运行 .Net 代码,除非你明确允许它。 I assume that the first invocation is not recognized as a remote share (maybe it is the same machine).我假设第一次调用不被识别为远程共享(可能是同一台机器)。

You have many options to solve this:你有很多选择来解决这个问题:

  1. Avoiding the share path (eg Run c# .NET Program from network share )避免共享路径(例如从网络共享运行 c# .NET 程序
  2. Tweaking the security of all client machines (eg run c# app from network share )调整所有客户端机器的安全性(例如从网络共享运行 c# 应用程序
  3. Publish the program on an HTTP server and use ClickOnce在 HTTP 服务器上发布程序并使用 ClickOnce

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM