Does Enterprise Library 6 work with Visual Studio 2013 and/or 2015?

前端 未结 6 1293
予麋鹿
予麋鹿 2020-12-05 11:12

It seems it does not and we are planning to use it (Logging, Exception, etc..) for future projects. Is it still supported? I do not see a lot of activity around this tool as

相关标签:
6条回答
  • 2020-12-05 11:42

    For Visual Studio 2017.

    <VisualStudio Version="15.0"> <!-- VS2017 -->
        <Edition>Enterprise</Edition>
        <Edition>Premium</Edition>
        <Edition>Pro</Edition>
    </VisualStudio>
    
    0 讨论(0)
  • 2020-12-05 11:57

    Yes it does. This link will provide all the neccessary details https://msdn.microsoft.com/en-us/library/dn169621.aspx

    Also you can refer below sites for detailed implementations. You can install vsix version or binaries (http://www.microsoft.com/en-us/download/details.aspx?id=38789) to create configs. vsix sometimes does not work so you can modify extension.vsixmanifest as stated in below post.

    http://www.gonetdotnet.info/posts/configure-and-use-enterprise-library-5-logging http://www.gonetdotnet.info/posts/how-to-configure-and-use-enterprise-library-5-0-application-blocks-using-nuget-package-manager

    0 讨论(0)
  • 2020-12-05 11:59

    Technically the same as @cilerler suggests, but ready-to-download-and-use solution.

    Visual Studio 2013: Microsoft.Practices.EnterpriseLibrary.ConfigConsole.V6.VS2013.vsix (Source) Visual Studio 2015: Microsoft.Practices.EnterpriseLibrary.ConfigConsole.V6.VS2015.vsix (Source)

    0 讨论(0)
  • 2020-12-05 12:02

    We need these following dlls in the bin folder of the asp.net or console or windows app

    •Microsoft.Practices.EnterpriseLibrary.Common.dll
    •Microsoft.Practices.EnterpriseLibrary.Configuration.DesignTime.dll
    •Microsoft.Practices.EnterpriseLibrary.Configuration.Design.HostAdapterV5.dll
    •Microsoft.Practices.EnterpriseLibrary.Configuration.EnvironmentalOverrides.dll
    

    Practically Microsoft.Practices.Unity.dll is optional is what I see for entlib 6

    source from entlib 5 msdn

    0 讨论(0)
  • 2020-12-05 12:06

    The project I have is using Enterprise Library 6.0, while the VSIX seems to target EL 5. While I have not been able to get VSIX to work correctly in Visual Studio 2013 and 2015, I am able to get the Enterprise Library 6 Configuration tool from the binaries provided by Microsoft. Here is a link to the download.

    Select EnterpriseLibrary6-binaries.exe. Install it by unzipping the file to a folder. The 64-bit Enterprise Library Configuration tool named EntLibConfig.exe. There is a 32-bit version named EntLibConfig-32.exe as well.

    0 讨论(0)
  • 2020-12-05 12:08

    It does. You may add Enterprise Library 6 into your project via Nuget Here is the sample application.

    using System;
    using System.Diagnostics;
    using Microsoft.Practices.EnterpriseLibrary.Logging;
    using Microsoft.Practices.EnterpriseLibrary.Logging.Formatters;
    using Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners;
    
    namespace Practice.Logging
    {
        internal class Program
        {
            public static void Main(string[] args)
            {
                LoggingConfiguration loggingConfiguration = BuildProgrammaticConfig();
                var defaultWriter = new LogWriter(loggingConfiguration);
    
                // Check if logging is enabled before creating log entries.
                if (defaultWriter.IsLoggingEnabled())
                {
                    defaultWriter.Write("Log entry created using the simplest overload.");
                    defaultWriter.Write("Log entry with a single category.", "General");
                    defaultWriter.Write("Log entry with a category, priority, and event ID.", "General", 6, 9001);
                    defaultWriter.Write("Log entry with a category, priority, event ID, " + "and severity.", "General", 5, 9002, TraceEventType.Warning);
                    defaultWriter.Write("Log entry with a category, priority, event ID, " + "severity, and title.", "General", 8, 9003, TraceEventType.Warning, "Logging Block Examples");
                }
                else
                {
                    Console.WriteLine("Logging is disabled in the configuration.");
                }
            }
    
            private static LoggingConfiguration BuildProgrammaticConfig()
            {
                // Formatter
                var formatter = new TextFormatter();
    
                // Trace Listeners
                var eventLog = new EventLog("Application", ".", "StackOverflow #24309323");
                var eventLogTraceListener = new FormattedEventLogTraceListener(eventLog, formatter);
    
                // Build Configuration
                var config = new LoggingConfiguration();
                config.AddLogSource("General", SourceLevels.All, true)
                      .AddTraceListener(eventLogTraceListener);
    
                config.IsTracingEnabled = true;
                return config;
            }
        }
    }
    

    You may find more details in Logging Application Block

    To use Enterprise Library Configuration Console Extension

    To install the extension into the Visual Studio 2013 you may follow the workaround steps below.

    • download Microsoft.Practices.EnterpriseLibrary.ConfigConsoleV6.vsix from the link

    A VSIX file is a zip file that uses the Open Packaging Convention. You can rename the .VSIX extension to .ZIP and use any zip browser (including the Windows File Explorer) to browse its contents.

    • extract the file into a folder
    • locate the file called extension.vsixmanifest in the folder
    • open the file with notepad.exe
    • locate
    <SupportedProducts>
      <VisualStudio Version="11.0">
        <Edition>Ultimate</Edition>
        <Edition>Premium</Edition>
        <Edition>Pro</Edition>
      </VisualStudio>
    </SupportedProducts>
    
    • and replace it with the part below
    <SupportedProducts>
      <VisualStudio Version="11.0">
        <Edition>Ultimate</Edition>
        <Edition>Premium</Edition>
        <Edition>Pro</Edition>
      </VisualStudio>
      <VisualStudio Version="12.0"> <!-- VS2013 -->
        <Edition>Ultimate</Edition>
        <Edition>Premium</Edition>
        <Edition>Pro</Edition>
      </VisualStudio>
      <VisualStudio Version="14.0"> <!-- VS2015 -->
        <Edition>Ultimate</Edition>
        <Edition>Premium</Edition>
        <Edition>Pro</Edition>
      </VisualStudio>
    </SupportedProducts>
    

    comparison

    • save the file and exit
    • compress folder as a ZIP file again
    • rename the extension to VSIX
    • double click on it.
    0 讨论(0)
提交回复
热议问题