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

Notification

Icon
Error

Source Version Build Errors
myuserid
#1 Posted : Sunday, 8 February 2009 9:38:04 AM(UTC)
Rank: Member

Joined: 3/02/2009(UTC)
Posts: 26
Location: Wisconsin

Well, I just tried to build and deploy the source code version of GSP and received 121 errors from the build which is probably why it doesn't work when trying to deploy it. I've gotten the pre-compiled version to work in my app but would like to go with some changes to the source if possible. Any suggestions on what might be wrong here? There are so many errors, I don't know where to start. Thank you.

a little bit later...


Just changed the opening <configuration> tag in the web.config file to read as follows...

<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

and the number of errors went down to 22...


The most curious error in I'm running into during all of this is the following seems to originate from the WPFMetadataExtractor.cs file at this line...

using System.Windows.Media.Imaging;

...a bit later

still haven't figured out the above error but managed to patch together a working installation using dlls from both the source files and the pre-compiled version. Seems to work ok so far...


...
Roger Martin
#2 Posted : Sunday, 8 February 2009 1:57:43 PM(UTC)
Roger Martin

Rank: Administration

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

Do you have .NET 3.0 or higher installed? If not, the WPF project isn't going to compile. In this case, just unload that project. It is optional - when the WPF dll is present, GSP uses new .NET 3.0 functionality to perform better EXIF metadata extraction.

Interesting about the xmlns attribute in web.config. I dug into this several months ago because I noticed some apps used it and some didn't. I discovered that the ASP.NET configuration tool adds this attribute, but it is widely considered to be an error and shouldn't be put there. New web app projects in VS 2008 do not have this attribute, and I do all my dev work without it. I can't explain how it's presence reduced compilation errors for you. I would bet a lunch on State St that once you get it working, you can delete the attribute and it will continue working.
Roger Martin
Creator and Lead Developer of Gallery Server Pro
myuserid
#3 Posted : Sunday, 8 February 2009 7:09:18 PM(UTC)
Rank: Member

Joined: 3/02/2009(UTC)
Posts: 26
Location: Wisconsin

Hey Roger, I might owe you a lunch but I'm not out of the woods yet (are we every truly out of the woods in Wisconsin?). Anyway, I can't get the installer to recognize the membership, roles, profile or data providers in the production environment even though they work fine on the test server. Do you have a script to set up the database (without setting up the membership, roles, profiles part of it). I think that's all I need to do at this point. The GSP installer is just not finding my providers in the config files but I can log into my application just fine. Who know maybe GSP will have more difficulties with the providers down the road but if I can get past the installer phase, at least I can debug it more effectively (I think). Thanks for your insight. Have a great morning.
Roger Martin
#4 Posted : Monday, 9 February 2009 1:38:45 AM(UTC)
Roger Martin

Rank: Administration

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

Just uncheck the "Script ASP.NET Membership' option during the web install. (This option appears when you choose the SQL Server option.)
Roger Martin
Creator and Lead Developer of Gallery Server Pro
myuserid
#5 Posted : Monday, 9 February 2009 2:33:25 AM(UTC)
Rank: Member

Joined: 3/02/2009(UTC)
Posts: 26
Location: Wisconsin

Unfortunately, the installer doesn't get to that point. I'm getting an error telling me that it can't find any providers including the data provider and the installer won't allow me to select either sqlserver or the lite version. Does the installer do anything besides set up the tables that I need at this point? I can just hand script the tables and stored procedures from my test server if I have to.

Here's the error I'm getting with the installer...

Error: Web.config or galleryserverpro.config is missing configuration information for both SQLite and SQL Server providers for Membership, Roles, Profile, and data. Edit these files so that the desired providers are available. If necessary, revert to the original web.config and galleryserverpro.config files in the Gallery Server Pro download. You may need to restart the IIS process for the changes to take effect.

Any suggestions? Like I said the configuration works fine on my test server.
Roger Martin
#6 Posted : Monday, 9 February 2009 3:04:01 AM(UTC)
Roger Martin

Rank: Administration

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

The installer does these things:

1. Execute the SQL script file gs\pages\installer\sql\InstallGalleryServerProSql2005.sql. This sets up the GS tables, stored procs, and one UDF. It doesn't do anything related to ASP.NET membership except for adding the database role 'gs_GalleryServerProRole' to the aspnet roles.

2. Execute stored proc 'gs_InitializeGalleryServerPro'. This sets up the administrator user and ensures
certain tables have default records.

3. Adds the runtime user specified during the install wizard to the database role 'gs_GalleryServerProRole'.

