clrzmq icon indicating copy to clipboard operation
clrzmq copied to clipboard

DirectoryNotFoundException when running on UNC path

Open mitbra opened this issue 11 years ago • 1 comments

I've encountered a strange problem with running my application on a shared network drive where the application makes use of clrzmq.

Context

clrzmq pre-release 3.0.0-rc1 -- from NuGet. libzmq version 3.2.2-rc2 bundled with clrzmq. Windows 7 Professional 64-bit SP1. .NET Framework 4.5 VS2012 WDExpress

Problem

The following code snippet draws out my exception:

namespace ConsoleApplication2
{
    using System;
    using ZeroMQ;

    class Program
    {
        static void Main(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += 
                Unhandled;

            var ctx = ZmqContext.Create(); // This is where it occurs
            Console.ReadKey();
        }

        static void Unhandled(
            object sender, UnhandledExceptionEventArgs e)
        {
            Console.WriteLine(e.ExceptionObject.ToString());
            Console.ReadKey();
        }
    }
}

To make it happen you will need the application to be on a UNC path. In my case it was \\myserver\subdirectory . If I attempt to run the executable like this I get the following exception.

\\myserver\subdirectory>.\bin\Testing\ConsoleApplication2.exe
System.TypeInitializationException: The type initializer for 'ZeroMQ.Interop.LibZmq' threw an exception. ---> System.IO.DirectoryNotFoundException: Could not find...

The exception message claims to be looking in a path that is not valid: \\myserver\subdirectory\subdirectory\bin\Testing\libzmq-x86-3.0.0.0.dll. Note the doubling of subdirectory.

The application works when using a drive letter -- for example: F:\bin\Testing.

Is this to do with the packaging of the binaries or something completely unrelated to this project?

mitbra avatar Jul 02 '13 01:07 mitbra

I'm having the same problem. Version clrzmq.dll : 3.0.12310.0 Any news on this?

Thanks

leticiativeronbt avatar Nov 06 '15 13:11 leticiativeronbt