Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

AD Integration with .Net 4.0
RogerG781
#1 Posted : Monday, 2 January 2012 8:26:57 AM(UTC)
Rank: Member

Joined: 31/05/2010(UTC)
Posts: 5
Location: Germany

Hi Roger,
i wish you a happy new year.

I have a problem with the AD Integration of the gallery.

Gallery Server Pro is installed on a Server 2008 R2 with IIS 7.5. The Database is running on SQL Server 2008. I've created a application for the application pool with an AD-User. The Application still running under .Net 4.0.30319.
Here a some lines from my web.config:

<membership defaultProvider="AspNetActiveDirectoryMembershipProvider">
<providers>
<clear />
<add name="AspNetActiveDirectoryMembershipProvider" type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="ADConnection" enableSearchMethods="true"/>
</providers>
</membership>

<connectionStrings>
<add name="ADConnection" connectionString="LDAP://192.168.81.32/OU=User,DC=domain,DC=de"/>
<clear />
<add name="SqlServerDbConnection" connectionString="server=SQLServer.domain.de\SQLServer;uid=;pwd=;Trusted_Connection=yes;database=db_name" />
</connectionStrings>

Is this the right version in the red section or must thie the same which the application pool is running?

After saving the new web.config, i restart the website. When i go to the website, i receive the following error:
Error: The type initializer for 'GalleryServerPro.Web.Pages.GalleryPage' threw an exception.

Error Summary

Url


http://www.perupagos.de/mediathek/default.aspx

Timestamp


02.01.2012 15:15:55

Exception Type


System.TypeInitializationException

Message


The type initializer for 'GalleryServerPro.Web.Pages.GalleryPage' threw an exception.

Source


GalleryServerPro.Web

Target Site


Void .ctor()

Stack Trace


at GalleryServerPro.Web.Pages.GalleryPage..ctor()
at GalleryServerPro.Web.Pages.album..ctor()
at ASP.gs_pages_album_ascx..ctor() in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\mediathek\ae8d22c0\e346a959\App_Web_wxisuo5f.5.cs:line 0
at __ASP.FastObjectFactory_app_web_wxisuo5f.Create_ASP_gs_pages_album_ascx() in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\mediathek\ae8d22c0\e346a959\App_Web_wxisuo5f.11.cs:line 0
at System.Web.UI.TemplateControl.LoadControl(IWebObjectFactory objectFactory, VirtualPath virtualPath, Type t, Object[] parameters)
at System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath)
at GalleryServerPro.Web.Gallery.LoadRequestedPage()
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Inner Ex Type


System.Configuration.ConfigurationErrorsException;
Inner ex #2: System.Configuration.Provider.ProviderException

Inner Ex Message


The connection name 'ADConnection' was not found in the applications configuration or the connection string is empty. (D:\Websites\perupagos1\mediathek\web.config line 59);
Inner ex #2: The connection name 'ADConnection' was not found in the applications configuration or the connection string is empty.

Inner Ex Source


System.Web;
Inner ex #2: System.Web

Inner Ex Target Site


System.Configuration.Provider.ProviderBase InstantiateProvider(System.Configuration.ProviderSettings, System.Type);
Inner ex #2: System.String GetConnectionString(System.String, Boolean)

Inner Ex Stack Trace


