The following error can occur when trying to load ChilkatDotNet2.dll from a UNC path located on another computer.
Could not load file or assembly 'ChilkatDotNet2, Version=9.0.4.0, Culture=neutral, PublicKeyToken=eb5fc1fc52ef09bd'
or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)
It is because the .NET runtime does not give full trust to the external UNC location. You must do one of the following:
- Move the ChilkatDotNet2.dll to a directory on the local computer.
- Grant full trust to the remote directory.
- Grant full trust to the ChilkatDotNet2.dll
This example demonstrates the simplest method for using a .NET assembly in an ASP.NET web page.
1) Create a new file “helloWorld.aspx” in your web site’s root directory. Using a text editor, add this:
<%@ Page Language="C#" %>
<%@ Import Namespace="Chilkat" %>
<html>
<head>
<title>ASP.NET Hello World</title>
</head>
<body bgcolor="#FFFFFF">
<p>
<%
Chilkat.Ftp2 ftp = new Chilkat.Ftp2();
Response.Write(ftp.Version);
%>
</p>
</body>
</html>
2) Create a “bin” directory in the same directory where the helloWorld.aspx file is located.
3) Copy the managed assembly (in this case it is ChilkatDotNet2.dll) into the “bin” directory.
4) That’s it. Browse to http://www.yourwebsite.com/helloWorld.aspx. The time to load the first page hit will be significantly longer than subsequent page loads. Errors are most likely permission related. Feel free to send error listings to support@chilkatsoft.com