YAFLogo

phaedoHD
  • phaedoHD
  • 68% (Friendly)
  • YAF Forumling Topic Starter
16 years ago
Hi,

I have a couple questions. I have successfully installed 1.9.3 as a stand alone forum. Now I want to integrate it with my existing site.

My existing site is using .net 3.5, so I re-built the forum accordingly and put it in a sub folder and copied the web.config stuff and all that appropriately, so after i get rid of a weird .net error i'm getting it should work (throwing an error because it's saying the way I compiled the actual site does not allow me to make the changes i made to the web.config to add yaf, or at least that seems to be what the error is saying).

But anyways, my question is how do I integrate it with my existing membership database (just uses the "standard" asp.net membership provider)?

I'm assuming one thing I could do is just copy all the existing users / data over to the yaf equivalents which appear to have just built on the "standard" asp.net membership provider. If I were to do it that way once I then got rid of my aspnet_Membership tables would I then need to change all my code to explicitly use the yaf provider or would my old code still work?

For instance where i have something like MembershipUser mu = Membership.GetUser("someuser");, would that still work, by just using the yaf membership provider, or would I have to re-write that to explicitly use the YAF membership provider?

If i do have to re-write it, is there any easier way, such as just changing the web.config or something?

So I guess i'm just confused on how to have the forum use my existing membership database.

Sponsor
billyboy
16 years ago
See this post newbie role post 

I am starting to work through a similar idea using a .net 2.0 site. I have a good sized user base with already defined mebership and roles using the standard prodivers. I'll let you know how it progresses and what I work out.

As to most of your questions the purpose of providers is to provide a standard interface, in otherwords the functions should work the same regardless of which provider you use. additionally yaf should manage itself just fine if you use your own custom providers, the standard providers, or the yaf ones. you'll need to map the roles to yaf roles and away you go, theoretically - that's why this is beta and not release.

Judging from the response I think the old 1.9.1x should be scrapped and everyone move on to 1.9.3, but that's just my 2 sense.:?

wesclyburn
16 years ago
The Yaf membership providers are only for backwards compatibility, where a pre-1.9.3 site wants to use the membership system of 2.0, but can't migrate all those existing users from the yaf tables. So, the yaf providers simply get their data from the existing tables.

You can completely ignore the yaf providers for a site that's already using a built-in membership provider and already has its own user store. Yaf just uses the API, and doesn't care what provider is actually doing the work. It creates user records in its own tables when needed. The only required change you have to make is to tell your profile provider it inherits from YafProfileprovider.

<!-- Customized to specify the database the application to use (rather than the default ASPNETDB.mdf) -->
<profile defaultProvider="CustomizedProfileProvider" enabled="true" inherits="YAF.Classes.Utils.YafUserProfile">
  <providers>
    <add name="CustomizedProfileProvider"
         connectionStringName="siteSqlServer"
         applicationName="/"
         type="System.Web.Profile.SqlProfileProvider" />
  </providers>
  <properties>
      <add name="Theme" allowAnonymous="false" defaultValue="Blue"/>
  </properties>
</profile>

Here, I'm still using the normal SqlProfileProvider, and even have my own profile properties that have nothing to do with YAF. Meanwhile, YAF can use the provider because of the inheritance.

A caveat is that if you delete users through a mechanism external to yaf, like with the site administration tool, then the user won't be deleted in the yaf tables. If you use yaf's interface to manage your users, then everything is groovy.

As for the rest, just make sure your /bin contains the YAF assemblies; copy the App_Code/YAF directory to your App_Code; and edit your web.config with the stuff yaf needs.

If your site is VB.NET, you need to make asp.net compile the App_Code/YAF directory into a separate assembly. Heck, you might want to do this even if you'er not using VB.NET


		<compilation debug="true" strict="false" explicit="true">
			<codeSubDirectories>
				<add directoryName="YAF"/>
			</codeSubDirectories>
			<assemblies>
etc...
billyboy
16 years ago
Thanks, that's very helpful.
billyboy
16 years ago
Just an update. I had a successful integration with a 2.0 site. So far so good. I ended up with the following basic steps:

1. copy YAF as a subfolder under my site

2. add the root key to the app.config (actually intgrated the app config with my own)

3. copy most of the web.config over to my own

4. added the yaf profile provider replacing mine - didn't really use it anyway.

5. added a yaf subdirectory to app_code and since my ui is vb.net added the setting to the web.config (see post above)

