InitializeFluentJdf function

Aug 11, 2011 at 1:33 PM

Hi there,

 

I have just created a console app in VS2010 and installed FluentJdf through the PM, but this does not work as I have not initialized properly. Where can I find the InitializeFluentJdf function?

Thanx, Tomislav

Coordinator
Aug 11, 2011 at 4:43 PM

You just need one line at application startup:

Infrastructure.Core.Configuration.Settings.UseCastleWindsor().LogWithNLog();

The NLog configuration will come from NLog.config in the application's bin directory.  We also have support for Log4Net (.UseCastleWindsor.UseLog4Net() instead) , but that is not as fully tested so I suggest you stick with NLog for now if you can.

The Nuget package includes a complete sample LinqPad file that includes initialization code that demonstrates how to set the logging configuration via code.  It is located in <your project>\packages\<fluent jdf package and version>\tools\FluentJdfSample.linq.  The JDF Blog examples can be placed directly into the body of the "Main" method in that LinqPad file.

Aug 11, 2011 at 9:25 PM
Thanx for your reply!
I seem to have some weird problems, probably due to configuration. I am creating a C# console applciation in VS2010, then I import the modules from NuGet which goes fine and adds references to my project. However, Infrastructure.Core.Configuration.Settings does not have UseCastleWindsor() as method. And result (from message.Transmit) does not have Dump.
Is there a C# console application project available to check the configuration of the project file?


On 11 August 2011 18:43, tcabanski <notifications@codeplex.com> wrote:

From: tcabanski

You just need one line at application startup:

Infrastructure.Core.Configuration.Settings.UseCastleWindsor().LogWithNLog();

The NLog configuration will come from NLog.config in the application's bin directory. We also have support for Log4Net (.UseCastleWindsor.UseLog4Net() instead) , but that is not as fully tested so I suggest you stick with NLog for now if you can.

The Nuget package includes a complete sample LinqPad file that includes initialization code that demonstrates how to set the logging configuration via code. It is located in <your project>\packages\<fluent jdf package and version>\tools\FluentJdfSample.linq. The JDF Blog examples can be placed directly into the body of the "Main" method in that LinqPad file.

Read the full discussion online.

To add a post to this discussion, reply to this email (fluentjdf@discussions.codeplex.com)

To start a new discussion for this project, email fluentjdf@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com




--
Tomislav Trajkovski
Managing Director
Applify BV

Head Office, Delft
Martinus Nijhofflaan 2
2624 ES Delft
The Netherlands
Telephone: +31 (0)15 2120684
Fax: +31 (0)15 2121517
Email: info@applify.com

Aug 11, 2011 at 9:27 PM
To follow on my previous reply, this is the definition of Infrastructure.Core.Configuration:

#region Assembly Infrastructure.Core.dll, v4.0.30319
// c:\users\beki\documents\visual studio 2010\Projects\ConsoleApplication4\packages\FluentJdf.0.3.0.9\lib\Infrastructure.Core.dll
#endregion

using Infrastructure.Core.Container;
using Infrastructure.Core.Logging;
using System;

namespace Infrastructure.Core
{
public class Configuration
{
public IServiceLocator ServiceLocator { get; }
public static Configuration Settings { get; }

public void BuildWith(IServiceLocator serviceLocator);
public void Configure();
public void LogWith(ILogProvider logProvider);
}
}


On 11 August 2011 18:43, tcabanski <notifications@codeplex.com> wrote:

From: tcabanski

You just need one line at application startup:

Infrastructure.Core.Configuration.Settings.UseCastleWindsor().LogWithNLog();

The NLog configuration will come from NLog.config in the application's bin directory. We also have support for Log4Net (.UseCastleWindsor.UseLog4Net() instead) , but that is not as fully tested so I suggest you stick with NLog for now if you can.

The Nuget package includes a complete sample LinqPad file that includes initialization code that demonstrates how to set the logging configuration via code. It is located in <your project>\packages\<fluent jdf package and version>\tools\FluentJdfSample.linq. The JDF Blog examples can be placed directly into the body of the "Main" method in that LinqPad file.

Read the full discussion online.

To add a post to this discussion, reply to this email (fluentjdf@discussions.codeplex.com)

To start a new discussion for this project, email fluentjdf@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com




--
Tomislav Trajkovski
Managing Director
Applify BV

