YAFLogo

kheiser
  • kheiser
  • 72.4% (Friendly)
  • YAF Forumling Topic Starter YAF Version: 4
11 months ago
I know it's still in beta, but has anybody had any luck integrating YAF 4 into an existing .NET application?  I've got it running as a standalone application.  I was trying to apply https://github.com/YAFNET/YAFNET/wiki/YAF.NET-Integration-in-to-an-existing-ASP.NET-Application  but there are a lot of key differences between .NET Framework and .NET 8, so most of the steps are going to be different.
YAF 4.x User
Sponsor
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
11 months ago
You cannot mix an asp.net core application with an asp.net application.

But you don't have to. If you want to continue using.net framework in your main application then use yaf v3.

kheiser
  • kheiser
  • 72.4% (Friendly)
  • YAF Forumling Topic Starter YAF Version: 4
11 months ago
It's actually a .NET 6 (soon to be upgraded to .NET 8 ) application we're trying to integrate with, not framework.  I was just trying to figure out the differences between integrating  YAF 4.x into a .NET 8 application, and integrating YAF 3.x into a .NET Framework application.  There are sample applications and a guide for the latter which look very useful, but that doesn't exist yet for the new version.  Thanks for the reply.
YAF 4.x User
Zero2Cool
  • Zero2Cool
  • 100% (Exalted)
  • YAF Leader YAF Version: YAF 3.1.16
11 months ago
I downloaded the latest source today and plugged in a backup connection to my SQL Server. It loads, but I get this console app madness.

I haven't debugged it at all. I'm just tinkering around and it's certainly something I have wrong on my end.

 image.png You have insufficient rights to see the content.

tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
11 months ago

It's actually a .NET 6 (soon to be upgraded to .NET 8 ) application we're trying to integrate with, not framework.  I was just trying to figure out the differences between integrating  YAF 4.x into a .NET 8 application, and integrating YAF 3.x into a .NET Framework application.  There are sample applications and a guide for the latter which look very useful, but that doesn't exist yet for the new version.  Thanks for the reply.

Originally Posted by: kheiser 

Sorry, I misunderstood your first post.

integrating an app inside an app is more complex in ASP.NET core. I'm evaluating the options at the moment. The goal is to create a new sample application. But this can take some time.

tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
11 months ago

I downloaded the latest source today and plugged in a backup connection to my SQL Server. It loads, but I get this console app madness.

I haven't debugged it at all. I'm just tinkering around and it's certainly something I have wrong on my end.

 image.png You have insufficient rights to see the content.

Originally Posted by: Zero2Cool 

Looks like the js files are missing, at the moment js and css files are not compiled during build. You need to build them manually via the command line or in visual studio with the task runner.

kheiser
  • kheiser
  • 72.4% (Friendly)
  • YAF Forumling Topic Starter YAF Version: 4
10 months ago
I got this mostly working, and I wanted to follow up and share what I did in case somebody else is trying to do this.  This was definitely more involved than it was in 3.x.  There may be other ways to set this up, but I did this through mostly trial and error, and this is what worked for me:

I created a new Area in my project and called it Forums.  I copied the Pages folder from the YetAnotherForum.NET folder here.

I merged the wwwroot folder into the wwwroot folder in my project

I merged the appsettings.json into the appsettings.json in my project

I copied the other .json files and the gruntfile.js into the root of my project

Ran npm install and grunt

I copied the YAF libraries and ServiceStack and added the projects to my solution

Added .UseAutofacServiceProviderFactory()

                .ConfigureYafAppConfiguration().ConfigureYafLogging() into the CreateHostBuilder call in program.cs

Added things that are missing from startup.cs.  This will be anything that references YAF, and possibly other things depending on your project

After doing all this I encountered a large number of compiler errors.  These were mostly ambiguous references.  You may or may not have these depending on your project.  

 


YAF 4.x User
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
10 months ago
I didn't have the time to create a new sample application yet. But this is the same way as i would did it. Thats why i already added the UseAutofacServiceProviderFactory and ConfigureYaf.... extensions.

I need to check if i can move all libraries to nuget. To make the the solution and upgrading more easier.

kheiser
  • kheiser
  • 72.4% (Friendly)
  • YAF Forumling Topic Starter YAF Version: 4
10 months ago

I didn't have the time to create a new sample application yet. But this is the same way as i would did it. Thats why i already added the UseAutofacServiceProviderFactory and ConfigureYaf.... extensions.

I need to check if i can move all libraries to nuget. To make the the solution and upgrading more easier.

Originally Posted by: tha_watcha 

That would be fantastic


YAF 4.x User
Zero2Cool
  • Zero2Cool
  • 100% (Exalted)
  • YAF Leader YAF Version: YAF 3.1.16
9 months ago

I didn't have the time to create a new sample application yet. But this is the same way as i would did it. Thats why i already added the UseAutofacServiceProviderFactory and ConfigureYaf.... extensions.

I need to check if i can move all libraries to nuget. To make the the solution and upgrading more easier.

Originally Posted by: tha_watcha 

Will the new Sample Application include a Chat solution like the previous SignalR solution used to have?

tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
9 months ago

After doing all this I encountered a large number of compiler errors.  These were mostly ambiguous references.  You may or may not have these depending on your project.  

 

Originally Posted by: kheiser 

Those errors occur because of the missing references you need to import the file

https://github.com/YAFNET/YAFNET/blob/master/yafsrc/YetAnotherForum.NET/GlobalUsings.cs 

 

tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
9 months ago
I finally build the new YAF.SampleApp   i also wrote a new Guide on how to integrate

https://github.com/YAFNET/YAFNET/wiki/YAF.NET-Integration-in-to-an-existing-ASP.NET-Core-Application 

The YAFNET Libraries are available as (pre)release on Nuget. Unfortunately its not possible to include files such as css or js files or the razor pages in a nuget package. #

So i build a grunt script for NodeJs to automatically import the razor pages in to the Areas Forums folder. And also the GlobalUsings.cs file and the static files such as json/css/scss/js basically all needed yaf files.

tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
9 months ago

I didn't have the time to create a new sample application yet. But this is the same way as i would did it. Thats why i already added the UseAutofacServiceProviderFactory and ConfigureYaf.... extensions.

I need to check if i can move all libraries to nuget. To make the the solution and upgrading more easier.

Originally Posted by: Zero2Cool 

Will the new Sample Application include a Chat solution like the previous SignalR solution used to have?

Originally Posted by: tha_watcha 

yes there is a chat included.

tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
9 months ago
One More Update. The new nuget package YAFNET.RazorPages  contains now the razor pages and all content files (css/js/images). So yaf can be easily integrated via nuget.