at System.Web.Configuration.ProvidersHelper.InstantiateProvider(ProviderSettings providerSettings, Type providerType)
at System.Web.Configuration.ProvidersHelper.InstantiateProviders(ProviderSettingsCollection configProviders, ProviderCollection providers, Type providerType)
at System.Web.Security.Membership.InitializeSettings(Boolean initializeGeneralSettings, RuntimeConfig appConfig, MembershipSection settings)
at System.Web.Security.Membership.Initialize()
at System.Web.Security.Membership.get_Provider()
at GalleryServerPro.Web.Controller.UserController.LoadUser(IUserAccount userToLoad)
at GalleryServerPro.Web.Controller.GalleryController.AddMembershipDataToGallerySettings()
at GalleryServerPro.Web.Controller.GalleryController.InitializeGspApplication() at System.Web.Configuration.ProvidersHelper.InstantiateProvider(ProviderSettings providerSettings, Type providerType)
at System.Web.Configuration.ProvidersHelper.InstantiateProviders(ProviderSettingsCollection configProviders, ProviderCollection providers, Type providerType)
at System.Web.Security.Membership.InitializeSettings(Boolean initializeGeneralSettings, RuntimeConfig appConfig, MembershipSection settings)
at System.Web.Security.Membership.Initialize()
at System.Web.Security.Membership.get_Provider()
at GalleryServerPro.Web.Controller.UserController.LoadUser(IUserAccount userToLoad)
at GalleryServerPro.Web.Controller.GalleryController.AddMembershipDataToGallerySettings()
at GalleryServerPro.Web.Controller.GalleryController.InitializeGspApplication();
Inner ex #2: at System.Web.Security.ActiveDirectoryMembershipProvider.GetConnectionString(String connectionStringName, Boolean appLevel)
at System.Web.Security.ActiveDirectoryMembershipProvider.Initialize(String name, NameValueCollection config)
at System.Web.Configuration.ProvidersHelper.InstantiateProvider(ProviderSettings providerSettings, Type providerType)

App Error ID


-2147483648

Gallery ID


1

HTTP User Agent


Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20100101 Firefox/8.0

Roger Martin
#2 Posted : Monday, 2 January 2012 11:06:20 AM(UTC)
Roger Martin

Rank: Administration

Joined: 3/08/2007(UTC)
Posts: 3,300
Location: Fort Atkinson, WI

Regarding the version number, yes, the version specified should match the .NET version of the app pool.

The key message in your error is this:

Quote:
The connection name 'ADConnection' was not found in the applications configuration or the connection string is empty


I see you have a connection string with that name defined, so I am not sure why it is giving you that error. I guess what I would do is get your version numbers synchronized and go from there.
Roger Martin
Creator and Lead Developer of Gallery Server Pro
RogerG781
#3 Posted : Tuesday, 3 January 2012 5:44:27 PM(UTC)
Rank: Member

Joined: 31/05/2010(UTC)
Posts: 5
Location: Germany

Hello Roger,
thanks for your quick response.

I have seen this error and hope, that this occurs with the wrong application version.

Now i have synchronized the version number and the error code has changed:

I paste only the Inner ex message:
Could not load file or assembly 'System.Web, Version=4.0.30319, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Das System kann die angegebene Datei nicht finden. (D:\Websites\perupagos1\mediathek\web.config line 59);
Inner ex #2: Could not load file or assembly 'System.Web, Version=4.0.30319, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Das System kann die angegebene Datei nicht finden.

When i change the version number back to 4.0.0.0, i received the same error:
The connection name 'ADConnection' was not found in the applications configuration or the connection string is empty. (D:\Websites\perupagos1\mediathek\web.config line 59);
Inner ex #2: The connection name 'ADConnection' was not found in the applications configuration or the connection string is empty.

But the connection name still exist.
Roger Martin
#4 Posted : Tuesday, 3 January 2012 10:18:57 PM(UTC)
Roger Martin

Rank: Administration

Joined: 3/08/2007(UTC)
Posts: 3,300
Location: Fort Atkinson, WI

That is strange. I have never seen the error about the connection string missing when it actually does exist. Since this is more of an AD/Membership question and not so much a GSP one, I suggest searching the internet for the symptoms/error message. There are probably others who tried to connect their ASP.NET apps to AD and had the same trouble as you. When you figure it out, let us know. Good luck.
Roger Martin
Creator and Lead Developer of Gallery Server Pro
Rss Feed  Atom Feed
Users browsing this topic
Guest
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.