6. created a seperate database and pointed "yafnet" to it (the profile, membership, and roles point to mine)

7. ran install

8. works like a charm

did I miss something?

oh, yeah -

9. went in to admin and mapped the roles, most had already been done for me so it wa sjust a matter of checking up on what it did.

now I am just working on getting it to look nice under my ugly site.

phaedoHD
  • phaedoHD
  • 68% (Friendly)
  • YAF Forumling Topic Starter
16 years ago
thanks! I successfully got it integrated with my membership database on a "stand alone" test forum i put up. now i just need to figure out how to get it integrated with my .net 3.5 site. I have successfully integrated it with a asp.net 2.0 site, but am still getting weird errors when I use the version of 1.9.3 that I compiled to asp.net 3.5.

None of the errors are due to either my code or yaf. It's mainly due to weirdness in putting all the dll's together and merging the web.config's and what not. I'll figure it out eventually and post it in case anyone is interested in integrating yaf with an asp.net 3.5 website.

Jaben
  • Jaben
  • 100% (Exalted)
  • YAF Developer
16 years ago
Yes, any manual or tutorial would be very helpful, phaedoHD.
phaedoHD
  • phaedoHD
  • 68% (Friendly)
  • YAF Forumling Topic Starter
16 years ago
ok, so i am getting a weird error when merging the two projects and i can't figure it out. I've searched on google and there isn't much out there on this error. It is as follows: "System.Web.HttpException: This application was precompiled with personalization turned off, but it appears to have been turned on after the precompilation, which is not supported."

Here is my web.config in case there is something in there i didn't merge correctly.

connectionStringName="LocalSqlServer"

applicationName="/"

type="System.Web.Profile.SqlProfileProvider" />

type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">

type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">

continienzo
16 years ago
We tried to use the Yaf forum (ver. 1.9.3) in an exiting site, but we didn't succeed!

We also tried to make things more simple starting from a new simple Trial site with the default web.config as created by Visual Studio.

