SMO System.Security.SecurityException


hello everybody

i wrote backup procedure using smo. procedure works great on dev box, once deployed hosting company's web server throws above exception ("system.security.securityexception: assembly not allow partially trusted callers.")

i did research on subject , seems hosting companies give medium trust in config file , hence cannot access smo.

my hosting admin great fellow (www.alsonetworks.com, recommended!) , willing out, told me he:

a. installed smo 2008 in gac

b. added them medium.config file

even so, still receive error. now, i'm pretty sure he'd possible work (sans giving full trust) i'd got tell him do.

so can advise additional steps can done work?

my site built vb asp.net 3.5 against mssql 2008, hosting site uses mssql 2005.

i appreciate , advice

ps. i've read lot allowpartiallytrustedcallers, understand irrelevant here have not written assembly. ms could/should do. correct?

 

heres code :

    public shared sub backup()         dim sqlcon = new sqlconnection(configurationmanager.connectionstrings("main").connectionstring)         dim conn new serverconnection(sqlcon)         dim srv = new server(conn)         dim db database         db = srv.databases(conn.databasename)         dim bk new backup         bk.action = backupactiontype.database         bk.backupsetdescription = "full backup of database"         bk.backupsetname = "my data backup"         bk.database = conn.databasename         dim bdi backupdeviceitem         bdi = new backupdeviceitem         bdi.devicetype = devicetype.file         bdi.name = path.combine(httpcontext.current.server.mappath("~/backups"), "mydatabase.bak")         bk.devices.add(bdi)         bk.sqlbackup(srv)         dim dcx new dataclassesdatacontext         dim c = (from q in dcx.configs q.configid = curconfig.configid).firstordefault         c.lastbackup =         dcx.submitchanges() 

error thrown not here,but in procedure calls "backup" sub

thanks alot!

did try run backup t-sql script using executenonquery in same script? might methods in backup method dont meet security need. in same script, can try , create table. can let know if succeeds?


SQL Server  >  SQL Server SMO/DMO



Comments

Popular posts from this blog

Reindexing

Users List

List of charts