This may sounds easy, but it can cause small headache. It happened to me :) I have developed simple event receiver which creates log to the workflow history list and sends email to somebody. But since I uploaded and activated solution on production server, my solution stopped working. After few minutes of testing and reading log files in 12 hive I found this error message: Request for the permission of type 'System.Net.Mail.SmtpPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Some articles about deployment
http://msdn.microsoft.com/en-us/library/dd583158(v=office.11).aspx
http://msdn.microsoft.com/en-us/library/ie/gg749858.aspx
http://msdn.microsoft.com/en-us/library/ee231562.aspx
led me to find where real problem was. Assemblies installed to the global assembly cache (GAC) run with Full trust, but when I looked to the GAC I couldn't see my dll. So I tried to install it to the GAC. And since than its working like a charm. Conclusion is that is possible to create wsp file from your project (Visual Studio -> Build -> Package), upload(Share Point (home page) -> Site Actions -> Site Settings -> Solutions) and activate it. But if your dll is not in GAC you probably won't be able to use some classes as articles from msdn mentioned.
I am not sure if it is best approach but it works for me... So if you know better one, please let me know :)
Happy coding...
No comments:
Post a Comment