4. Updates the connection string and data providers in web.config.

5. Updates galleryserverpro.config so that the encryptionKey attribute has a new, randomly chosen string. Updates the dataProvider attribute to either 'SqlServerGalleryServerProProvider' or 'SQLiteGalleryServerProProvider'.

You can manually do any of these steps if you want. Or you can get the install wizard to run by adding the provider info to web.config. The install wizard expects those sections to be there so it can update the dataProvider and connectionString attributes.
Roger Martin
Creator and Lead Developer of Gallery Server Pro
myuserid
#7 Posted : Monday, 9 February 2009 3:26:15 AM(UTC)
Rank: Member

Joined: 3/02/2009(UTC)
Posts: 26
Location: Wisconsin

Hi Roger,

Here are the settings I'm using right now. Perhaps you can see something wrong with them that I don't.

GalleryServerPro.config

<providers>
<add applicationName="MyApp" connectionStringName="SystemFunctions"
name="SqlServerGalleryServerProProvider" type="GalleryServerPro.Data.SqlServer.SqlDataProvider" />
</providers>
</dataProvider>

Web.config

<membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="300">
<providers>
<clear/>
<add name="SqlProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="SystemFunctions" applicationName="MyApp" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" requiresUniqueEmail="true" passwordFormat="Hashed" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="0" passwordStrengthRegularExpression="^\S{7,14}$"/>
</providers>
</membership>

<roleManager enabled="true" cacheRolesInCookie="true" cookieProtection="Validation" defaultProvider="myRoleProvider">
<providers>
<clear/>
<add connectionStringName="SystemFunctions" name="myRoleProvider" type="System.Web.Security.SqlRoleProvider" applicationName="MyApp"/>
</providers>
</roleManager>

<profile defaultProvider="myProfileProvider">
<providers>
<clear/>
<add connectionStringName="SystemFunctions" type="System.Web.Profile.SqlProfileProvider" name="myProfileProvider" applicationName="MyApp"/>
</providers>
<properties>
...other properties here...
<add name="ShowMediaObjectMetadata" defaultValue="false" type="String" allowAnonymous="true" />
</properties>
</profile>

There is of course a connection string called SystemFunctions in the web config as well. I've also tried using the exact provider string from the GSP web config in the membership section as the security information is different but this had no effect. Is GSP not able to access my web.config because of permissions? Just a thought. I've added the necessary permission to the App_data, CSP config folder and mediaobjects folder as well.

I'm probably missing something simple but it's like the app can't find my web.config or the galleryserverpro.config files at all.

Question: Is the installer looking for providers with a specific name? Other than SqlServerGalleryServerProProvider
Roger Martin
#8 Posted : Monday, 9 February 2009 5:17:24 AM(UTC)
Roger Martin

Rank: Administration

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

The installer requires that the membership, roles, and profile have specific names. They are SqlMembershipProvider, SqlRoleProvider, and SqlProfileProvider. Update the names in your web.config and the installer will be happy.
Roger Martin
Creator and Lead Developer of Gallery Server Pro
myuserid
#9 Posted : Monday, 9 February 2009 7:07:08 AM(UTC)
Rank: Member

Joined: 3/02/2009(UTC)
Posts: 26
Location: Wisconsin

Ok, the installer is running now and gets through creating the tables and stored procedures before failing with the following message...

Error executing SQL: EXEC sp_addrolemember @rolename=N'gs_GalleryServerProRole', @membername=N'myUserName'

where myUserName is the same as the name used to create the initial connection to SQLServer (i.e. the data connection user Id)

In the SQL Server - Runtime section of the installer I used the same connection (and user) as previously specified (which is the only one for accessing this db -- provided by the hosting company for accessing the db) but this user is not a member in the asp_membership table so of course it isn't found.

I'm not sure what's happening here or why the installer is trying to add the connection user id to the roles table (or on the flip side, if I were to enter an asp_net membership user in the runtime screen, seems like I'm telling GSP to access the database under that user's account for all data connections). Is this correct? Should I just abandon the installer and proceed with manual installation from here or do I just need to put my own asp_net login credentials into the runtime screen? Sorry if this is a bit babbly. I was up most of the night performing a site wide update that involved about 100,000 lines of code. And Thank you as always.
Roger Martin
#10 Posted : Monday, 9 February 2009 8:10:41 AM(UTC)
Roger Martin

Rank: Administration

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

