Unblock a DLL on Windows Server 2012 and Windows 10

It has been very quiet at my blog for the last two months. The main reason for this is the go-live of a big NAV2016 upgrade I’ve been working on for the last half year or so.

This blog is related to this project. We are using some DLLs for this project. Among them are Anveo and ForNAV.

Sometimes you get a new version of a dll from one of your vendors. In some cases windows might prevent you from using them. You have to unblock it explicitly.

This is the error message you might get:

ForNAV1

“Cannot create an instance of the following .NET Framework object”

Reason is that you need to go to the properties of the DLL and manually unblock it.

ForNAV2

After this is done you can use the DLL. You need Administrator previledges.

Advertisements

10 thoughts on “Unblock a DLL on Windows Server 2012 and Windows 10

  1. thanks for posting this as I ran into the same issue two weeks ago with some Powershell scripts that I downloaded from GitHub and once I located the “unblock” button problem solved. Only remaining issue is how to unblock entire directories of scripts;

    Liked by 1 person

  2. Hi Mark,
    Have seen that. But somehow my own PC (Windows 10) nor any of my Windows servers I have the unblock function. So luckily you can use a powershell command to unblock it instead:
    get-childitem -Recurse | unblock-file

    Liked by 1 person

  3. Hi Mark,

    If you need to “unlock” a whole bunch of them, there’s a far simpler way than using PowerShell or what not. This particular “locking” mechanism is actually related to a feature of the Windows file system (NTFS Alternate Data Streams). When a file is saved from an e-mail or downloaded from Internet, a certain property gets set on it in the file system, which prevents Windows from executing it.

    Solution: a simple an easy way to unblock a bunch of dlls, it to copy them to a non-NTFS drive (i.e. FAT formated USB drive or just another non-NTFS drive) and back.

    Liked by 1 person

  4. You need to be running as an administrator to unblock a file directly in the add-ins folder. One option is to run File Explorer as an administrator, another is to run powershell as an administrator and the third; move the file to your desktop, unblock it, and move it back up to the add-ins folder.

    Liked by 1 person

  5. Hi,

    I have the same problem, even if I unblocked the DLL using powershell.
    I created a simple DLL using Visual Studio C#, put it into the AddIn folder of Nav 2015.
    Then in Nav 2015 I created a simple page and a pageAction with a DotNet Variable with subtype as of my DLL.
    I created the C/AL code to call my DLL-Function.

    After running my Code it says:

    Microsoft Dynamics NAV
    —————————

    Eine Instanz des folgenden .NET Framework-Objekts kann nicht geladen werden: Montage F1Gen, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
    —————————
    OK
    —————————

    What can I do now?

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s