Question

I am using visual studio 2010 on windows server 2010 with Sharepoint 2010 server. I am deploying webparts to a Sharepoint instance running on the same server.

My new webpart makes use of a custom library, AE.Net.Mail. When I deploy this webpart, I get the Could not load file or assembly... error for AE.Net.Mail. I have run gacutil but I do not see the assembly in C:\Windows\assembly. I do see it in a subdirectory of C:\Windows\Microsoft.NET\assembly.

Now I am not sure about this but I think when my Sharepoint instance runs, it only looks at C:\Windows\assembly. And that is why it is not able to find the library. The reason I believe this is that the name of my webpart is present in C:\Windows\assembly. It's being cached there and not in a subdirectory of C:\Windows\Microsoft.NET\assembly.

I am using version AE.Net.Mail Version 1.6.0.0 which is compatible with .NET 3.5. I think my Sharepoint server is using 3.5 although 4.0 is present on the machine. I think so because when I tried to install the the library using nuget, I couldn't install the latest version that requires .NET 4.0. The error said that my project is using 3.5. Version 1.6.0.0 is compatible with 3.5

So, what do you guys think is going on and how do you think I can get AE.Net.Mail into C:\Windows\assembly? Been at this for hours now and I can't figure it out (Dragging and dropping doesn't work)

Thanks guys. :)

Was it helpful?

Solution

Judging from the sources AE.Net.Mail isn't strongly typed which is something GAC-deployment (and SharePoint) require.

To add the binary to the GAC you must download the binaries of AE.Net.Mail from Github, sign the assembly and compile it yourself. This is easy, simply follow this guide http://msdn.microsoft.com/en-us/library/ms247123(v=vs.100).aspx

Remember to compile for .net 3.5 since that's what SP2010 supports, it wont recognize net4 assemblies

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top