Silveright config error stopped - silverlight

Server Error in '/' Application.
I have just started to publish the app to IIS server but it is failing, any ideas on this how to solve?
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Could not load file or assembly 'System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. (C:\PBM_Test\web.config line 15)
Source Error:
Line 13:
Line 14:
Line 15: Line 16:
Line 17:
Source File: C:\PBM_Test\web.config Line: 15
this is the web.config.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<add name="DomainServiceModule" preCondition="managedHandler" type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, `enter code here`System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</modules>
<validation validateIntegratedModeConfiguration
="false" />
</system.webServer>
<system.web>
<httpModules>
<add name="DomainServiceModule" type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</httpModules>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</assemblies>
</compilation>
</system.web>
<connectionStrings>
<add name="PBMEntities" connectionString="metadata=res://*/ModelPBM.csdl|res://*/ModelPBM.ssdl|res://*/ModelPBM.msl;provider=System.Data.SqlClient;provider connection string="data source=SRVORDERS;initial catalog=PBM;user id=OK;password=OK1;multipleactiveresultsets=True;App=EntityFramework"" providerName="System.Data.EntityClient" /></connectionStrings>
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
</configuration>

see http://forums.silverlight.net/t/180719.aspx/1
and http://community.discountasp.net/showthread.php?t=10296 for info
The above threads describe how you have to make sure that your web application has a copy of this file available.
If you are using a server you can install software to, the best solution is to make sure that the server has both the latest version of .net and RIA services installed (Both may be separate installations) (EDIT - make sure all the packages that alfonso list are installed.)
If you don't have access to install software on the server, the other solution is to make sure that ServiceMode.DomainServices.Hosting 4.0 is copied to the BIN folder during deployment of your ASP solution - set the file properties to Local Copy / Only if Newer

Make sure you have installed all of these packages on the server:
Silverlight4 Tools
Silverlight SDK
RiaServicesToolkit
RiaServices
Hope it helps!

Related

SSRS Report Parameters grayed out after postback

We have a website that uses Microsofts Report Viewer control (version 12). The server is SQL-Server 2012. Up until a week ago it worked fine. We have a report that when it opens asks for a start date from a list. This works fine and causes a postback that populates the end date list. HOWEVER, when the form comes back now both the start and end dates are grayed out.
LoadAsync is false.
KeepAlive is true.
Tried with cookies turned on and off.
Tried using Report Viewer version 11 instead.
Checked the web.config for problems.
Any ideas?
Here's what the web.config file looks like (set up for report viewer version 11)
<configuration>
<system.web>
<httpCookies requireSSL="false"/>
<sessionState timeout="20" mode="InProc" cookieless="false" />
<compilation targetFramework="4.5">
<assemblies>
<add assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>
<add assembly="Microsoft.ReportViewer.Common, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>
</assemblies>
</compilation>
<httpRuntime targetFramework="4.5"/>
</system.web>
<system.webServer>
<handlers>
<add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>
</handlers>
</system.webServer>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs"
type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701"/>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+"/>
</compilers>
</system.codedom>
</configuration>
Turns out that the aspx report page that contained the report viewer control has a script that fired on postback and that script reference a missing file.

How to load a App.Config file into a VCL application?

I am trying the RemObject Hydra to embed a WPF module inside a VCL app.
In this WPF module, I have Grid Controls, and EntityFramework DataContext. It's connectionString, providers and everything stored in a app.config.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<connectionStrings>
<add name="ModelConnection" connectionString="character set=UTF8;data source=localhost;initial catalog=PATHTODATABASE.FDB;user id=SYSDBA;password=MASTERKEY" providerName="FirebirdSql.Data.FirebirdClient" />
</connectionStrings>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
<defaultConnectionFactory type="FirebirdSql.Data.EntityFramework6.FbConnectionFactory, EntityFramework.Firebird" />
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<provider invariantName="FirebirdSql.Data.FirebirdClient" type="FirebirdSql.Data.EntityFramework6.FbProviderServices, EntityFramework.Firebird" />
</providers>
</entityFramework>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="FirebirdSql.Data.FirebirdClient" publicKeyToken="3750abcc3150b00c" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.5.0.0" newVersion="4.5.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.data>
<DbProviderFactories>
<remove invariant="FirebirdSql.Data.FirebirdClient" />
<add name="FirebirdClient Data Provider" invariant="FirebirdSql.Data.FirebirdClient" description=".NET Framework Data Provider for Firebird" type="FirebirdSql.Data.FirebirdClient.FirebirdClientFactory, FirebirdSql.Data.FirebirdClient" />
</DbProviderFactories>
</system.data></configuration>
The next step was to make the VCL host with delphi then load the WPF module's .dll using the HYModuleManager component. This is pretty straigtforward :
procedure TMainForm.FormCreate(Sender: TObject);
begin
HYModuleManager1.LoadModule('%path%\to\wpf\module\GridsModule.dll');
HYModuleManager1.CreateVisualPlugin('ClientGridView', fInstance, Panel1);
end;
I run the application in Delphi. But this error is thrown :
(Translation : An exception was thrown by the target of an invocation)
So with a little more research, I run this application (HydraHost.exe) using VisualStudio, and realize that this si the exception thrown by the module :
System.InvalidOperationException : 'No connection string named 'ModelConnection' could be found in the application config file.'
I then decide to write a WPF host. I set the WPF Host App.config to include the connection string and provider infos. To no surprise, everything works fine.
So, with the VCL host, the connectionString is not found. With the WPF host, it is. My conclusion is that the app.config is not loaded by the VCL host but it is loaded by the WPF host.
So what I did next is to manually copy the WPFHost.dll.config to VCLHost.exe.config as suggested by one of the answers, but same error, connectionString is not found.
So my question is : How can I "link" a .exe.config to a VCL app built with Delphi?
You should rename your app.config to YourExeName.exe.config as it's probably now YourDllName.dll.config

SqlMembershipProvider not compatible with this version

I generated a script for my aspnet Database, now when I try to use the database it gives an error
The 'System.Web.Security.SqlMembershipProvider' requires a
database schema compatible with schema version '1'. However,
the current database schema is not compatible with this version. You
may need to either install a compatible schema with aspnet_regsql.exe
(available in the framework installation directory), or upgrade the
provider to a newer version.
What options do I really have to solve this problem?
Do I need to run aspnet_regsql.exe or is there a way to get around this error besides having to go with this option as the error suggests?
My web.config file looks like this:
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</assemblies>
</compilation>
<membership defaultProvider="SqlProvider">
<providers>
<clear/>
<add name="SqlProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="CPMS_DB"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
requiresUniqueEmail="false"
maxInvalidPasswordAttempts="3"
minRequiredPasswordLength="6"
minRequiredNonalphanumericCharacters="0"
passwordAttemptWindow="3"
applicationName="/"/>
</providers>
</membership>
<profile>
<providers>
<clear/>
<add name="AspNetSqlProfileProvider"
type="System.Web.Profile.SqlProfileProvider"
connectionStringName="ApplicationServices"
applicationName="/"/>
</providers>
</profile>
<roleManager enabled="true">
<providers>
<clear />
<add connectionStringName="ApplicationServices"
applicationName="/"
name="AspNetSqlRoleProvider"
type="System.Web.Security.SqlRoleProvider" />
<add applicationName="/"
name="AspNetWindowsTokenRoleProvider"
type="System.Web.Security.WindowsTokenRoleProvider" />
</providers>
</roleManager>
I would use the aspnet_regsql.exe to create a new/blank database.
Then you could use this:
http://granadacoder.wordpress.com/2007/11/29/membershipprovider-helper-to-transfer-data/
It will "create tsql code" so you can move all your data into your blank database.
I had similar error, 'simple' solutions like closing the project and re-opening, rebuilding, resolves the error. that's if you're sure you did everything correctly

How to specify Entity Framework Code First connection string in external Enterprise Library config file