We try to follow the instruction of this post and of an other one related to a previous YAF version (http://wiki.yetanotherforum.net/embeddedYaf.ashx#step_by_step ) but we have still an error ("Unknown server tag YAF:Forum") even though we put in the root web.config all the configurations that there where in the YAF project.

We tried also to put a default.aspx page in the root (specifying <%Register TagPrefix="YAF" Namespace="YAF" assembly="App_Code" %> and putting all the dll that where in the /Yaf/bin directory in the /bin of the site ....) with no success.

Where is our mistake???

Just in case it could help, I put in the following the root web.config as it is after copying the sections previously included in the yaf web.config.

Waiting for some suggestions

Enzo

ROOT web.config

<?xml version="1.0"?>
<configuration>

	<configSections>
			<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
			<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
				<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false"/>
				<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
					<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false"/>
					<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false"/>
					<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false"/>
				</sectionGroup>
			</sectionGroup>
		</sectionGroup>
		<section name="rewriter" type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter" requirePermission="false"/>

		<section name="yafnet" type="yaf.SectionHandler,yaf"/>
	</configSections>
	<yafnet configSource="yafnet.config"/>
	<connectionStrings configSource="db.config"/>
<rewriter configSource="URLRewriter.config" />


<system.net>
		<mailSettings>
			<smtp configSource="mail.config"/>
		</mailSettings>
	</system.net>
	<appSettings/>

	<system.web>
		
		
		<authentication mode="Forms">
			<forms name=".YAFNET_Authentication" protection="All" timeout="43200" cookieless="UseCookies"/>
		</authentication>
		<trace enabled="false" />
		<xhtmlConformance mode="Transitional" />
		
		<customErrors defaultRedirect="Error.aspx" mode="Off"/>
			<globalization requestEncoding="utf-8" responseEncoding="utf-8"/>
			
				<compilation defaultLanguage="c#" debug="false">
			<assemblies>
				<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
				<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
				<add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
			</assemblies>
		</compilation>

		<httpHandlers>
			<remove verb="*" path="*.asmx"/>
			<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
			<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
			<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
		</httpHandlers>

		<httpModules>
			<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
			<add name="YafInitModule" type="YAF.Classes.Base.YafInitModule, YAF.Classes.Base"/>
			<add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule,Intelligencia.UrlRewriter" />
		</httpModules>

		<pages validateRequest="false" smartNavigation="false">
			<controls>
				<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
				<add tagPrefix="ajaxToolkit" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"/>

				<!-- Default: use non-dynamic (compiled classes) in YAF -->
				<add tagPrefix="YAF" namespace="YAF.Classes.UI" assembly="YAF.Classes.UI" />
				<add tagPrefix="YAF" namespace="YAF.Classes.Utils" assembly="YAF.Classes.Utils" />
				<add tagPrefix="YAF" namespace="YAF.Classes.Data" assembly="YAF.Classes.Data" />
				<add tagPrefix="YAF" namespace="YAF.Controls" assembly="YAF.Controls" />
				<add tagPrefix="YAF" namespace="YAF.Controls.Statistics" assembly="YAF.Controls" />

				<!-- Optional: use dynamic classes in YAF by moving all the YAF.x directories (YAF.Classes.*, YAF.Providers)
						into the App_Code\YAF directory. Delete the associated .dll files from the \bin directory. Comment out the above 
						"non-dynamic" namespaces above and enable these: 
				-->

				<!--add tagPrefix="YAF" namespace="YAF.Classes.UI" />
				<add tagPrefix="YAF" namespace="YAF.Classes.Utils" />
				<add tagPrefix="YAF" namespace="YAF.Classes.Data" />
				<add tagPrefix="YAF" namespace="YAF.Controls" />
				<add tagPrefix="YAF" namespace="YAF.Controls.Statistics" /-->

				<add tagPrefix="YAF" namespace="YAF.Classes" />
				<add tagPrefix="YAF" namespace="YAF"/>
				<add tagPrefix="editor" namespace="YAF.Editor"/>

			</controls>
			<namespaces>
				<add namespace="YAF" />
				<add namespace="YAF.Classes.UI" />
				<add namespace="YAF.Classes.Utils" />
				<add namespace="YAF.Controls" />
				<add namespace="YAF.Classes.Data" />
			</namespaces>
		</pages>

		<roleManager enabled="true" defaultProvider="YafRoleProvider">
			<providers>
				<clear/>
					<add connectionStringName="yafnet" applicationName="YetAnotherForum" name="YafRoleProvider" type="YAF.Providers.Roles.YafRoleProvider"/>
			</providers>
		</roleManager>
		<membership defaultProvider="YafMembershipProvider" hashAlgorithmType="SHA1">
			<providers>
				<clear/>
				<add connectionStringName="yafnet" applicationName="YetAnotherForum" name="YafMembershipProvider" requiresUniqueEmail="true" useSalt="true" type="YAF.Providers.Membership.YafMembershipProvider"/>
			</providers>
		</membership>
		<profile enabled="true" defaultProvider="YafProfileProvider" inherits="YAF.Classes.Utils.YafUserProfile">
			<providers>
				<clear/>
        		<add connectionStringName="yafnet" applicationName="YetAnotherForum" name="YafProfileProvider" type="YAF.Providers.Profile.YafProfileProvider"/>
			</providers>
		</profile>
	</system.web>
	<system.web.extensions>
		<scripting>
			<webServices>
				<!-- Uncomment this line to customize maxJsonLength and add a custom converter -->
				<!--
         <jsonSerialization maxJsonLength="500">
            <converters>
               <add name="ConvertMe" type="Acme.SubAcme.ConvertMeTypeConverter"/>
            </converters>
         </jsonSerialization>
         -->
				<!-- Uncomment this line to enable the authentication service. Include requireSSL="true" if appropriate. -->
				<!--
         <authenticationService enabled="true" requireSSL = "true|false"/>
         -->
				<!-- Uncomment these lines to enable the profile service. To allow profile properties to be retrieved 
                 and modified in ASP.NET AJAX applications, you need to add each property name to the readAccessProperties and
                 writeAccessProperties attributes. -->
				<!--
         <profileService enabled="true"
                                 readAccessProperties="propertyname1,propertyname2"
                                 writeAccessProperties="propertyname1,propertyname2" />
         -->
			</webServices>
			<!-- 
      <scriptResourceHandler enableCompression="true" enableCaching="true" />
      -->
		</scripting>
	</system.web.extensions>

	<system.webServer>
		<validation validateIntegratedModeConfiguration="false"/>
		<modules>
			<!--<add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>-->
			<add name="YafInitModule" type="YAF.Classes.Base.YafInitModule, YAF.Classes.Base"/>
			<add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule,Intelligencia.UrlRewriter" preCondition="managedHandler" />
		</modules>
		<handlers>
			<remove name="WebServiceHandlerFactory-Integrated"/>
			<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
			<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.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=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
		</handlers>
	</system.webServer>
</configuration>
billyboy
16 years ago
phaedoHD you appear to have left out your memberhsip provider. add in something like:

underlines need to be replaced with your stuff

billyboy
16 years ago

Enzo,

did you add the

to the application config?

infinitep
16 years ago
I too have sucessfully installed 1.9.3 with asp.net 3.5 integrated with an exsiting site. I had to recompile the AJAX DLL but other than that all answers found here and google. I haven't done much testing yet but it is working all ok, so it is possible for those of you who are getting stuck. See posts under my username for further info.


[url=http://craigwhiteman.blogspot.com.au/]Capt. ArkCAW HonourNRespect- Need an Ark? I Noah Guy![url]

phaedoHD
  • phaedoHD
  • 68% (Friendly)
  • YAF Forumling Topic Starter
16 years ago

I too have sucessfully installed 1.9.3 with asp.net 3.5 integrated with an exsiting site. I had to recompile the AJAX DLL but other than that all answers found here and google. I haven't done much testing yet but it is working all ok, so it is possible for those of you who are getting stuck. See posts under my username for further info.

infinitep wrote:

I don't suppose you'd be willing to post a little step by step guide on the wiki or something for this? I've got it almost there *I think*, but i'm still getting some weird errors that i can't seem to figure out.

wesclyburn
16 years ago
What errors are you getting?

I opened the solution in VS2008 and let it convert the projects.

Then I removed the refereces to the AjaxControlToolkit, and replaced it with a reference to the 3.5 version of the toolkit.

Then I replaced the refereces to the 2.0 verion of System.Web.Extension with the 3.5 versions.

After rebuilding, it worked fine.

There may be something about your web.config causing the problem. I've used web.configs generated by VS and then added YAF's settings, rather than use the configs distributed with YAF. You might also just double-check that your projects are set to target 3.5 .

continienzo
16 years ago
[quote=billyboy]

Enzo,

did you add the

to the application config?

Hi billyboy,

thanks for your reply.

http://wiki.yetanotherforum.net/embeddedYaf.ashx#step_by_step , but we have the error "Unknown server tag YAF:Forum" with the web.config I include in my previous post.

Is there any "step by step" instructions for the last YAF release?

The instructions of that link (http://wiki.yetanotherforum.net/embeddedYaf.ashx#step_by_step) where for a previous version of yaf and they say:

6. Copy or move ~/yaf/yaf.dll to ~/bin/yaf.dll

Now in the last Yaf version this dll doesn't exist anymore but I thought that moving all the yaf /bin dlls in the root /bin would be sufficient (together with putting in the main web.config the following:

 <add tagPrefix="YAF" namespace="YAF.Classes.UI" assembly="YAF.Classes.UI" />
                <add tagPrefix="YAF" namespace="YAF.Classes.Utils" assembly="YAF.Classes.Utils" />
                <add tagPrefix="YAF" namespace="YAF.Classes.Data" assembly="YAF.Classes.Data" />
                <add tagPrefix="YAF" namespace="YAF.Controls" assembly="YAF.Controls" />
                <add tagPrefix="YAF" namespace="YAF.Controls.Statistics" assembly="YAF.Controls" />

                <!-- Optional: use dynamic classes in YAF by moving all the YAF.x directories (YAF.Classes.*, YAF.Providers)
                        into the App_Code\YAF directory. Delete the associated .dll files from the \bin directory. Comment out the above 
                        "non-dynamic" namespaces above and enable these: 
                -->

                <!--add tagPrefix="YAF" namespace="YAF.Classes.UI" />
                <add tagPrefix="YAF" namespace="YAF.Classes.Utils" />
                <add tagPrefix="YAF" namespace="YAF.Classes.Data" />
                <add tagPrefix="YAF" namespace="YAF.Controls" />
                <add tagPrefix="YAF" namespace="YAF.Controls.Statistics" /-->

                <add tagPrefix="YAF" namespace="YAF.Classes" />
                <add tagPrefix="YAF" namespace="YAF"/>
                <add tagPrefix="editor" namespace="YAF.Editor"/>

Waiting for some suggestions and hoping in a "step by step" instructions for the last release of YAF for embedding it inside an existing asp.net website,

Enzo