سؤال

I've developed a tool in C#.NET/Visual Studio, which uses an imported dll. The dll will be copied to output folder, when the project is built.

It doesn't need to install the application, you can just copy the exe and dll to a local folder to start.

Now I want to start the application from a network share:

\\localhost\program\prog.exe

All is fine while I don't call a function from the external dll. Then it crashes with the following error window:

Program has stopped working...

Question: Is there a way to make it work without copying both to a local folder and without changing policies on client computers?

Answer: Mapping \localhost to Z: solved this problem.

Please feel free to ask, this is my first question ;-)

Best regards, Christian

هل كانت مفيدة؟

المحلول

This sounds like a "caspol" issue. Network shares like \\localhost\program\ get reduced trust. Interestingly, from (some time ago), named shares actually get more trust - so one simple option is to map, say, z: as \\localhost\program, and access z:\prog.exe - you might find that this makes it work. Beyond that, the options are:

  • caspol changes to the each client machine
  • ClickOnce

of those, the latter is simpler. Then you simply run the ClickOnce application (rather than the .exe) - ClickOnce then basically makes it work. The user will, IIRC, need to click an "ok" the first time they run the application, but that's about it. You would need to ensure that the external dll is known the the ClickOnce deployment, i.e. it is in the project and marked to be shipped.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top