Lightswitch Deployment

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
GTT
Posts: 3
Joined: Fri 24 Oct 2014 02:17

Lightswitch Deployment

Post by GTT » Fri 24 Oct 2014 02:25

Hi,

I am having trouble deploying Visual Studio Lightswitch application that is using dotConnect for PostgreSQL. I have successfully deployed it onto my development machine but cannot get it to work on a clean system. As per the documentation I needed to do 2 things for deploying this

1. Add the appropriate .DLL files to the projects bin directory

2. Add the following to Web.Config
system.data>
<DbProviderFactories>
<remove invariant="Devart.Data.PostgreSql" />
<add name="dotConnect for PostgreSQL" invariant="Devart.Data.PostgreSql" description="Devart dotConnect for PostgreSQL" type="Devart.Data.PostgreSql.PgSqlProviderFactory, Devart.Data.PostgreSql, Version=7.3.264.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
</DbProviderFactories>
</system.data>

The stack trace from the deployed app is as follows

[Microsoft.LightSwitch.DataService][Application:Error][LightSwitchServiceApplication.datamartData:CreateObjectContext] An exception has occurred: System.Configuration.ConfigurationErrorsException: Failed to find or load the registered .Net Framework Data Provider.
at System.Data.Common.DbProviderFactories.GetFactory(DataRow providerRow)
at System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName)
at System.Data.EntityClient.EntityConnection.GetFactory(String providerString)
at System.Data.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString)
at System.Data.EntityClient.EntityConnection..ctor(String connectionString)
at System.Data.Objects.ObjectContext.CreateEntityConnection(String connectionString)
at LightSwitchApplication.Implementation.datamartDataServiceImplementation.CreateObjectContext()
at Microsoft.LightSwitch.ServerGenerated.Implementation.DataServiceImplementation`1.get_ObjectContext()


So it looks like I am not doing something correct with the factory provider.Any help would be appreciated.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Lightswitch Deployment

Post by Shalex » Fri 24 Oct 2014 13:53

1. Specify the names and versions (x.x.x.x) of Devart.* assemblies you deployed with your Lightswitch application.

2. There are several versions of Devart.Data.PostgreSql.Entity.dll in the folder of provider installation (by default, %installFolder% is C:\Program Files (x86)\Devart\dotConnect\PostgreSQL\):
%installFolder%\Entity\EF1\Devart.Data.PostgreSql.Entity.dll
%installFolder%\Entity\EF4\Devart.Data.PostgreSql.Entity.dll
%installFolder%\Entity\EF5\Devart.Data.PostgreSql.Entity.dll
%installFolder%\Entity\EF6\Devart.Data.PostgreSql.Entity.dll
Which one did you deploy with your application?

3. Tell us the version and its update (if any) of Visual Studio you are using for creating Lightswitch application.

4. If possible, send us a small test project so that we can reproduce the issue in our environment.

JIC: http://www.devart.com/dotconnect/postgr ... resql.html.

GTT
Posts: 3
Joined: Fri 24 Oct 2014 02:17

Re: Lightswitch Deployment

Post by GTT » Sun 26 Oct 2014 06:33

1.
Devart.Data 5.0.1056.0
Devart.Data.PostgreSql 7.3.264.0
Devart.Data.PostgreSql.Entity 7.3.264.0
Devart.Data.PostgreSql.Entity.Migrations 7.3.264.0
Devart.Data.PostgreSql.Entity.Spatials 7.3.264.0

2.
%installFolder%\Entity\EF6\Devart.Data.PostgreSql.Entity.dll

3.
Microsoft Visual Studio Ultimate 2013
Version 12.0.30501.00 Update 2
Microsoft .NET Framework
Version 4.5.51641

Installed Version: Ultimate

Architecture and Modeling Tools 06181-004-0451047-02426
Microsoft Architecture and Modeling Tools

UML® and Unified Modeling Language™ are trademarks or registered trademarks of the Object Management Group, Inc. in the United States and other countries.

LightSwitch for Visual Studio 2013 06181-004-0451047-02426
Microsoft LightSwitch for Visual Studio 2013

Office Developer Tools - May 2014 Update ENU 06181-004-0451047-02426
Microsoft Office Developer Tools for Visual Studio 2013 - May 2014 Update ENU

Team Explorer for Visual Studio 2013 06181-004-0451047-02426
Microsoft Team Explorer for Visual Studio 2013

Visual Basic 2013 06181-004-0451047-02426
Microsoft Visual Basic 2013

Visual C# 2013 06181-004-0451047-02426
Microsoft Visual C# 2013

Visual C++ 2013 06181-004-0451047-02426
Microsoft Visual C++ 2013

Visual F# 2013 06181-004-0451047-02426
Microsoft Visual F# 2013

Visual Studio 2013 Code Analysis Spell Checker 06181-004-0451047-02426
Microsoft® Visual Studio® 2013 Code Analysis Spell Checker

Portions of International CorrectSpell™ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.

The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V. All rights reserved.

Windows Phone SDK 8.0 - ENU 06181-004-0451047-02426
Windows Phone SDK 8.0 - ENU

ASP.NET and Web Tools 2013.2.50425
Microsoft Web Developer Tools contains the following components:
Support for creating and opening ASP.NET web projects
Browser Link: A communication channel between Visual Studio and browsers
Editor extensions for HTML, CSS, and JavaScript
Page Inspector: Inspection tool for ASP.NET web projects
Scaffolding: A framework for building and running code generators
Server Explorer extensions for Windows Azure Web Sites
Web publishing: Extensions for publishing ASP.NET web projects to hosting providers, on-premises servers, or Windows Azure

ASP.NET Web Frameworks and Tools 2012.2 4.1.21001.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013 5.1.20409.0
For additional information, visit http://www.asp.net/

Common Azure Tools 1.1
Provides common services for use by Azure Mobile Services and Windows Azure Tools.

Devart dotConnect for PostgreSQL 7.3.264.0
Devart dotConnect for PostgreSQL
Copyright 2002 - 2014 Devart. All rights reserved.
Web: www.devart.com/dotconnect/postgresql
Support: [email protected]

Devart Entity Developer 5.7.461.0
Devart Entity Developer
Copyright © 2008-2014 Devart. All rights reserved.
Web: www.devart.com/entitydeveloper
Support: [email protected]

InstallShield Limited Edition
InstallShield. For more information visit the Flexera Software website at <http://www.FlexeraSoftware.com>. Copyright © 2013 Flexera Software LLC. All Rights Reserved.

LightSwitch Extensibility Toolkit 4.0
The toolkit provides project types for creating new LightSwitch Extension Libraries and includes templates for creating the following LightSwitch extensions: LightSwitch Business Type, LightSwitch Control, LightSwitch Data Source, LightSwitch Screen Template, LightSwitch Shell and LightSwitch Theme.

Microsoft Advertising SDK for Windows Phone
Microsoft Advertising SDK for Windows Phone
Build

NuGet Package Manager 2.8.50313.46
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

PreEmptive Analytics Visualizer 1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Data Tools 12.0.30919.1
Microsoft SQL Server Data Tools

Windows Azure Mobile Services Tools 1.1
Windows Azure Mobile Services Tools

Windows Phone 8.1 SDK Integration 1.0
This package integrates the tools for the Windows Phone 8.1 SDK into the menus and controls of Visual Studio.

Workflow Manager Tools 1.0 1.0
This package contains the necessary Visual Studio integration components for Workflow Manager.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Lightswitch Deployment

Post by Shalex » Tue 28 Oct 2014 18:38

GTT wrote:1.
...
Devart.Data.PostgreSql.Entity 7.3.264.0
...
2.
%installFolder%\Entity\EF6\Devart.Data.PostgreSql.Entity.dll
The Devart.Data.PostgreSql.Entity.dll assembly from the %installFolder%\Entity\EF6\ folder has the revision number 6 (7.3.264.6).

1. Please send us your Web.config (mark a confidential information with asterisks). A complete small test project will be appreciated.
2. Have you included the "Devart.Data.PostgreSql" DbProviderFactories entry in Web.config of the server part of your Lightswitch application?

GTT
Posts: 3
Joined: Fri 24 Oct 2014 02:17

Re: Lightswitch Deployment

Post by GTT » Tue 28 Oct 2014 21:25

Hi, I have managed to get the deployed application working on a clean system by installing the .dll's into the the Global Assemby Cache rather than having them in the /bin directory.


This is what I added to my Web.Config

<system.data>
<DbProviderFactories>
<remove invariant="Devart.Data.PostgreSql" />
<add name="dotConnect for PostgreSQL" invariant="Devart.Data.PostgreSql" description="Devart dotConnect for PostgreSQL" type="Devart.Data.PostgreSql.PgSqlProviderFactory, Devart.Data.PostgreSql, Version=7.3.264.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
</DbProviderFactories>
</system.data>

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Lightswitch Deployment

Post by Shalex » Thu 30 Oct 2014 14:16

Please upload your complete small test project to some file exchange server so that we can download it and reproduce the problem in our environment.

Post Reply