You are confusing database roles with ASP.NET membership roles. The error is occurring when the installer tries to add the SQL login account to a database role named gs_GalleryServerProRole. This is a *database* role - not a ASP.NET role - that is configured to have permission to execute the stored procedures in the database.

Is it possible that the SQL user is configured as the database owner? If so, you encountered a known bug in 2.2.3286. For some reason Microsoft treats any user configured as the database owner differently than other users. Specifically, if you try to add this user to a database role, you get the error "User or role 'XXX' does not exist in this database."

This will be fixed in the next release. For now, the workaround is to specify a new SQL login on the Configure RunTime account step of the installer. GSP will use the credentials from the first account to create and set up the second account. When the installer has finished, you can manually update web.config to refer to the original account and then delete the new SQL login from the database. Say that 5 times fast.

If your hoster does not allow that workaround to work, another option is to modify the source code to comment out the section that executes this SQL. Search for "EXEC sp_addrolemember" in the source code.

Having said all that, by the time this error occurred, the installer has already created all the tables and stored procs and initialized the data by running the stored proc gs_InitializeGalleryServerPro. The only thing left to do is to update web.config and galleryserverpro.config as described in my earlier post (provider names, connection string, and encryption key). You can just do this manually.
Roger Martin
Creator and Lead Developer of Gallery Server Pro
myuserid
#11 Posted : Monday, 9 February 2009 9:46:15 AM(UTC)
Rank: Member

Joined: 3/02/2009(UTC)
Posts: 26
Location: Wisconsin

That did it. I had to adjust some role permission to work with my login role and get rid of the default GSP connection string and everything now works fine. It does seem that in addition to setting up providers with the proper GSP name, the installer also needs the appropriately-names GSP connection string as well. Once the install was finished, I was able to delete this connection string and everything works with my original setup though I did leave the names of membership providers as set in the GSP setup (I'm pretty sure I could rename them now back to what they were and it would still work). Thanks Roger. I'll have to do a bit more playing around with the program now, take some time to get it registered and send you a donation. We should have that lunch some time too. I'm down in Green County so Mad City isn't too far away.
Roger Martin
#12 Posted : Monday, 9 February 2009 11:35:52 AM(UTC)
Roger Martin

Rank: Administration

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

Whew - glad you got it! You are right - you can rename the providers and connection string if you want. During runtime GSP assumes that the default membership, role and profile provider is the correct one to use. That is, just make sure the value specified in the defaultProvider attribute for membership, role and profile is the correct one. But its name can be whatever.

Maybe I'll run into you at a Madison .NET User Group meeting. I go every once in a while...
Roger Martin
Creator and Lead Developer of Gallery Server Pro
myuserid
#13 Posted : Saturday, 14 February 2009 3:12:59 PM(UTC)
Rank: Member

Joined: 3/02/2009(UTC)
Posts: 26
Location: Wisconsin

I've actually never been to a .net user group in Madison (or anywhere else for that matter). Do you have a URL where I could learn more about this? On another note, my other half has been road testing your app with her insatiable love of uploading photos and, with only a few glitches, has been having the time of her life. I do have one question about security which probably needs me to do some additional setup but I want to know what you recommend. It has to do with this bit from the web.config...

validateRequest="false" in the pages section.

Now that GSP is integrated with my app, this has an effect over all the pages in the app which is something I don't want. Is there a set of pages in GSP that I can set individually with this setting so it doesn't effect my entire application or do I need to nullify its effects on a page by page (or master page by master page) basis in my app? Could I just set this on the master page that's containing the gallery? What do you recommend in this situation?

Other than that, my beta-tester only really hit a snag when she tried to delete a hi-res image that wasn't there. Not sure why it wasn't there. I suggested she synchronize but she had already shut down so I'll wait until she tries it to see if that fixes the problem. I could do it myself but that how she learns ;-)

Anyway, thanks again for this really cool app. Oh, I've got another question. How practical do you think it would be to set this up with several hundred or even several thousand users, each with their own private album? I'm not really thinking seriously about this right now but who knows what the future holds. It seems a bit impractical to set up a role for each user but maybe there's a better way I'm not thinking about. There might be other issues I'm not aware of as well. Any thoughts?
Roger Martin
#14 Posted : Sunday, 15 February 2009 12:26:47 PM(UTC)
Roger Martin

Rank: Administration

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

You can set ValidateRequest at the page level, like this:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="Website._Default" ValidateRequest="false" %>


Then you don't need to do it in web.config.

GSP is easily capable of handling thousands of users. The next version will include a "user album" feature where you can assign any user as an owner of an album. This will be simpler than setting up a role for each user.
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.