I wrote a backup procedure using smo. this procedure works great on my dev box, but once deployed to the hosting company's web server it throws above exception ("System.Security.SecurityException: That assembly does not allow partially trusted callers.")
I did some research on the subject and it seems that hosting companies give you only medium trust in the config file and hence cannot access smo.
My hosting admin is a great fellow (www.alsonetworks.com, recommended!) and is willing to help out, so he told me that he:
A. installed smo 2008 in the GAC
B. added them to the medium.config file
Even so, I still receive the error. Now, I'm pretty sure he'd do anything possible to get it to work (sans giving full trust) but i'd got to tell him what to do.
So can anybody advise any additional steps that can be done to get this to work?
my site is built with vb asp.net 3.5 against mssql 2008, but the hosting site uses mssql 2005.
I appreciate your help and advice
PS. I've also read a lot about AllowPartiallyTrustedCallers, but I understand that it is irrelevant here as i have not written the assembly. it would be something ms could/should do. is that correct?
heres the code :
Public Shared Sub Backup()
Dim sqlCon = New SqlConnection(ConfigurationManager.ConnectionStrings("Main").ConnectionString)
Dim conn As New Server
View Complete Post