...connection name 'LocalSqlServer' was not found ...

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
15 years ago
Hello

Running version 1.11 on IIS7 i get this Parser error below. I have basically no expereince with this. Googling the error states something abour memebship assignements that need be added to the web.config file. i wouldn't even know where to put any addition to the web.config relating to membership requirement.

Parser Error Message: The connection name 'LocalSqlServer' was not found in the applications configuration or the connection string is empty.

Thanks for any help
15 years ago
Could you be more specific when this is occuring (after installation, been using it for a while then all of a suddenn, etc.)?

If you mean right after installation, you need to go to the folder that holds the source code, find the file web.config and open it with notepad. Then Search and Find the phrase "<ConnectionString" without the quotes. That line is what you're trying to replace with the connection string you got on step 3 during the installation of the website. So the one liner,

<ConnectionString something here... />

becomes a three liner:

<ConnectionString>
    The connection string you got in step 3 during the installation
</ConnectionString>

hope this helps.
15 years ago
It is  a new installation and I changed the connection string in the ConnectionStrings.config file. I didn't change anything in the web.config file. Initially I tried it on sql 2008 express with the same error. So I used SQL server 2008 db and got the same result. I read something about IIS having a default "LocalSqlServe" that i may have to override or clear via web.config. Below is the complete error:
Thanks

Server Error in '/' Application.
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: The connection name 'LocalSqlServer' was not found in the applications configuration or the connection string is empty.

Source Error:

Line 144:    <roleManager>
Line 145:      <providers>
Line 146:        <add name="AspNetSqlRoleProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
Line 147:        <add name="AspNetWindowsTokenRoleProvider" applicationName="/" type="System.Web.Security.WindowsTokenRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
Line 148:      </providers>


Source File: C:\Windows\Microsoft.NET\Framework\v2.0.50727\Config\machine.config    Line: 146

Version Information: Microsoft .NET Framework Version:2.0.50727.3074; ASP.NET Version:2.0.50727.3074
15 years ago
Not sure where the AspNetSqlRoleProvider comes to play, perhaps its in the installation section, can't see it in the site's web.config.

It may be time to restart from scratch since that's not a error you should be seeing. Get yourself a new ConnectionStrings.config file and a new Web.Config file. Delete your SQL database you installed it to if you can.

Then do the following steps.
1. Start your project, run the website, whatever it is you do to launch the site. (I took the published site and ran that locally)
2. Step 1, install new
3. Step 2, Choose your location, username, etc.
4. Step 3, it says to open (I think) Web.config and edit the ConnectionString. You can add that bold line in your browser screen to the ConnectionStrings.config or the Web.config. Seeing as that ConnectionStrings.config didn't work, I'd try Web.config this time.
5. Open Web.config in notepad, then replace the line:
<connectionStrings configSource="ConnectionStrings.config"/>
with:
<connectionStrings>
   THE BOLD two lines inside your browser
</connectionStrings>

This, in essense, makes ConnectionsStrings.config obsolete, but either way, it should work.
6. Save Web.Config
7. Click next, it should go to the next step.


I also use SQL 2008 and I worked it this way.

Hope this helps.
15 years ago
Please confirm that you have configured Virtual Directory as an application in IIS - or post details of your IIS/nopCommerce configuration.

There is indeed a default LocalSqlServer connection string but it should not cause any problems as it is not used/referenced by nopCommerce.
Thanks
Ben
15 years ago
Ok, the server is also using Plesk 9 as a control panel which may make a difference. All the files are in the httpdoc folder which is usually setup to run applications and other things like CMS have worked ok. Are there any special permissions required for folders?

Thanks
Jorg
15 years ago
ASP.net user must have write permissions to images directory but these shouldn't have any impact on what you are doing. It does look sound like your directory isn't configured as application root...
15 years ago
I set it up on another domain with the same error as a result.

When you Google
The connection name 'LocalSqlServer' was not found in the applications configuration
you get many results which I don't know what to do with but many of them seem to add something to the web.config but I am not sure which would pertain to me.
Maybe you can give me an idea from search results.

Jorg
15 years ago
There seems to be a connection string called 'LocalSqlServer' set up by
default behind the scenes.

By the way I have been using the "No Source" files for all this-hope that is ok.
I changed the connection string to
<connectionStrings>
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="server=208.67.....
and now I get the setup wizard which I don't want to use and I am also not sure what  would happen if I installed another cart and use this ="LocalSqlServer" setting instead of your "NopSqlConnection".
Sorry this is way over my head and I just don't want to change things like that without knowing how it will affect things in the long run.

thanks,
jorg
14 years ago
Howdy,


I ran into the same issues during install. The providers for roles can come from both machine and web.config, however web.config overrides machine.config. Unless you are using a role manager that you have placed into machine.config, add a <clear/> as the first item in the list of role providers to avoid these conflicts
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.