#1
All,

I am trying to compile 1.9.3 under a Web Application project.

I got the "bin" zip and added it to my existing asp.net project.

I am having compilation errors. So Iremoved the classes from App_Code and moved them into top level directory.

Even then the compilation errors happening. It is not able to see those classes.

Error 1 The type or namespace name 'Editor' does not exist in the namespace 'YAF' (are you missing an assembly reference?) C:\projects\test\testWeb\controls\EditUsersSignature.ascx.cs

Error 2 The type or namespace name 'Editor' could not be found (are you missing a using directive or an assembly reference?) C:\projects\test\testWeb\pages\pmessage.ascx.cs
Error 3 The type or namespace name 'Editor' does not exist in the namespace 'YAF' (are you missing an assembly reference?) C:\projects\test\testWeb\pages\postmessage.ascx.cs
Error 4 The type or namespace name 'Editor' does not exist in the namespace 'YAF' (are you missing an assembly reference?) C:\projects\test\testWeb\pages\posts.ascx.cs


Has anyone added this to WAP project type? I have no issues with 1.9.1.6 version.

Please help? anyone? TIA
Topic Starter
  • slickJoe
  • Rank: Member
  • Reputation:
    Friendly
    62.6%
  • Joined: 13/02/2008
  • Posts: 16
#2
I am having the same exact problem! I downloaded the source and added the projects to my solution. Then in my already existing Web Application, under my "Members" folder I created "Forum" and imported all the existing items from the "YetAnotherForum.NET" website project.

The problem is with the items in the App_Code directory. I tried adding the App_Code directory with its items to my Web Application and also I tried taking just the "YAF" folder out of App_Code and adding it to the root of my web app. Both of which throw these 4 errors.

Any suggestions? I'm stuck!
UserPostedImage 
www.bunkerhollow.com  | www.careercomputing.com 
When I post fp:mddubs in a topic, I'm leaving my footprint there so I can track it once I get into coding/supporting. (Yes I stole this off Mek πŸ™‚, who stole this off Ederon πŸ™‚ )
  • mddubs
  • Rank: YAF Developer
  • Reputation:
    Exalted
    100%
  • Medals:
    Medal of Honor Key: Given to pillars of the community who are key players in the YAF community and project.
  • Joined: 07/08/2008
  • Posts: 476
  • Was thanked: 3 time(s) in 1 post(s)
#3
Well, seems I'm not alone.. but still no solution in sight.

I've tried to integrate the forum with a completely new webforms and with a mvc application, got the same errors on both.
I'm pretty much desparate by now, any suggestions on how to fix this?


  • kovv
  • Rank: YAF Forumling
  • Reputation:
    Neutral
    51.8%
  • Joined: 08/10/2008
  • Posts: 3
#4
Can any of the pros weigh in on this?

My work around is to copy all the YAF files to the appropriate places within my project folder and then publish by doing "Copy Everything from Solution Folder". So it works, but I can't work with any of the YAF stuff within my solution in Visual Studio. I can't add YAF as a project to my solution without getting these errors, if I'm explaining it clearly.

I'd love to be able to add it as a project and work with everything within one solution, which sounds like what these guys are trying to do too. Are we doing something wrong?
UserPostedImage 
www.bunkerhollow.com  | www.careercomputing.com 
When I post fp:mddubs in a topic, I'm leaving my footprint there so I can track it once I get into coding/supporting. (Yes I stole this off Mek πŸ™‚, who stole this off Ederon πŸ™‚ )
  • mddubs
  • Rank: YAF Developer
  • Reputation:
    Exalted
    100%
  • Medals:
    Medal of Honor Key: Given to pillars of the community who are key players in the YAF community and project.
  • Joined: 07/08/2008
  • Posts: 476
  • Was thanked: 3 time(s) in 1 post(s)
#5
For some reason I cannot even get the WAP project to compile. I don't have tons of time to put into it today, unfortunately.
  • Jaben
  • Rank: YAF Developer
  • Reputation:
    Exalted
    100%
  • Medals:
    Medal of Honor Key: Given to pillars of the community who are key players in the YAF community and project.YAF.NET Supporter: Loves YAF.NET!YAF.NET Supporter: Supports our efforts. Thank you.Medal of Honor for the Support King: Given to a community member who tirelessly answers tons of support questions.
  • Joined: 09/10/2004
  • Posts: 2,544
  • Location: United States
  • Thanks: 142 times
  • Was thanked: 352 time(s) in 195 post(s)
#6
UPDATE:

Ok, I've got it compile..

This is what I have done:

.) Created a new WebApp Project and a Class Library Project, added the Files from the YAF Website Project to the Webapp (except the App_Code folder wich goes into the Class Library Project).
.) Added all needed references to the Library to get it compiled.
.) Updated all web.config entries referencing System.Web.Extensions (even the 3.5 config has references to 1.xx of the assemblies, so you will need to update no matter what config you use).<- That was causing the exception, it tried to load the 1.xx ajax assembly.. (I'm stupid i know πŸ˜›)
Just leave the entries and add:
    <runtime>
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <dependentAssembly>
          <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
          <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
        </dependentAssembly>
        <dependentAssembly>
          <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
          <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
        </dependentAssembly>
      </assemblyBinding>
    </runtime>
.. works like a charm πŸ™‚

.) Update the web.config control entries to use the assembly created by the Class Library:
<add tagPrefix="YAF" namespace="YAF" assembly="YourClassLibrary"/>
<add tagPrefix="editor" namespace="YAF.Editor" assembly="YourClassLibrary"/>
.) The last step was to convert the thing to a WebApplication so all pages get updated to use the ClassLibrary.

After doing these steps everything complies fine, but here comes the next problem... when i run the app i get an "file not found" exception when it tires to load the the forum.ascx control.

This is where I am stuck right now...

Any ideas?:cheesy:
  • kovv
  • Rank: YAF Forumling
  • Reputation:
    Neutral
    51.8%
  • Joined: 08/10/2008
  • Posts: 3
#7
I can vouch for that...

I tried a bunch of different things to get this to work, but I either ended up with the 4 compile errors above, or a run-time error for forum.ascx.
UserPostedImage 
www.bunkerhollow.com  | www.careercomputing.com 
When I post fp:mddubs in a topic, I'm leaving my footprint there so I can track it once I get into coding/supporting. (Yes I stole this off Mek πŸ™‚, who stole this off Ederon πŸ™‚ )
  • mddubs
  • Rank: YAF Developer
  • Reputation:
    Exalted
    100%
  • Medals:
    Medal of Honor Key: Given to pillars of the community who are key players in the YAF community and project.
  • Joined: 07/08/2008
  • Posts: 476
  • Was thanked: 3 time(s) in 1 post(s)
#8
Has anybody come to find a solution to this issue? I am experiencing the same problem and have, like everyone else above, run out of options and time. Here's hoping this post will bring this thread/issue back to life.
  • tbird888
  • Rank: YAF Forumling
  • Reputation:
    Neutral
    51.2%
  • Joined: 05/01/2009
  • Posts: 2
#9
I'm also stuck here. Whatever I try I just end up with this runtime Compilation Error.
Quote:


Compiler Error Message: CS0433: The type 'YAF.Forum' exists in both 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\cfc5a25e\ab570fb2\assembly\dl3\8b039c11\80575a06_5070c901\FH.Click4Cod.Web.DLL' and 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\cfc5a25e\ab570fb2\App_SubCode_YAF.yeny4zqo.dll'



when I run

Line 19:     <form id="form1" runat="server" enctype="multipart/form-data">
Line 20:         <YAF:Forum runat="server" ID="forum"></YAF:Forum>
Line 21:     </form>


I'm trying to set up the 1.9.3 RC2 within my existing Web Application. I've tried the SRC and the bin version. And I've tried with a lot of different configurations. Having my web app referencing YAF projects as well as pre-built YAF dll's. I'm out of ideas. Anybody getting this to work?
  • DrKefir
  • Rank: YAF Forumling
  • Reputation:
    Neutral
    54.2%
  • Joined: 06/12/2007
  • Posts: 7
#10
So, maybe I've got it working now. :-d
I just need to verify that it is actually working and then figure out exactly what made the trick.
Be right back with some more comments.

... Here it goes.
The short version is that I changed the Build Action of the Forum.cs file (in the App_Code/YAF folder) from Build to Content
But I now realize that my problem wasn't a "file not found" exception as described in a earlier post in this thread, so this trick might not help you.

Longer Version.
*Using Visual Studio 2008 v. 9.0.30729.1 SP, .Net Framework 3.5 SP1
*Downloaded YAF-v1.9.3-RC2-SRC. Opened up the yetanotherforum.net.vs2008.sln and converted it.
*Used the Recommended.NET3.5web.config.
*Changed all projects to build with the .NET 3.5 framework.
*Changed to Release mode and build solution.

(*Notes to myself: Copy all the dll:s (YAF.XXX.dll, Intelligencia.UrlRewriter.dll, CookComputing.XmlRpcV2.dll) to a "ThirdPartyComponents-" folder in my existing web app solution. I kind of like it organized that way.)
*copy all the contents of the YetAnotherForum.NET Web SITE project to a sub-folder (in my case "yaf" ) within my existing Web APPLICATION*Edit and organize the .config files (as described elsewhere in this forum).
*Move the App_Code folder to your root directory.
*Add references (for your Web Application) to all of the 7 YAF.XXX.dll, Intelligencia.UrlRewriter.dll, CookComputing.XmlRpcV2.dll (and if not allready exist also AjaxControlToolkit, System.Web.Extensions and System.Web.Extensions.Design)
*Right click your Web App and select "Convert To Web Application". (Note: The studio altered the folder name App_Code to Old_App_Code while converting. Rename back to App_Code).
*Alter the Build Action from Compile to Content of the forum.cs file (probably all .cs files in App_Code)
*Build your solution and run your web application.

If you want the whole YAF source code in your solution you could probably add all the projects to your solution and then have your web app referencing the projects and not the dll:s as described above. In that case you probably also want YAF projects reference each other by project and not by dll (sorry about the poor choice of datalinguish here but)
  • DrKefir
  • Rank: YAF Forumling
  • Reputation:
    Neutral
    54.2%
  • Joined: 06/12/2007
  • Posts: 7
#11
Hmmm ... Interesting ....

I took the code in the app_code folder and pulled it in to a new class library project.
as is with no extra references it builds fine (which i figured was suspect right out).

I then examined this assembly a little closer ...

If you do the same then create a reference to the assembly in your web site project then double click on that reference the ref tree shows the assembly as being a .NET 2 assembly and not a .NET 3.5 one as specified.

This doesn't add up ... It even says the target framework is 3.5 in the project properties.

.....

Experience tells me that you can't run 2 versions of the framework in a single application so with the rest of the solution being 3.5 this assembly simply gets ignored during the compilation process which explains the missing namespace perfectly.

.....

A little further digging into the code has revealed that the web reference in the project is carrying a specific version attribute telling the compiler that the reference was created by guess who ... .NET 2.0 ...

It appears to be looking at the code and realising that 2 versions of .NET should not be mixed in to the same assembly so it compiles my project as .NET 2.0, in the web aplpication however its already got a shed load of running 3.5 code before it even considers the "app_code" directory for on the fly compiling.

What this essentially means is that the 3.5 compiler cannot compile that directory because it's writtin by a different version of .NET ...

After removing the offending attributes however I notice that the problem didn't go away so I completely removed the web reference and this also didnt help matters much.

So that threw that theory out the window.

Then I got nosey and really interested in seeing what was actually going on with the assembly so I ripped it open with Reflector and oddly enough it claimed that there was nothing in it due to some kind of referencing issue with System.Web

That made sense since the project did not reference this assembly, question is why did it even half compile then tell me it did it successfully if it required this reference?

This code clearly upsets .NET and i'm still none the wiser as to why ...

  • Wardy
  • Rank: YAF Forumling
  • Reputation:
    Neutral
    55.4%
  • Joined: 28/01/2009
  • Posts: 9
#12
Ok after some more digging about in the code I have worked out that the app_code source doesn't actually compile in to a class library even when put in its own project and only compiled on its own.

It's like something physically prevents this code running under .NET 3.5 and any attempt to do so will either result in an explicit conversion of the assembly to a 2.0 compilation or the code simply left out of compilation altogether.

I've never seen anything quite like this before ... YAF is confusing .NET !!!!

I have noticed that the entire namespace "YAF.Editor" exists in a single class which may somehow be an issue (although I doubt it) so i'm going to separate out the classes and try and compile smaller parts of the namespace.

I should note that in my particular case I am trying to integrate the YAF code in to an existing solution where the application is becoming part of my CMS which may complicate things a little especially considering I am using some silverlight in my solution.

I used this ...

http://wiki.yetanotherfo...h%20existing%20site.ashx 

... to guide me in to the integration and have only integrated the binaries not the full source.

maybe if i take the full source and pull that in to my solution I can add a little light on the subject but the rest of the code appears fine at the moment, its only this YAF.Editor namespace that is kicking up any issues.

Having said that, without this code firing up I don't have any way of executing the rest of the code.

so ...

Why would a class refuse to compile ?
  • Wardy
  • Rank: YAF Forumling
  • Reputation:
    Neutral
    55.4%
  • Joined: 28/01/2009
  • Posts: 9
#13

Duh ...

Just realised i'm a dumbass ... it's not going to compile unless its told to in the file properties !!!
And i went off on a tangent with the whole web ref thing too since that has now been completely removed.

I seem to be able to add more errors and remove them without too much trouble but I still can't resolve those 4 initial errors ...

I'm not helping much at all here am i ...

:oops:
  • Wardy
  • Rank: YAF Forumling
  • Reputation:
    Neutral
    55.4%
  • Joined: 28/01/2009
  • Posts: 9
#14
Is there any update on this? I'd really like to get this integrated in a Webapplication. I've got it running just fine in a Website, but beeing a bit of a geek i'd like to get some tests written aswell. Sadly i can't reference to a Website like you can to a web application so yeah.

It's either integrate this or forget about my cute little idea of actually writing some unit tests for a change.
  • F.B. ten Kate
  • Rank: YAF Forumling
  • Reputation:
    Neutral
    50.6%
  • Joined: 08/04/2009
  • Posts: 1
#15
I haven't put any time into this -- not a high priority at this point. I can understand why you want it, though.
  • Jaben
  • Rank: YAF Developer
  • Reputation:
    Exalted
    100%
  • Medals:
    Medal of Honor Key: Given to pillars of the community who are key players in the YAF community and project.YAF.NET Supporter: Loves YAF.NET!YAF.NET Supporter: Supports our efforts. Thank you.Medal of Honor for the Support King: Given to a community member who tirelessly answers tons of support questions.
  • Joined: 09/10/2004
  • Posts: 2,544
  • Location: United States
  • Thanks: 142 times
  • Was thanked: 352 time(s) in 195 post(s)
Forum Jump  
  • 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.

About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button

Project Twitter Updates

Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved