Link to home
Start Free TrialLog in
Avatar of GCCTECHIE
GCCTECHIE

asked on

Copying Web Application containing ASPNETDB into another machine

Hi,
I have an existing application residing on the live server.

I'd like to copy the whole folder into my machine so i can do some enhancement without touching the live environment.  The application is using ASPNETDB for logins and roles, which resides in the AppData folder.

When i copy the whole folder into my local machine and try to open the ASP.net web management tool, it gives me an error saying it could not connect to the provider db.

Is there a security setting on the folder i need to set or something?

Please help.  Thanks!
Avatar of Chinmay Patel
Chinmay Patel
Flag of India image

Hi GCCTECHIE,

What are the settings you have in your web.config?
I think it might be pointing to the path when the DB was on your live server.
Regards,
Chinmay
Avatar of GCCTECHIE
GCCTECHIE

ASKER

Hi Chinmay,

Where can i find the settings in web.config?

thanks
Check the connection string, in the web.config. If the connectionstring on the live server is different from your local settings make the appropriate changes.
In your web.config look for : SqlMembershipProvider
and also check :
<connectionStrings>

</connectionStrings>
section. The connection string should point to your local database.
Hi Chinmay,
I searched in both the local copy and the live copy of web.config, i could not find SqlMembershipProvider.

The live web app is running fine.

what do i do next?

thanks
Alright. Did you check out connectionstrings section? Also look out for AspNetSqlMembershipProvider
and if still you don't find anything than is is possible for you to paste your web.config here?
Hi,

Tried looking for AspNetSqlMembershipProvider also did not find in both local and live copies of web.config.

I am attaching the code below.

Thank you.
<?xml version="1.0" encoding="UTF-8"?>
<!-- 
    Note: As an alternative to hand editing this file you can use the 
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in 
    machine.config.comments usually located in 
    \Windows\Microsoft.Net\Framework\v2.x\Config 
