License check failed, with exception: Sdl.Core.PluginFramework.PluginFrameworkException: No Application specific plug-in directory found.

Hi, I am trying to create a new localization project using the project automation API. It is a standalone application. Here is my code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Reflection;
using System.Globalization;
using Sdl.Core.Settings;
using Sdl.Core.Globalization;
using Sdl.ProjectAutomation.Core;
using Sdl.ProjectAutomation.FileBased;
using Sdl.ProjectAutomation.Settings;
using Sdl.Core.PluginFramework;
using Studio.AssemblyResolver;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        
        public Form1()
        {           
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e) {

            ProjectInfo info = new ProjectInfo();
            info.Name = "Demo Project";
            info.Description = "This is a programmatically created project.";
            info.DueDate = DateTime.Now.AddDays(7);
            FileBasedProject newProject = new FileBasedProject(info);         
        }    
    }
}

I got an error at FileBasedProject newProject = new FileBasedProject(info);    Here is the error:

License check failed, with exception: Sdl.Core.PluginFramework.PluginFrameworkException: No Application specific plug-in directory found.
   at Sdl.Core.PluginFramework.DefaultPluginLocator..ctor()
   at Sdl.Core.PluginFramework.PluginManager.get_DefaultPluginRegistry()
   at Sdl.Common.Licensing.Provider.Core.LicensingProviderManager.get_LicensingProviderFactories()
   at Sdl.Common.Licensing.Provider.Core.LicensingProviderManager.CreateProvider(ILicensingProviderConfiguration config)
   at Sdl.Common.Licensing.Manager.ApplicationLicenseManager.GetCurrentLicensingProvider()
   at Sdl.Common.Licensing.Manager.ApplicationLicenseManager.GetProduct()
   at Sdl.Common.Licensing.Manager.ApplicationLicenseManager.GetLicenseWithoutConsumingSeatsOrUsages()
   at Sdl.ProjectApi.Licensing.StudioLicense.GetLicenseWithoutConsumingSeatsOrUsages()
   at Sdl.ProjectApi.Licensing.LicenseCheckWithoutUsingNetworkSeat.get_ProductLicense()
   at Sdl.ProjectApi.Licensing.LicenseCheckWithoutUsingNetworkSeat.get_IsProfessional()
   at Sdl.ProjectAutomation.FileBased.FileBasedProject.CheckLicense()


I have put the assembly resolver in the main entrance point but I still get the same error. Here is my Program.cs:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using Studio.AssemblyResolver;


namespace WindowsFormsApplication1
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            AssemblyResolver.Resolve();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
    }
}

What did I do wrong? Do I need to register a plugin directory using the plugin manager in the Core API?

Thanks!!

