SQLite installation on medium trust

Post here for help with installing or upgrading mojoPortal pre-compiled release packages. When posting in this forum, please provide all relevant details. You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

Post here for help with installation of mojoPortal pre-compiled release packages

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.

You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

This thread is closed to new posts. You must sign in to post in the forums.
11/13/2009 10:29:54 AM
Gravatar
Total Posts 4

SQLite installation on medium trust

Hi all.
I recently discovered Mojo and immediately started building my own site. Everything works perfectly on local machine, but big trouble came when yesterday I tried to publish it on my ARUBA server (Aruba is one of the major low cost hosting here in Italy. Thus, it runs on medium trust).

This is the error message when I try to setup the site:


[SecurityException:Could not load file or assembly on Medium Trust Level]

mojoPortal.Data.DBBannedIP.IsBanned(String ipAddress) +0

mojoPortal.Business.BannedIPAddress.IsBanned(String ipAddress) +37

mojoPortal.Web.BannedIPBlockingHttpModule.BeginRequest(Object sender, EventArgs e) +81

System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68

System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

 

I tried to recompile the SQLite mojoPortal.Data.dll with

[assembly: System.Security.AllowPartiallyTrustedCallers()]

but it doesn't work. I can't really say with kind of server I'm using as it's completely out of my reach.
(except for :Versione di Microsoft .NET Framework:2.0.50727.3603; Versione di ASP.NET:2.0.50727.3082).

Any idea or should I give up my hosting provider?

thank you in advace,

 

Marino

11/13/2009 10:40:24 AM
Gravatar
Total Posts 18439

Re: SQLite installation on medium trust

Hi,

Unfortunately, it is not possible to use SQLite under medium trust. It does PInvokes against a native dll and this is not allowed under medium trust.

Some hosts if you inquire will move your site to a server running in Full Trust, I know DiscountASP and Crystal Tech have both done that for me in the past, so you might ask your host about it.

I have heard rumors that maybe in .NET 4.0 SQLite will be installed in the GAC so that it could run under medium trust, but it is not a confirmed rumor.

I also have my eye on csharp-sqlite, which is a port of SQLite from C to C# and thus fully managed code so it "should" be possible to use it under medium trust, but I don't think it can be dropped in as a replacement for SQLite and not sure it will perform as well as the C version.

Hope it helps,

Joe

11/16/2009 2:52:38 AM
Gravatar
Total Posts 4

Re: SQLite installation on medium trust

Hi Joe.
This helped a lot, indeed. I will buy some SqlServer space for my site... :)
I will give csharp-sqlite an eye if I have time.
Will tell you if I will find something.

Have a nice day (and go on with this wonderful work).

Marino

11/24/2010 10:31:26 AM
Gravatar
Total Posts 3

Re: SQLite installation on medium trust

Hi ,

[quote]

I also have my eye on csharp-sqlite, which is a port of SQLite from C to C# and thus fully managed code so it "should" be possible to use it under medium trust, but I don't think it can be dropped in as a replacement for SQLite and not sure it will perform as well as the C version

[/quote]

this method works ?

I modified mojoPortal.Data.SQLite package :

add  reference : Community.CsharpSqlite.SQLiteClient.dll and Community.CsharpSqlite.dll

And for each class in  mojoPortal.Data.SQLite I have replaced

using Mono.Data.Sqlite; with using Community.CsharpSqlite.SQLiteClient;

 

Now i download mojoportal-2-3-5-4-sqlite-net35-deploymentfiles.zip and  replaced the new mojoPortal.Data.SQLite .

Well now there are no more Security errors but during installation
 have this problem

Verifica del sistema...
Privilegi del File system ok.
SQLite connessione al database ok.
i privilegi per il database sono sufficienti per modificare lo schema.

An Error Occurred:More restrictions were provided than needed.
Source:Community.CsharpSqlite.SQLiteClient
Stack Trace in Community.CsharpSqlite.SQLiteClient.SqliteConnection.GetSchema(String collectionName, String[] restrictionValues) in mojoPortal.Data.DBPortal.DatabaseHelperTableExists(String tableName) in mojoPortal.Data.DBPortal.DatabaseHelperSitesTableExists() in mojoPortal.Business.DatabaseHelper.SchemaHasBeenCreated() in mojoPortal.Web.UI.Pages.SetupHome.ProbeSystem() in mojoPortal.Web.UI.Pages.SetupHome.Page_Load(Object sender, EventArgs e) in System.Web.UI.Control.OnLoad(EventArgs e) in System.Web.UI.Control.LoadRecursive() in System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

:((

there is a solution to run this good cms with SQLite?
 

Bye

 

Running in medium trust whit Framework3.5

11/24/2010 11:48:15 AM
Gravatar
Total Posts 18439

Re: SQLite installation on medium trust

sorry but trying to find a solution to use SQlite in medium trust is not currently a project goal, I am not planning on using or supporting CsharpSqlite.

You can use SQL CE in medium trust and get the same benefit of a file based database for easy deployment, and it performs better than SQLite.

11/24/2010 2:46:51 PM
Gravatar
Total Posts 3

Re: SQLite installation on medium trust

Hi Joe, thanks for your answers.

but I have read this
 

MS-SQL CE 4:
(only available in .NET4) mojoportal-x-x-x-x-sqlce-net40-deploymentfiles.zip

SQL CE also works with the Framework3.5 ?

 

Thanks again.

 

 

11/24/2010 2:53:07 PM
Gravatar
Total Posts 2188

Re: SQLite installation on medium trust

Hi,

The version of SQL CE that mojoPortal is compatible with is CE 4 which requires .NET Framework 4.0 so you can't use .NET 3.5 mojoPortal releases with SQL CE.

HTH,
Joe D.

11/25/2010 1:58:33 AM
Gravatar
Total Posts 3

Re: SQLite installation on medium trust

thank you all for help :)

 

You must sign in to post in the forums. This thread is closed to new posts.