I've made two small/test Silverlight apps with VS2010 (I am new to it), having same problem with both... When I run/debug it from within VS2010, the app runs and it connects to the database fine. But when I publish it to the IIS (on the same machine VS2010 is on), the app will run, but it will not connect to the database.
I'm using SQL Server authentication.
The machine Windows 7 Premium (i also have the same problem on a Windows 7 Pro machine) using IIS 7.5.7600.16385
I've had this problem on multiple machines (my colleagues have it too)... It's quite frustrating that we can't make our SLight apps work (connect to DB) from IIS, only when running from VS2010. Hopefully it's a simple change to "fix" it.
I've tried with the database being on the same machine as the IIS/VS2010, and being on a different one... in both cases, results are that it does work when run from VS2010, but not IIS.
I've tried what is mentioned here to no avail: http://www.codeproject.com/KB/silverlight/deploy-sl4-with-db.aspx
Otherwise, my IIS setup is mostly "out of the box".
My web.config file:
<?xml version="1.0"?>
<configuration>
<connectionStrings>
<add name="myvisionexpressEntities" connectionString="metadata=res://*/Models.ContactsDM.csdl|res://*/Models.ContactsDM.ssdl|res://*/Models.ContactsDM.msl;provider=System.Data.SqlClient;provider connection string="Data Source=MACHINE_NAME\sqlexpress;Initial Catalog=dev;User Id=myuser;Password=mypassword;Integrated Security=False;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />
</connectionStrings>
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"
multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<httpModules>
<add name="DomainServiceModule" type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</httpModules>
</system.web>
</configuration>