John James
John James

Reputation: 81

.net in Coldfusion (8) - "Class My.CSharp.Class not found in the specified assembly list."

I have created a class library (dll) and I want to use this in Coldfusion. The library works great when running it from a test console app, but when I try to load it into Coldfusion I get the error "Integration.Microsoft.Exchange.Email not found in the specified assembly list.". I'm very new to C# so I'm assuming I have done something wrong, but I'm lost as to what it is.

Coldfusion code:

<cfobject 
    action      =   "create"
    type        =   ".net" 
    name        =   "DotNetObject" 
    class       =   "Integration.Microsoft.Exchange.Email"
    assembly    =   "path\to\my\folder\Integration.Microsoft.Exchange.dll"
>

C# Code Structure:

namespace Integration.Microsoft.Exchange
{
    public class Email
    {
        public static void New ()
        {
        }
    }
}

I have tried a different dll (still specified through the assembly attribute) and it works fine. Is there something wrong with the way I've built my class?

The actual two C# class files are available here: http://www.seedata.co.uk/samples/csharp-exchange-integration/Classes.zip

Thanks!

Upvotes: 0

Views: 788

Answers (1)

John James
John James

Reputation: 81

For anyone else that has issues with CF and .net, the solution to my problem in the end was very simple.

  1. I was not paying attention to the target .net version when compiling in Visual Studio (obvious I know but had only been coding C# for a few hours when I did this)
  2. Although I had the relevant .net version installed on my machine, the server had a version of .net that was not compatible with the libraries I was using

So a simple upgrade from .net 3.0 to 3.5 on the development server (you can't use anything higher than 3.5 on CF8) and changing my Visual Studio project to also compile to 3.5 solved the problem.

For anyone battling with this and thinking of giving up, the functionality is really quite good once you get it working!

Upvotes: 2

Related Questions