Head Office, Delft
Martinus Nijhofflaan 2
2624 ES Delft
The Netherlands
Telephone: +31 (0)15 2120684
Fax: +31 (0)15 2121517
Email: info@applify.com

Coordinator
Aug 12, 2011 at 11:15 AM

We are planning to support a number of IoC/DI containers so support for specific containers is not in Core.  The Castle Windsor support is in Infrastructure.Container.CastleWindsor.dll, which should have been added to your project as a reference.  If not, it was put in the package's lib directory by NuGet.  Your application also needs to reference the Castle DLLs to use the Castle Windsor container.  NuGet should have added those references for you as well.  If not, reference the Castle Windsor package.

Logging support follows the same pattern.  NuGet should have referenced Infrastructure.Logging.NLog.dll and the NLog DLL by default.  The NuGet package puts the log4net alternative, Infrastructure.Logging.log4net.dll, in tools\optionDlls.  If you wanted to use log4net, you would remove the references to the two Nlog DLLs (infrastructure and NLog itself) and replace it with Infrastructure.Logging.log4net.dll and add a NuGet reference to the log4net package.   

Assuming you are sticking with NLog, startup would be:

 

using Infrastructure.Container.CastleWindsor;
using Infrastructure.Logging.NLog;
using FluentJdf.Configuration;

static Main(){
  Infrastructure.Core.Configuration.Settings.UseCastleWindsor().LogWithNLog().Configure();
  FluentJdfLibrary.Settings.ResetToDefaults();
  ...
}

 

Dump() is a utility function provided by LinqPad.  It dumps object information to to the LinqPad output window.  It is not available when debugging a console application.  Tickets and Messages are XDocument descendants so you can use their ToString() method to look at the xml in the immediate window.  You should also be able to view the xml using a Visual Studio visualizer from a watch window.

At some point in the future, we'll have more sample applications.

Aug 13, 2011 at 3:28 PM
I managed to get it compiling and running, for some reason, it seems that before you add the packages from NuGet, you have to set framework to .NET4 instead of .NET4 Client Profile...

Thanx!

On 12 August 2011 13:16, tcabanski <notifications@codeplex.com> wrote:

From: tcabanski

We are planning to support a number of IoC/DI containers so support for specific containers is not in Core. The Castle Windsor support is in Infrastructure.Container.CastleWindsor.dll, which should have been added to your project as a reference. If not, it was put in the package's lib directory by NuGet. Your application also needs to reference the Castle DLLs to use the Castle Windsor container. NuGet should have added those references for you as well. If not, reference the Castle Windsor package.

Logging support follows the same pattern. NuGet should have referenced Infrastructure.Logging.NLog.dll and the NLog DLL by default. The NuGet package puts the log4net alternative, Infrastructure.Logging.log4net.dll, in tools\optionDlls. If you wanted to use log4net, you would remove the references to the two Nlog DLLs (infrastructure and NLog itself) and replace it with Infrastructure.Logging.log4net.dll and add a NuGet reference to the log4net package.

Assuming you are sticking with NLog, startup would be:

using Infrastructure.Container.CastleWindsor;
using Infrastructure.Logging.NLog;
using FluentJdf.Configuration;

static Main(){
  Infrastructure.Core.Configuration.Settings.UseCastleWindsor().LogWithNLog().Configure();
  FluentJdfLibrary.Settings.ResetToDefaults();
  ...
}

Dump() is a utility function provided by LinqPad. It dumps object information to to the LinqPad output window. It is not available when debugging a console application. Tickets and Messages are XDocument descendants so you can use their ToString() method to look at the xml in the immediate window. You should also be able to view the xml using a Visual Studio visualizer from a watch window.

At some point in the future, we'll have more sample applications.

Read the full discussion online.

To add a post to this discussion, reply to this email (fluentjdf@discussions.codeplex.com)

To start a new discussion for this project, email fluentjdf@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com




--
Tomislav Trajkovski
Managing Director
Applify BV

Head Office, Delft
Martinus Nijhofflaan 2
2624 ES Delft
The Netherlands
Telephone: +31 (0)15 2120684
Fax: +31 (0)15 2121517
Email: info@applify.com

Coordinator
Aug 13, 2011 at 6:04 PM

Of course.  Fluent JDF utilizes functions that require the full .NET 4.0 profile.  I didn't think about that.