views:

381

answers:

3

EDIT: the GAC issue below may not actually be the culprit. Turns out, even when I create a brand new Console App project and add the .dll directly (so that it lives in the bin), I still can't run it on the sever. Also, I've noted that Console apps are created targeting the .NET 4.0 Client Profile rather than the .NET Framework 4. When I try to run it targeting the client profile, it appears that none of the System.Web* libraries are available. However, I tried running a very simple test app targeting both and neither would run on the server while referencing the bad .dll.

Is there a special kind of install that was to occur to run .NET 4.0 Console Apps?


I'm trying to add a .NET 4.0 .dll to the GAC. I am attempting to do this because it is published by a 3rd party company as both a 32 and 64bit .dll which I must use from different apps on different platforms in both formats.

At any rate, I am having trouble registering this dll to the GAC on a Windows Server 2008 environment.

I have tried copying gacutil.exe (and supporting file) found at "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools" on my local machine to the "C:\Windows\Microsoft.NET\Framework\v4.0.30319" folder on the target production server per the suggestions found here.

I then tried copying them to "C:\Windows\Microsoft.NET\Framework64\v4.0.30319".

Running from both locations indicated successful installation. And indeed, the registration appears successful:

  • C:\Windows\Microsoft.NET\assembly\GAC_64\ChilkatDotNet4\v4.0_9.0.8.0__eb5fc1fc52ef09bd\ChilkatDotNet4.dll
  • C:\Windows\Microsoft.NET\assembly\GAC_32\ChilkatDotNet4\v4.0_9.0.8.0__eb5fc1fc52ef09bd\ChilkatDotNet4.dll

However, running a console app that refers to the (64bit) version of the dll errors out with the following message:

System.IO.FileNotFoundException: Could not load file or assembly 'ChilkatDotNet4.dll' or one of its dependencies. The specified module could not be found. File name: 'ChilkatDotNet4.dll'

So, I have now manually created the following GAC entries using mkdir and copy from a command prompt (which may or may not actually work. I have no clue what is so special about gacutil.exe):

  • C:\Windows\Microsoft.NET\assembly\GAC_MSIL\ChilkatDotNet4\v4.0_9.0.8.0__eb5fc1fc52ef09bd\ChilkatDotNet4.dll (using the 64bit version of the dll)
  • C:\Windows\assembly\GAC_64\ChilkatDotNet4\v4.0_9.0.8.0__eb5fc1fc52ef09bd\ChilkatDotNet4.dll
  • C:\Windows\assembly\GAC_32\ChilkatDotNet4\v4.0_9.0.8.0__eb5fc1fc52ef09bd\ChilkatDotNet4.dll

After each "install" of the dll, I tested and received the same error. Any ideas welcome!

+5  A: 

For anyone else who may have trouble with this in the future. It was not a generalized problem with the way I was registering the dll to the GAC or how I was referring to it from my projects.

ChilkatDotNet4.dll (and the other versions I'm sure) was built in Visual C++. So, the server it is being deployed to has to have the Visual C++ Runtime installed for the appropriate processor architecture.

For 2010 (.NET 4.0):

fordareh
Big thanks for this - saved my bacon today :)
fritterfatboy
+1  A: 

Site not allowing me to comment on the previous answer but wanted to record that installing the Visuall C++ runtime for x64 solved the problem. My thanks to fordareh for following up to his own question and posting the solution along with the links directly to the microsoft download site. I really appreciated the extra effort, and this post saved me a lot of hair pulling.

James.

A: 

Thanks! i was looking for this solution for 2 days now! I had exactly the same problem trying to run an application that was using chillkatDotNet4.dll 64bit on Windows 2008 R2. I just installed the Visual C++ Runtimes from the link provided above and worked straight away! There is no need to install it in GAC.

Frangiskos