Parents Reply Children
  • Hi, I have tested three different scenarios.

    First Scenario

    I set the output directory to C:\Program Files (x86)\SDL\SDL Trados Studio\Studio3 and didn't use assembly resolver. I got an error message when building the solution:

    Error 1 Unable to copy file "\\liserver2012\Development\StudioSDKDemo\SudioSDKDemo\packages\Studio.AssemblyResolver.0.1.1.0\lib\Studio.AssemblyResolver.dll" to "C:\Program Files (x86)\SDL\SDL Trados Studio\Studio3\Studio.AssemblyResolver.dll". Access to the path 'C:\Program Files (x86)\SDL\SDL Trados Studio\Studio3\Studio.AssemblyResolver.dll' is denied. SudioSDKDemo

    I think this is because my C:\Program Files (x86)\SDL\SDL Trados Studio\Studio3 is read only. To make it work. I probably need to ask our system admin to change the security setting on my computer.

    Second Scenario

    I set the output directory to an empty folder - \\LIserver2012\Users\tchi\Documents\Visual Studio 2010\Projects\Test\, and I used assembly resolver. I got an error message at this line:

    FileBasedProject newProject = new FileBasedProject(GetProjectInfo());

    The error details is attached below:

    System.IO.FileNotFoundException was unhandled
      HResult=-2147024894
      Message=Could not load file or assembly 'SDLTradosStudio' or one of its dependencies. The system cannot find the file specified.
      Source=mscorlib
      FileName=SDLTradosStudio
      FusionLog==== Pre-bind state information ===
    LOG: DisplayName = SDLTradosStudio
     (Partial)
    WRN: Partial binding information was supplied for an assembly:
    WRN: Assembly Name: SDLTradosStudio | Domain ID: 1
    WRN: A partial bind occurs when only part of the assembly display name is provided.
    WRN: This might result in the binder loading an incorrect assembly.
    WRN: It is recommended to provide a fully specified textual identity for the assembly,
    WRN: that consists of the simple name, version, culture, and public key token.
    WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
    LOG: Appbase = file://LIserver2012/Users/tchi/Documents/Visual Studio 2010/Projects/Test/
    LOG: Initial PrivatePath = NULL
    Calling assembly : Sdl.Core.Globalization, Version=1.8.0.0, Culture=neutral, PublicKeyToken=c28cdb26c445c888.
    ===
    LOG: This bind starts in default load context.
    LOG: Using application configuration file: \\LIserver2012\Users\tchi\Documents\Visual Studio 2010\Projects\Test\SudioSDKDemo.exe.Config
    LOG: Using host configuration file:
    LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
    LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
    LOG: The same bind was seen before, and was failed with hr = 0x80070002.

      StackTrace:
           at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
           at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
           at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
           at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)
           at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
           at System.Reflection.Assembly.Load(String assemblyString)
           at Sdl.Core.Globalization.LocalizableString.LoadResourceString(String embeddedResourceName)
           at Sdl.Core.Globalization.LocalizableString.get_Content()
           at Sdl.Desktop.Platform.Implementation.Services.UserProfile.ReadHeader()
           at Sdl.Desktop.Platform.Implementation.Services.UserProfile..ctor(String filePath, ISettingsBundle parentSettings, Boolean isCustom)
           at Sdl.Desktop.Platform.Implementation.Services.UserSettingsService.EnsureLoaded()
           at Sdl.Desktop.Platform.Implementation.Services.UserSettingsService.get_UserSettings()
           at Sdl.ProjectAutomation.FileBased.FileBasedProject.GetDefaultProjectTemplateReference()
           at Sdl.ProjectAutomation.FileBased.FileBasedProject..ctor(ProjectInfo projectInfo)
           at WindowsFormsApplication1.Form1.button1_Click(Object sender, EventArgs e) in \\liserver2012\Development\StudioSDKDemo\SudioSDKDemo\SudioSDKDemo\Form1.cs:line 31
           at System.Windows.Forms.Control.OnClick(EventArgs e)
           at System.Windows.Forms.Button.OnClick(EventArgs e)
           at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
           at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
           at System.Windows.Forms.Control.WndProc(Message& m)
           at System.Windows.Forms.ButtonBase.WndProc(Message& m)
           at System.Windows.Forms.Button.WndProc(Message& m)
           at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
           at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
           at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
           at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
           at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
           at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
           at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
           at System.Windows.Forms.Application.Run(Form mainForm)
           at WindowsFormsApplication1.Program.Main() in \\liserver2012\Development\StudioSDKDemo\SudioSDKDemo\SudioSDKDemo\Program.cs:line 21
      InnerException:

    There is another error in the output window:

    log4net:ERROR XmlConfigurator: Failed to find configuration section 'log4net' in the application's .config file. Check your .config file for the <log4net> and <configSections> elements. The configuration section should look like: <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />

    I can see many files have been copied to \\LIserver2012\Users\tchi\Documents\Visual Studio 2010\Projects\Test\, so I think the assembly resolver is working. However, some files were not copied to the output folder for some reason. Do I need to add any reference even though I don't use them directly in my code?

    Third Scenario

    I copied everything in C:\Program Files (x86)\SDL\SDL Trados Studio\Studio3 to \\LIserver2012\Users\tchi\Documents\Visual Studio 2010\Projects\Test\, set the output path to \\LIserver2012\Users\tchi\Documents\Visual Studio 2010\Projects\Test\ and I didn't use the assembly resolver. This scenario works! Although I still get an error message at the output window:

    log4net:ERROR XmlConfigurator: Failed to find configuration section 'log4net' in the application's .config file. Check your .config file for the <log4net> and <configSections> elements. The configuration section should look like: <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />

    I am still exploring~~

  • Hi! Have you found a solution to your issue? I have the same license error and I search a solution too.