0

I have a signed class library that I've added into ASP.NET MVC 3 application.

When I deploy the application on my hosting server, it says, could not load type "...." the name of the type I have inside the signed assembly.

Do I need to copy the .pfx file also into the bin of the asp.net application?

Thanks

5
  • 2
    Is the dll inside the application's bin folder on the server? Check if it's in your local bin as well (it should). If it isn't check if you are using it from the GAC. Also check the reference's "Copy Local" setting. The pfx is only necessary when compiling so you shouldn't need to include it anywhere. Sep 14, 2012 at 22:14
  • Thanks pablo. The DLL is inside the bin folder on the development and production server, still getting same error.
    – Bill
    Sep 14, 2012 at 22:24
  • 1
    That's odd, bin folder should be the second place (after gac) where to look for the assembly. Now, are you sure that it is your assembly that is not loading and not another referenced assembly? It might be one of that signed assembly's dependencies that is not present the one causing the error. You might also want to make sure that their appPool is set up to the correct version of .NET, JIK. Sep 14, 2012 at 22:29
  • My bad. I was using a wrong "Type" was mistaken in the Namespace. But now what I did I removed the PublicToken so that it just looks inside bin. Side question, why do we sign an assembly? Just to add it to GAC? thanks
    – Bill
    Sep 14, 2012 at 22:35
  • 1
    Oh excellent. Well, AFAIK, we sign to include in the GAC as well as to claim real authorship. For example, you can see that MS signs their assemblies with the same public key. I could create an assembly that looks just like Microsoft's with the same name and classes, but I can't fake that signature without having their physical key to sign it. That's why you shouldn't distribute it. Sep 14, 2012 at 22:59

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.