3

I just upgraded a Lightswitch application that is called from an ASP.NET website. I can run the application from the "browse on port 80" option in IIS 7.5. on the server (2008 R2). But when I try to run it externally, I get the following error:

Server Error in '/EditInspectionData' Application.

The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.

1) Unable to find any implementation of the contract: 'Microsoft.LightSwitch.BaseServices.Logging.Internal.ILoggingService'

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ComponentModel.Composition.CompositionException: The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.

1) Unable to find any implementation of the contract: 'Microsoft.LightSwitch.BaseServices.Logging.Internal.ILoggingService'

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[CompositionException: The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.

1) Unable to find any implementation of the contract: 'Microsoft.LightSwitch.BaseServices.Logging.Internal.ILoggingService' ] Microsoft.VisualStudio.ExtensibilityHosting.VsExportProviderService.GetServiceFromCache(VsExportProvisionScope scope, VsExportSharingPolicy policy) +305 Microsoft.LightSwitch.Framework.Server.DefaultPageBase.LogDefaultClientNameMissingError() +148 Microsoft.LightSwitch.Framework.Server.DefaultPageBase.Page_Load(Object sender, EventArgs e) +377 System.Web.UI.Control.LoadRecursive() +71 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3178

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18408

2 Answers2

3

This answer is for VS2013 LightSwitch. This can occur if you deploy your package and erroneously launch the default.aspx file. For an example, let's say your application is called MyApp:

When you deploy the package, there are two 'default' programs: 1. At (website)/MyApp/default.aspx 2. At (website)/MyApp/DesktopClient/default.htm

It is the second one (default.htm) that you want to launch. Just for reference, along with default.htm should also be the file Silverlight.js that launches the Silverlight plugin.

batpox
  • 338
  • 2
  • 8
0

I thought I would come back and describe what I did to solve the problem in case anybody is searching for a similar answer. After spending a couple days trying everything I could think of from using Lightswitch's trace.axd, fiddler 2, verifying permissions, SQL passwords, IIS settings and everything I could think of, I ended up rewriting the application. It still ran fine on my desktop with Visual Studio 2013, so I just recreated it from scratch in VS2013.