ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Could not load file or assembly 'netchartdir' or one of its dependencies.
Posted by Steve Mallin on Dec-24-2008 04:21
I am very happy with using ChartDirector.  My company liked the applications I created using ChartDirector so much that the had me create a duplicate system with different data sources.  For reasons I'd rather not get into, I copied my entire ASP.NET site folder and pasted it into another directory on the same website.  Unfortunately, none of the chart director charts work on the new pages.  The message I get is:

Could not load file or assembly 'netchartdir' or one of its dependencies.  The system cannot find the file specified.

In this new folder ("FOLDERa") which houses the new system, I have a folder called "Bin" which contains netchartdir.dll, netchartdir.dll.refresh, netchartdir.xml, and a resource for Oracle queries.  I also have a folder "ChartDirector" in "FOLDERa" which has a folder called "bin" containing netchartdir.dll and netchartdir.xml.

I think what happened is when I copied the pages out of the old directory and into the new, there was some link structure that is no longer valid pointing to the dll information.  Do you have any experience with this and how to fix it?  Thanks.

  Re: Could not load file or assembly 'netchartdir' or one of its dependencies.
Posted by Peter Kwan on Dec-24-2008 21:56
Hi Steve,

You need to put any assembly in the "bin" subdirectory of your "web application", but just any arbitrary "bin" subdirectory.

When you create a subdirectory on a IIS web server, the subdirectory may represent a new "web application", or it may be a subdirectory of an existing web application. It depends on the configuration of the subdirectory (configured using the Internet Services Manager).

If you copy the subdirectory without any configuration, it is just a subdirectory of an existing web application. In this case, you should put any assembly in the "bin" subdirectory of the existing web application that contains your folder.

If you copy your "FOLDERa" to the web document root, then the existing web application is the web document root. So you should copy the "netchartdir.dll" to the "bin" of the web document root (create the "bin" subdirectory if it does not already exist).

Hope this can help.

Regards
Peter Kwan

  Re: Could not load file or assembly 'netchartdir' or one of its dependencies.
Posted by Viquar Syed on Apr-08-2010 04:51
Hi,
I have followed the instructions as you had indicated, but when I run the page from Visual Studio it works fine, but when I run it through the web server URL, it still gives me the error
Could not load file or assembly 'netchartdir' or one of its dependencies

I have copied the netchartdir.dll from the ChartDirector folder under the same file system, I am the Administrator on the box, I gave permission to the bin directory for execution, but still no joy.
Can you please help?

Thanks

  Re: Could not load file or assembly 'netchartdir' or one of its dependencies.
Posted by Peter Kwan on Apr-08-2010 18:23
Attachments:
Hi Viquar,

Depending on your ASP.NET version, there should be more information in the error message. It should tell you why the assembly cannot be load. I have attached a typical screen shot (take from ASP.NET 2.0) for your reference.

Would you mind to inform me what is the exact error message? May be you can take a screen shot or copy the complete error message on the browser window and include it in your post.

Also, for testing, please try the sample code (such as "simplebar.aspx") that comes with ChartDirector. Put it in your directory and see if it works.

For the "bin" subdirectory, if your script is in "C:\Inetpub\wwwroot\xxxx\bbb.aspx", the "bin" subdirectory can be in "C:\Inetpub\wwwroot\xxx\bin" or in "C:\Inetpub\wwwroot\bin" (depending on whether your "xxxx" is configured as a separate web application, or just a subdirectory of the root web application). Also, sometimes the directory is not called "bin". It depends on the configuration in your web.config.

Anyway, if you are using Visual Studio, and you have included the "netchartdir.dll" as a reference in your web project, and you have deploy the web site using Visual Studio, the Visual Studio should automatically copy the "netchartdir.dll" to the correct directory.

Regards
Peter Kwan
scrshot2.PNG

  Problem Solved
Posted by Viquar Syed on Apr-08-2010 20:43
Hi Peter,

The problem was solved as soon as I deployed the application. I think 'it was that IIS had not registered the assembly and thus was giving out the error. The Sample is working fine now.
I appreciate your ehlp.

Thanks

Viquar

  Re: Could not load file or assembly 'netchartdir' or one of its dependencies.
Posted by Steve Mallin on Aug-31-2012 04:56
Attachments:
Hi, having this problem again on a new directory.  The Bin folder is in the root directory of
the web application but still I get the Parser Error Problem.


Server Error in '/Product Technology' Application.
--------------------------------------------------------------------------------

Parser Error
Description: An error occurred during the parsing of a resource required to service this
request. Please review the following specific parse error details and modify your source
file appropriately.

Parser Error Message: Could not load file or assembly 'netchartdir' or one of its
dependencies. The system cannot find the file specified.

Source Error:


Line 1:  <%@ Page Language="VB" AutoEventWireup="false" Debug="true"
CodeFile="yieldloss.aspx.vb" Inherits="Yield_Tracker_yieldreport" %>
Line 2:
Line 3:  <%@ Register Assembly="netchartdir" Namespace="ChartDirector"
TagPrefix="chart" %>
Line 4:
Line 5:  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


Source File: /Product Technology/YE LSI/Yield Tracker/yieldloss.aspx    Line: 3

Assembly Load Trace: The following information can be helpful to determine why the
assembly 'netchartdir' could not be loaded.


WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog].


(I do not have access to the web server's registry, so I cannot set the key as
suggested)
CaptureMenu.GIF

  Re: Could not load file or assembly 'netchartdir' or one of its dependencies.
Posted by Peter Kwan on Sep-01-2012 03:03
Hi Steve,

It is not easy to determine the exact cause of the issue without the "Assembly binding logging" (which shows where the .NET system is searching for the assembly). Without this information, we can just guess and try:

(a) Please use the "netchartdir.dll" from the latest version of ChartDirector, which is tested against the latest version of .NET (and also all .NET versions from 2.0 onwards).

(b) Try to create a bin directory under the "Yield Tracker" directory and also put the "netchartdir.dll" there. Although in your screen shot, the "Yield Tracker" directory is not shown as a web application (the icon seems to suggest it is just a folder of the "YE LSI" application), the screen may not be entirely reliable as to determine whether "Yield Tracker" by itself is a web application.

(c) Check if there are "web.config" files in the "YE LSI" and "Yield Tracker" subdirectories. By default, the .NET system should search the "bin" subdirectory for assemblies, but the exact directory name can be configured with "web.config" for the web applications. There are also configuration files (like aspnet.config and machine.config) that can change the directory name globally for all web applications on the machine. I have seen in some systems, people change the directory name to "cgi-bin" or some non-standard names.

(d) Just drop some arbitrary file into the "bin" subdirectory (eg. any image file). By default, if the "bin" subdirectory is changed in anyway, ASP.NET will restart the application. (The purpose of dropping the file is to trigger the restart, so any file will do.) This ensures ASP.NET will rescan the "bin" subdirectory.

(I assume you do not have administrative access to the server, otherwise you should be able to enable "Assembly binding logging". If you do have administrative access, you can use "iisreset" to restart the ASP.NET.)

Regards
Peter Kwan