application-blocks

Unity 1.2 Dependency injection of internal types

孤街浪徒 提交于 2019-12-24 07:02:12
问题 I have a facade in a library that exposes some complex functionality through a simple interface. My question is how do I do dependency injection for the internal types used in the facade. Let's say my C# library code looks like - public class XYZfacade:IFacade { [Dependency] internal IType1 type1 { get; set; } [Dependency] internal IType2 type2 { get; set; } public string SomeFunction() { return type1.someString(); } } internal class TypeA { .... } internal class TypeB { .... } And my website

Logging Application Block - Logging the caller

我是研究僧i 提交于 2019-12-23 23:17:54
问题 When logging with Log4Net it's very easy to put class that called the log into the log file. I've found in the past that this makes it very easy to trace through the code and see the flow through the classes. In Log4Net I use the %logger property in the conversion pattern like so: <conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" /> And this gives me the output I want: 2008-09-19 15:40:26,906 [3132] ERROR <b>Log4NetTechDemo.Tester</b> [(null)] -

EntLib5: Loggin application block not logging to Event Log (exception: type LogWriter cannot be constructed)- Can anyone help?

别说谁变了你拦得住时间么 提交于 2019-12-07 03:06:31
问题 HI there, I just setup the logging application block part of Enterprise Library 5. I think i have done it correct but its not logging to the event log it errors on the write method and gives me the following exception. The type LogWriter cannot be constructed. You must configure the container to supply this value. Can anyone do me a check or tell me what i am missing.. First of all i am running in windows 7 with a winforms application. Here is my method that creates the log and you see the

Is “ SQL Helper Class ” in Microsoft Application Blocks for .NET is excellent?

十年热恋 提交于 2019-12-06 15:01:18
问题 from years go i use "SQL Helper" class that exist in Microsoft Application Blocks for .NET and i used it for about 1 year in many projects but after that many senior recommend me not to use as it's have many problems in big projects and i let it but know in a new company they want to use it in a projects ... Could any make his recommendations about it / and if it's really excellent to use it have already issues ? Is there any other good solution rather than SQL Helper ? 回答1: I've used the SQL

EntLib5: Loggin application block not logging to Event Log (exception: type LogWriter cannot be constructed)- Can anyone help?

梦想的初衷 提交于 2019-12-05 06:42:10
HI there, I just setup the logging application block part of Enterprise Library 5. I think i have done it correct but its not logging to the event log it errors on the write method and gives me the following exception. The type LogWriter cannot be constructed. You must configure the container to supply this value. Can anyone do me a check or tell me what i am missing.. First of all i am running in windows 7 with a winforms application. Here is my method that creates the log and you see the write method. public class Logger : ILogger { public void SendTest(string test) { LogEntry log = new

Is “ SQL Helper Class ” in Microsoft Application Blocks for .NET is excellent?

余生长醉 提交于 2019-12-04 21:16:33
from years go i use "SQL Helper" class that exist in Microsoft Application Blocks for .NET and i used it for about 1 year in many projects but after that many senior recommend me not to use as it's have many problems in big projects and i let it but know in a new company they want to use it in a projects ... Could any make his recommendations about it / and if it's really excellent to use it have already issues ? Is there any other good solution rather than SQL Helper ? I've used the SQL Helper class and newer DAAB/Enterprise Library in many projects before. I would suggest that you use the

Add date to log file name in Logging Application Block

江枫思渺然 提交于 2019-12-02 02:49:41
问题 I'm using the Microsoft Logging Application Block (version 5 beta 2) and I'm trying to dynamically set the file name of a log file to the year month and day (and then write a new log file every day). However, at runtime, the logger ignores any dynamic environment variables such as %date%, %time%, or %cd%. I can add static environment variables to the file name (such as %username%), but not dynamic environment variables. Does anyone know how to get the rolling flat file trace listener to

Add date to log file name in Logging Application Block

时光总嘲笑我的痴心妄想 提交于 2019-12-02 02:10:49
I'm using the Microsoft Logging Application Block (version 5 beta 2) and I'm trying to dynamically set the file name of a log file to the year month and day (and then write a new log file every day). However, at runtime, the logger ignores any dynamic environment variables such as %date%, %time%, or %cd%. I can add static environment variables to the file name (such as %username%), but not dynamic environment variables. Does anyone know how to get the rolling flat file trace listener to dynamically set the date in the log file name? (this is what I was setting the File Name as: Log_%date%.log)