-->
<configuration>
	<configSections>
		<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
			<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
				<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
				<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
					<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />
					<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
					<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
					<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
				</sectionGroup>
			</sectionGroup>
		</sectionGroup>
	</configSections>
	<appSettings>
  <add key="ChartImageHandler" value="storage=file;timeout=20;" />
 </appSettings>
	<connectionStrings>
		<add name="GCCSERVICEREPORTConnectionString" connectionString="Data Source=ERP\SQLEXPRESS;Initial Catalog=GCCSERVICEREPORT;Persist Security Info=True;User ID=xx;Password=xx" providerName="System.Data.SqlClient" />
		<add name="ConnectionStringGCCServiceReportASPNETDB" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" />
		<add name="HRMSConnectionString" connectionString="Data Source=IBM-HRIS;Initial Catalog=MFDM;User ID=xx;Password=xx" providerName="System.Data.SqlClient" />
		<add name="WebCatalogueConnectionString" connectionString="Data Source=ERP\SQLEXPRESS;Initial Catalog=WebCatalogue;Persist Security Info=True;User ID=sa;Password=sa" providerName="System.Data.SqlClient" />
	</connectionStrings>
	<system.web>
		<!-- 
            Set compilation debug="true" to insert debugging 
            symbols into the compiled page. Because this 
            affects performance, set this value to true only 
            during development.

            Visual Basic options:
            Set strict="true" to disallow all data type conversions 
            where data loss can occur. 
            Set explicit="true" to force declaration of all variables.
        -->
		<roleManager enabled="true" />
		<compilation debug="true" strict="false" explicit="true">
			<assemblies>
				<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
				<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
				<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
				<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
				<add assembly="System.Web.Extensions.Design, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
				<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
				<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
				<add assembly="eWorld.UI, Version=2.0.6.2393, Culture=neutral, PublicKeyToken=24D65337282035F2" />
				<add assembly="System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /></assemblies>
		</compilation>
		<pages>
   <namespaces>
    <clear />
    <add namespace="System" />
    <add namespace="System.Collections" />
    <add namespace="System.Collections.Generic" />
    <add namespace="System.Collections.Specialized" />
    <add namespace="System.Configuration" />
    <add namespace="System.Text" />
    <add namespace="System.Text.RegularExpressions" />
    <add namespace="System.Linq" />
    <add namespace="System.Xml.Linq" />
    <add namespace="System.Web" />
    <add namespace="System.Web.Caching" />
    <add namespace="System.Web.SessionState" />
    <add namespace="System.Web.Security" />
    <add namespace="System.Web.Profile" />
    <add namespace="System.Web.UI" />
    <add namespace="System.Web.UI.WebControls" />
    <add namespace="System.Web.UI.WebControls.WebParts" />
    <add namespace="System.Web.UI.HtmlControls" />
   </namespaces>
   <controls>
    <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <add tagPrefix="asp" namespace="System.Web.UI.DataVisualization.Charting" assembly="System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
   </controls>
  </pages>
		<!--
            The <authentication> section enables configuration 
            of the security authentication mode used by 
            ASP.NET to identify an incoming user. 
        -->
		<authentication mode="Forms" />
		<!--
            The <customErrors> section enables configuration 
            of what to do if/when an unhandled error occurs 
            during the execution of a request. Specifically, 
            it enables developers to configure html error pages 
            to be displayed in place of a error stack trace.

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
        -->
		<httpHandlers>
   <remove path="*.asmx" verb="*" />
   <add path="*.asmx" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />
   <add path="*_AppService.axd" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />
   <add path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />
   <add path="ChartImg.axd" verb="GET,HEAD" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false" />
  </httpHandlers>
		<httpModules>
			<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
		</httpModules>
	</system.web>
	<system.codedom>
		<compilers>
			<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
				<providerOption name="CompilerVersion" value="v3.5" />
				<providerOption name="WarnAsError" value="false" />
			</compiler>
			<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
				<providerOption name="CompilerVersion" value="v3.5" />
				<providerOption name="OptionInfer" value="true" />
				<providerOption name="WarnAsError" value="false" />
			</compiler>
		</compilers>
	</system.codedom>
	<!-- 
        The system.webServer section is required for running ASP.NET AJAX under Internet
        Information Services 7.0.  It is not necessary for previous version of IIS.
    -->
	<system.webServer>
  <validation validateIntegratedModeConfiguration="false" />
  <modules>
   <remove name="ScriptModule" />
   <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
  </modules>
  <handlers>
   <remove name="WebServiceHandlerFactory-Integrated" />
   <remove name="ScriptHandlerFactory" />
   <remove name="ScriptHandlerFactoryAppServices" />
   <remove name="ScriptResource" />
   <remove name="ChartImageHandler" />
   <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
   <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
   <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
   <add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
  </handlers>
 </system.webServer>
	<runtime>
		<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
			<dependentAssembly>
				<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" />
				<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
			</dependentAssembly>
			<dependentAssembly>
				<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35" />
				<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
			</dependentAssembly>
		</assemblyBinding>
	</runtime>
	<system.net>
		<mailSettings>
			<smtp from="xxx@xx.com.my">
    <network defaultCredentials="false" host="xx.xx.com.my" password="" userName="" />
   </smtp>
		</mailSettings>
	</system.net>
</configuration>

Open in new window

;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF; for ConnectionStringGCCServiceReportASPNETDB in connectionstrings section does it point to your database in your local web.config?
I tried and and it gave me an error because it could not access the ASPNETDB inside the AppData folder. That particular connection string is only used to refer to users' email address in one of the pages.

The error i keep getting previously is:
Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.
Do you have an instance of SQL SERVER on your dev machine?
The setup on line 29 - ".\SQLEXPRESS" references a local instance named SQLEXPRESS.
hi robasta,

Yes i do, and the local instance name is also called SQLEXPRESS. Will it be a problem if the live server is running SQL Express 2005 and my machine is on SQL Express 2008?

Solution:  Modify the SQL Server (SQLExpress) service to use your local or system account and restart the service.  This worked for me first time.  I'm not sure if this will cause any problems in the future but hey, at least I can now create a database!!

taken from here: http://social.msdn.microsoft.com/Forums/en-US/sqldatabaseengine/thread/f5eb164d-9774-4864-ae05-cac99740949b
hi,

thanks for all your suggestions. i didn't get it to work on my machine. i suspect it's because of the different sql express versions, 2005 and 2008.

i copied the application into another development machine that is running sql express 2005, the application ran fine.

What i'll do is uninstall sql server express 2008 on my pc and reinstall with 2005.
ASKER CERTIFIED SOLUTION
Avatar of GCCTECHIE
GCCTECHIE

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial