Mojo 2.3.7.0 SqlCe Installation FAILURE on Aruba Hosting

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/7/2011 5:37:02 AM
Gravatar
Total Posts 26

Mojo 2.3.7.0 SqlCe Installation FAILURE on Aruba Hosting

Hei,
 grreat boys !!

What about this --> ?

 

Welcome to mojoPortal Setup

Verifica del sistema...
Privilegi del File system ok.
An Error Occurred:The type initializer for 'System.Data.SqlServerCe.SqlCeConnection' threw an exception.
Source:System.Data.SqlServerCe

Stack Trace at System.Data.SqlServerCe.SqlCeConnection..ctor(String connectionString) at mojoPortal.Data.DBPortal.DatabaseHelperCanAccessDatabase(String overrideConnectionInfo) at mojoPortal.Web.UI.Pages.SetupHome.ProbeSystem() at mojoPortal.Web.UI.Pages.SetupHome.Page_Load(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

 

Any consideration ??

Thanks a lto !! ;-)

11/7/2011 10:48:44 AM
Gravatar
Total Posts 18428

Re: Mojo 2.3.7.0 SqlCe Installation FAILURE on Aruba Hosting

Sorry but when I test it it works fine.

Make sure you have .NET 4 hosting.

Other than that I have no idea what would cause that error.

11/7/2011 2:25:50 PM
Gravatar
Total Posts 26

Re: Mojo 2.3.7.0 SqlCe Installation FAILURE on Aruba Hosting

I have .net 4.0...

I tried to setup a personal solution with sql ce 4.0 and it work...

So the problem is the mojo software I think....

If you can put some controls-step when someone make a setup it will
be better and a great thing i think.

One of the controls has to be the db connection...

When Mojo perform the setup it makes a lot of description about directories,permission
and modules and db schema but it does not make some basilar controls about database
so everyone can understand the problem...

Do you or not ? ;-)

 

 

 

 

11/7/2011 2:36:46 PM
Gravatar
Total Posts 18428

Re: Mojo 2.3.7.0 SqlCe Installation FAILURE on Aruba Hosting

Make sure the /App_Data folder is writable by the user that is the identity on the application pool. If it cannot create a file there then it cannot create the database. 

 

11/7/2011 2:45:49 PM
Gravatar
Total Posts 26

Re: Mojo 2.3.7.0 SqlCe Installation FAILURE on Aruba Hosting

OK I TRY NOW...

11/7/2011 2:51:09 PM
Gravatar
Total Posts 26

Re: Mojo 2.3.7.0 SqlCe Installation FAILURE on Aruba Hosting

ALL THE FOLDERS DATA and app_data are writable... mmm the mojodb.sdf is in the app_data...
what about the web.config or user.config...??

11/7/2011 2:59:45 PM
Gravatar
Total Posts 18428

Re: Mojo 2.3.7.0 SqlCe Installation FAILURE on Aruba Hosting

It doesn't need anything in Web.config or user.config because it resolves the path to the db in the /App_Data folder .

public static string GetConnectionString()
        {
            if (ConfigurationManager.AppSettings["SqlCeApp_Data_FileName"] != null)
            {
                string path = System.Web.Hosting.HostingEnvironment.MapPath("~/App_Data/" + ConfigurationManager.AppSettings["SqlCeApp_Data_FileName"]);
                string connectionString = "Data Source=" + path + ";Persist Security Info=False;";

                return connectionString;
            }

            return ConfigurationManager.AppSettings["SqlCeConnectionString"];
           
        }

The error is in initializing the type which seems more likely a problem with the hosting environment. SQL CE can work in Medium Trust hosting but your host may have a custom trust level that is more strict and that may prevent it from working.

I would check with your host about the trust level.

11/7/2011 3:10:50 PM
Gravatar
Total Posts 26

Re: Mojo 2.3.7.0 SqlCe Installation FAILURE on Aruba Hosting

I have made a little software in asp net to see

I have used sql ce 4.1 and it works very well
So... I cannot understand why your way is not working....

In case of using Sql ce you can make some controls like:

 make a control about the framework version everytime and then....

 A) Try to write a file in the app_data and return Ok or Failure

 B) Try to create the db .sdf file and return Ok or failure 

 C) Try to create the table schema and return Ok or Failure

 D) Perform a check in the db objects created and return Ok or Failure

 E) Try to put some data into the db and return Ok or Failure...

     ecc....

Ahah ??? do you ??? ;-)   

 two beers please !! ;-)

 

11/7/2011 3:22:10 PM
Gravatar
Total Posts 26

Re: Mojo 2.3.7.0 SqlCe Installation FAILURE on Aruba Hosting

Can you make a little test page for Sql Ce ??

I repeat : I have done one test by me with a asp.net page and it works... !!

So ... it's strange .... I want to test MOJO ... why why why why ???????????? ;-)

11/7/2011 3:26:09 PM
Gravatar
Total Posts 70

Re: Mojo 2.3.7.0 SqlCe Installation FAILURE on Aruba Hosting

Based on the code Joe posted, you can try removing this setting from Web.config:

SqlCeApp_Data_FileName

and put in your own connection string using

SqlCeConnectionString

but you'll have to know the file system path to the database file

11/7/2011 3:47:34 PM
Gravatar
Total Posts 26

Re: Mojo 2.3.7.0 SqlCe Installation FAILURE on Aruba Hosting

I think this is not a good thing... If I have all in the app_data , your code has to work...

 but now i want to check the path.... now i check... ;-)

11/7/2011 4:35:58 PM
Gravatar
Total Posts 26

Re: Mojo 2.3.7.0 SqlCe Installation FAILURE on Aruba Hosting

So... uuuu I have made this steps :

 I have made a my asp net page ...

 A)  I have tested the "~/app_data" was correct ----> It's OK 

 B) I have then made a connection to a my db.sdf made with sql ce 4.1 --> was wrong (error)

     So i upload the   System.Data.SqlServerCe.Entity.dll  and  System.Data.SqlServerCe.dll 
     with x64 --- > It was wrong (error)

    So i upload the x86 and it was OK !!!!!!!!!!!!!!!!!!!!!    <---- OK

   I was able to connect and query my db.sdf sql ce 4 database ......... using this connection string in web.config

     connectionString="Data Source=|DataDirectory|\profilerDb.sdf"  or  connectionString="~/App_Data/ProfilerDb.sdf"

     

     so ... i think that .... may be i have to upload System.Data.SqlServerCe.dll and x86 dlls   in the bin folder ?????

    

 

 

 

11/7/2011 5:23:26 PM
Gravatar
Total Posts 26

Re: Mojo 2.3.7.0 SqlCe Installation FAILURE on Aruba Hosting

  I think some code is wrong....

  If you can get me some tests to do .... 

  I repeat :  my tests with a personal asp .net page was all right !!!!!! 

  So i think the MOJO code has some problems... ???

  If you include some preliminar test in the setup it would be better .... ;-)  

  

  Could you give me the code that perform the sql ce connection and creation ???? ;-)

  so i try to test that for MOJO project... ;-)

  Good night  from Italy !!

 

11/7/2011 5:45:23 PM
Gravatar
Total Posts 1203
Proud member of the mojoPortal team

Help support mojoPortal!
Add-on modules

Re: Mojo 2.3.7.0 SqlCe Installation FAILURE on Aruba Hosting

mojoPortal is completely open source. I'd recommend downloading the code with TortoiseHG, and take a look at the SqlCE data layer functions to see where it differs from your implementation. You can also run mojoPortal in debug mode, in case that will help you pinpoint the problem.

11/8/2011 2:42:53 AM
Gravatar
Total Posts 26

Re: Mojo 2.3.7.0 SqlCe Installation FAILURE on Aruba Hosting

The content that belongs here is too complex to display securely.
11/8/2011 3:19:47 AM
Gravatar
Total Posts 26

Re: Mojo 2.3.7.0 SqlCe Installation FAILURE on Aruba Hosting

 You have to update the code about Mojo  2.3.7.0 .. ;-)

11/8/2011 8:00:59 AM
Gravatar
Total Posts 18428

Re: Mojo 2.3.7.0 SqlCe Installation FAILURE on Aruba Hosting

Hi,

I found that I am able to reproduce this error under medium trust hosting, but previously it worked fine so I'm suspecting that some Windows Update may have changed things.

I did find that we have version 4.0.8402.1 of SQL Ce dlls, so I updated to the newer version 4.0.8482.1 on my local machine, but the problem still persists under Medium Trust. With Full Trust it works correctly.

I have emailed my contacts at Microsoft to find out if they can help. The full error details are:

An unhandled exception occurred and the process was terminated.

Application ID: /LM/W3SVC/1/ROOT

Process ID: 5488

Exception: System.TypeInitializationException

Message: The type initializer for 'System.Data.SqlServerCe.SqlCeConnection' threw an exception.

StackTrace:    at System.Data.SqlServerCe.SqlCeConnection.Finalize()

InnerException: System.TypeInitializationException

Message: The type initializer for 'System.Data.SqlServerCe.KillBitHelper' threw an exception.

StackTrace:    at System.Data.SqlServerCe.KillBitHelper.ThrowIfKillBitIsSet()
   at System.Data.SqlServerCe.SqlCeParameter..cctor()

InnerException: System.InvalidOperationException

Message: Cannot perform CAS Asserts in Security Transparent methods

StackTrace:    at System.Security.CodeAccessSecurityEngine.CheckNReturnSO(PermissionToken permToken, CodeAccessPermission demand, StackCrawlMark& stackMark, Int32 create)
   at System.Security.CodeAccessSecurityEngine.Assert(CodeAccessPermission cap, StackCrawlMark& stackMark)
   at System.Security.CodeAccessPermission.Assert()
   at System.Data.SqlServerCe.KillBitHelper.GetKillBit()
   at System.Data.SqlServerCe.KillBitHelper..cctor()

As far as your comments about trying to handle this error, we do check if we can connect to the database, if we can alter the schema etc, but this error happens before that, just in trying to create a connection, the error is not happening in mojoPortal code it happens in the SQL CE dlls and it only happens under partial trust hosting.

I will post again if I find a solution. For now I would see if you can get full trust hosting if you want to try mojoPortal with SQL CE.

Best,

Joe

11/8/2011 8:22:59 AM
Gravatar
Total Posts 26

Re: Mojo 2.3.7.0 SqlCe Installation FAILURE on Aruba Hosting

  No no Joe...

  that's not the problem....  SO WHY i'm able to run all OK with my asp .net page ???

 and if I run with sql server 2008 is also OK ?? 

 ​I think that the error is in another place... Can you post me the code about sql ce 4 ??

 thanks ... so I try to test the code... ;-)

11/8/2011 8:41:23 AM
Gravatar
Total Posts 18428

Re: Mojo 2.3.7.0 SqlCe Installation FAILURE on Aruba Hosting

Hi,

Ok, I heard back from my contact at Microsoft. It seems that when I updated to the newer version of the SQL CE dlls I used the "private" when I should have used the "desktop" version.

I have updated the mojoPortal 2.3.7.0 package for SQL CE. If you download it again and replace the files in the /bin folder it should work now.

Hope that helps,

Joe

11/8/2011 8:45:47 AM
Gravatar
Total Posts 26

Re: Mojo 2.3.7.0 SqlCe Installation FAILURE on Aruba Hosting

  Ahahah oh yeah !!!! 

  That was the mistake ??? ahahaha ;-) 

  For the damnation of the dark !!!!!!!!!

  Now I try ... than I offer you 4 biers so you can think better & better ahahah !!! ;-)

 

11/8/2011 9:39:53 AM
Gravatar
Total Posts 26

Re: Mojo 2.3.7.0 SqlCe Installation FAILURE on Aruba Hosting

 Uhuh this is a very hard question boys ..... 

     NOT WORKING YET ---- other mistake ... Joe !!! ;-)     rechecks !!! ;-)

Et voilà the secret :=> 

 Welcome to mojoPortal Setup

Verifica del sistema...
An Error Occurred:Could not load file or assembly 'System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

 

Source:mojoPortal.Data


Stack Trace at mojoPortal.Data.DBPortal.EnsureDatabase() at mojoPortal.Web.UI.Pages.SetupHome.ProbeSystem() at mojoPortal.Web.UI.Pages.SetupHome.Page_Load(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

11/8/2011 9:47:30 AM
Gravatar
Total Posts 18428

Re: Mojo 2.3.7.0 SqlCe Installation FAILURE on Aruba Hosting

Did you replace all the files in the bin folder?

It works for me.

11/8/2011 9:47:43 AM
Gravatar
Total Posts 26

Re: Mojo 2.3.7.0 SqlCe Installation FAILURE on Aruba Hosting

 OH YEAH ... done..... Noe It works !!!!

  Simply I have replaced your SQLCE dlls with dll desktop and all now is working !!!!

 

  Joe recheck .... you have private .dlls yet in source code ... !!! ;-)  

 Ahah ;-)  very well very good !!!

Oh my god boys ... after 3 days ...an hard work....

thanks for your support ... if I can help you in develop some extension...

​I offer a beer for all the staff...

​ahah ;-)

11/8/2011 9:50:12 AM
Gravatar
Total Posts 26

Re: Mojo 2.3.7.0 SqlCe Installation FAILURE on Aruba Hosting

  recheck the mojo dll Joe in the bin folder....

  I tried to use that but it does not worked then I used dlls from my pc, i replaced the Mojo dlls

  with desktop as you said and all now is working ... recheck... !!! ;-)

 

  How can I offer a beer boys ?? ahah ;-)

11/8/2011 9:52:00 AM
Gravatar
Total Posts 26

Re: Mojo 2.3.7.0 SqlCe Installation FAILURE on Aruba Hosting

   UUUUU   now I try to manage a little bit so I can test if all IS OK ... ;-) 

11/8/2011 9:52:40 AM
Gravatar
Total Posts 18428

Re: Mojo 2.3.7.0 SqlCe Installation FAILURE on Aruba Hosting

The mojoportal 2.3.7.0 SQLCE package on Codeplex does have the correct dlls. It works for me under medium trust.

11/8/2011 9:56:35 AM
Gravatar
Total Posts 26

Re: Mojo 2.3.7.0 SqlCe Installation FAILURE on Aruba Hosting

  ?? now It's working ... It' s very fast MORE than SQL Server 2008 !!!  now I test a little bit... ;-) ahah

11/8/2011 10:31:48 AM
Gravatar
Total Posts 26

Custom development

 Another question Joe :  for making some custom modules and functionality extensions ?? 

 ;-)

11/9/2011 9:39:05 AM
Gravatar
Total Posts 18428

Re: Mojo 2.3.7.0 SqlCe Installation FAILURE on Aruba Hosting

Please ask only one question per forum thread to help keep the forums organized.

See Developer Documentation to learn how to implement custom features.

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