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

Notification

Icon
Error

Integration issues with existing ASP.Net website
lhakesley
#1 Posted : Tuesday, 11 May 2010 3:50:53 AM(UTC)
Rank: Member

Joined: 1/04/2010(UTC)
Posts: 18

Hi Roger,

I am integrating GSP with a legacy .Net website and existing .Net membership database. I have gone through the steps in the administrator's guide (which btw is very well written!) through integration of the web.config files.

I have come up against the following sequence of errors, and am afraid of continuing too far along the line of changing the .xaml files in case there's something I don't know or am missing that will solve the issue. Please advise.

1. The first issue I hit after merging the web.configs and adding the project references to the GSP dll files was an error that the project required the following to be added as project references: WindowsBase, PresentationCore, and PresentationFramework, which I did.

2. Next, I received the following error for every .xaml file: "The tag 'Canvas' does not exist in the XML namespace 'http://schemas.microsoft.com/client/2007'. Line 2 Position 9. Googling this, I found several recommendations to change the above schema reference to 'http://schemas.microsoft.com/winfx/2006/xaml/presentation', which I did. This resolved this particular error.

3. After changing the schema reference, I got one of the following two errors in each of the .xaml files:
a. "All objects added to an IDictionary must have a Key attribute or some other type of key associated with them."
b. "The type 'VideoBrush' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built."

Any idea what is going on here? I'm really afraid to be modifying your files!!! Any help would be greatly appreciated!!

Thank you,

Lisa Hakesley
Roger Martin
#2 Posted : Tuesday, 11 May 2010 8:27:58 AM(UTC)
Roger Martin

Rank: Administration

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

Hmm, I am not sure what is happening. I don't know what is your root cause, but I observed a couple things.

1. You should not need a reference to WindowsBase, PresentationCore, and PresentationFramework. Did you inadvertently specify a reference to GalleryServerPro.Business.Wpf.dll? That dll should be included in your bin directory but should not have a reference to it in your project. GSP uses reflection to dynamically load it.

Perhaps Visual Studio incorrectly thinks you need a reference to it. You might have to trick VS by not including it in your project at all; just skip it for now to see what happens (it is an optional component that helps with better image metadata extraction). Once you get things working put a copy of it in your bin directory. If that works, then try automating the process of getting it in your bin directory.

2. I looked at my XAML files and I noticed that in the properties in Visual Studio it says MSBuild:Compile in the Custom Tool property. Not sure if you need that but you might want to make sure yours is similar.

Finally, you might try downloading the GSP source code and running it on your dev machine. It should work out of the box without any of the changes you did. Then you can compare your web project with the GSP one.
Roger Martin
Creator and Lead Developer of Gallery Server Pro
lhakesley
#3 Posted : Tuesday, 11 May 2010 10:06:04 AM(UTC)
Rank: Member

Joined: 1/04/2010(UTC)
Posts: 18

Thanks Roger -- I'm away from my dev box right now but I'll check tomorrow. The admin guide didn't specify which dlls to make reference to so I just added them all. :( Can you tell me offhand which ones specifically I should make references to? Thank you!!!!
Roger Martin
#4 Posted : Tuesday, 11 May 2010 12:03:45 PM(UTC)
Roger Martin

Rank: Administration

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

Depending on how you set up your integration, you may not need any references. When I integrated GSP into www.galleryserverpro.com for the demo, I didn't use any references at all to the GSP dll's. I also did not add any of the contents of the gs directory as project items. They were present in the directory but not added to Visual Studio. The page containing the demo gallery looks like this:

Code:
<%@ Page Title="" Language="C#" MasterPageFile="~/master/global.Master" AutoEventWireup="true" CodeBehind="demo.aspx.cs" Inherits="TIS.GSPWeb.demo" ValidateRequest="false" %>
<%@ MasterType VirtualPath="~/master/global.master" %>
<%@ Register TagPrefix="gsp" Namespace="GalleryServerPro.Web" Assembly="GalleryServerPro.Web" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cpHeader" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpSideBar" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <asp:ScriptManager ID="sm" runat="server" EnableScriptGlobalization="true" />
    <div id="content" style="padding:0 0 0 3px;">
        <gsp:Gallery ID="gallery1" runat="server" />
    </div>
</asp:Content>


Because the project doesn't have a reference to GalleryServerPro.Web.dll, there is a little squiggle under the <gsp:Gallery ... /> declaration that says "Unrecognized tag prefix or device filter 'gsp'", but when I run the page it still works. That's because ASP.NET eventually finds the dll in the bin directory even without the direct reference.

The reason I did it this way is to keep my www.galleryserverpro.com project small and quick to publish. If all the GSP files were part of the VS project, it would take forever to publish. When I *do* want to publish new gallery files (like when I release a new build), I copy them separately using FileZilla. This technique effectively keeps my www.galleryserverpro.com files separate from my Gallery Server Pro files.

This technique may not work for you, as you may want to keep it all in Visual Studio. In that case you will probably need references to all the dll's except for:

GalleryServerPro.Business.Wpf.dll
GalleryServerPro.Data.SQLite.dll (only needed if using SQLite)
GalleryServerPro.Data.SqlServer.dll (only needed if using SQL Server)

Hope this helps.
Roger Martin
Creator and Lead Developer of Gallery Server Pro
lhakesley
#5 Posted : Wednesday, 12 May 2010 9:10:40 AM(UTC)
Rank: Member

Joined: 1/04/2010(UTC)
Posts: 18

Thanks Roger -- I may have to go the route of not adding anything to Visual Studio. Here's what I have done so far:

1. Backed out all GSP-added references, and excluded from project all files in the "gs" directory. Removed references to WindowsBase, PresentationCore, PresentationFramework. Project builds.

2. Re-included all files/directories in "gs" except the .xaml files, builds fine.

3. Including any single .xaml file and building produces errors of the "you need WindowsBase, PresentationCore, and PresentationFramework" variety.

4. I checked the .xaml file properties and it has "MSBuild:Compile" as the Custom Tool property.

5. I downloaded the source and it builds, although with a large number of warnings :"Project file contains ToolsVersion="4.0", which is not supported by this version of MSBuild. Treating the project as if it had ToolsVersion="3.5." BTW, your project properties page and mine look different in terms of what tabs are there and what content is on the tabs. I can only guess this is either because they started life as different project types or more likely that mine is VB-based.

So now I will go forward with the tactic of just having the files there (but not included in the project) and copying the dlls to the bin directory, and see how that goes, then try integrating the use of the gallery control into a page. I will post my progress.

Thank you for your time!

Lisa
lhakesley
#6 Posted : Thursday, 13 May 2010 9:19:19 AM(UTC)
Rank: Member

Joined: 1/04/2010(UTC)
Posts: 18

Just to close out this issue, I was able to get the integration complete after removing all references and gs-directory files from the project.

All was in vain anyway, as I cannot integrate GSP to our website. We're using an absolutely ancient version of Community Server, which uses a very old version of Master Pages (predating that product's integration into Visual Studio). That old MP breaks whenever Server.Transfer is called, which unfortunately GSP calls. I tried using Response.Redirect in GSP instead, but use of HTTPContext Items then breaks. Community Server has been a thorn in my side for some time now. :(

I have switched to using a stand-alone GSP installation and an iframe, but that has its own issue. Bumping another thread for that.

Thanks,

Lisa

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.