I am creating a WPF application, having classical architecture: UI layer, business logic layer and infrastructure layer. I decided to split configuration in two files: app.config file, containing common app configuration, and dll.config, containing connection string to use in DbContext for domain model storage. The second .config file should be sticked to business logic DLL, while first file sticked to corresponding UI executable (there will be one more UI with it's own configuration).
app.config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="enterpriseLibrary.ConfigurationSource" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ConfigurationSourceSection, Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
</configSections>
<enterpriseLibrary.ConfigurationSource selectedSource="Winter DAL Configuration">
<sources>
<add name="Winter DAL Configuration" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.FileConfigurationSource, Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
filePath="dll.config" />
</sources>
</enterpriseLibrary.ConfigurationSource>
</configuration>
dll.config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
</configSections>
<dataConfiguration defaultDatabase="WinterContext" />
<connectionStrings>
<add name="WinterContext" connectionString="Data Source=Winter.sdf"
providerName="System.Data.SqlServerCe.4.0" />
</connectionStrings>
</configuration>
Now, when I'm starting the app, DbContext throws an exception saying it cannot find connection string with specified name. If I move connection string from dll.config to app.config - all working fine.
Maybe I must explicitly load configuration somehow? Or?.. What do I do wrong?
Thx in advance!
Based on the config files supplied, Entity Framework went looking in app.config of root in start project and didnt find the EF content. Especially the Connection string.
When you first used UF it would have created such entries, perhaps in the model project.
IM using EF5.0 so careful with cut and paste on Entity Section .
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="v11.0" />
</parameters>
</defaultConnectionFactory>
</entityFramework>
<connectionStrings>
<add name="CONTEXT_NAME_HERE"
providerName="System.Data.SqlClient"
connectionString="Data Source=YOURDB_SERVER;Initial Catalog=YOUR_DBNAME;Integrated Security=True;MultipleActiveResultSets=True;App=EntityFramework" />
</connectionStrings>
</configuration>
I hope I understood your question, you want to structure your app.configs as a hierarchy, which is valid, in web applications that is very common, the easiest way to let .net help you with the merging is specifiying the regions of app.config in all those configurations that need to be bounded, and in the inner configurations you can override the values until you have the last one, for example:
ROOT APPCONFIG
<configuration>
<commonCollection>
<add key="first" value="1" />
<add key="second" value="2" />
<add key="third" value="3" />
</commonCollection>
</configuration>
INNER APPCONFIG
<configuration>
<commonCollection>
<remove key="first" />
<add key="first" value="10" />
</commonCollection>
</configuration>
Results:
ROOT APPCONFIG
first : 1
second: 2
third: 3
INNER APPCONFIG
first: 10
second: 2
third: 3
EDIT
for your EF context, to set the connection string in the constructor :
public MyContextDB() :base("name=DefaultConnection")
{
//other initializers
}
hope it helps,

edit key->value in .exe.config in SmartClient

I'll start here: I know nothing about SmartClient, .Net, DotNetNuke, etc etc. This is a "see if alison can help" project for a client's app/ site developed 6 years ago by a company that won't help. I'm just a front-end developer- I've googled all I can. If I don't understand the advice given here, I'm passing on assisting the client. Just thought I would give it a whirl. Here goes:
We simply need to change a key -> value in the configuration of their desktop app which connects to a web service (ASEPublisher). I have FTP and SQL Server access, but that's it.
The desktop app folder contains the following files:
DataPublisher.exe
DataPublisher.exe.config
DataPublisher.pdb
OleDBDataAccess.dll
OleDbDataAccess.pdb
Their website contains a folder called "smartclient" that contains the same files.
I just need to change all of the urls in the code below and have the application update to use the new urls. Obviously just changing this file on the desktop and restarting the app didn't do it. So, here I am. I hope this isn't too vague. If you need more info, I can try to provide it.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="DataPublisher.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<appSettings>
<add key="DefaultFilePath" value="I:\Staff\fakefolder\database\SA Data.mdb" />
<add key="DefaultASEFilePath" value="I:\Staff\fakefolder\database\SA Data.mdb" />
<add key="CNN" value="Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=" />
<add key="WebSvcUrl" value="http://www.fakedomain.org/admin/ClassPublisher.asmx" />
<add key="ASEWebSvcUrl" value="http://www.fakedomain.org/admin/ASEWebService.asmx" />
</appSettings>
<applicationSettings>
<DataPublisher.Properties.Settings>
<setting name="DataPublisher_ClassPublisherWS_ClassPublisher"
serializeAs="String">
<value>http://www.fakedomain.org/admin/ClassPublisher.asmx</value>
</setting>
<setting name="DataPublisher_ASEPublisherWS_ASEWebService" serializeAs="String">
<value>http://www.fakedomain.org/admin/ASEWebService.asmx</value>
</setting>
</DataPublisher.Properties.Settings>
</applicationSettings>
</configuration>

Resources