Atalasoft
Welcome to Atalasoft Community Sign in | Join | Help
in

Dot Image in ClickOnce app

Last post 11 Nov 2008, 7:32 AM by loufranco. 3 replies.
Sort Posts: Previous Next
  •  07 Nov 2008, 9:50 PM 16514

    Dot Image in ClickOnce app

    I have an application working fine locally. The app uses the Glyphreader OCR module.

    When published via ClickOnce, I get a FileNotFoundException "The specified module cannot be found". Everything else in the app is working but it's not picking up the Atalasoft stuff, any ideas?

    Looks like it's barfing on this:

    OcrEngine engine = new GlyphReaderEngine();
    engine.Initialize();

     

    BF

  •  10 Nov 2008, 7:22 AM 16533 in reply to 16514

    Re: Dot Image in ClickOnce app

    Are you deploying the resources and calling GlyphReaderLoader with the path?  The best place to do this is in the static constructor of your main form -- it has to happen before any OCR is called.

    public static Form1()
    {
       GlyphReaderLoader loader =
    new GlyphReaderLoader(@"c:\path_to_resources");
       
    if (!loader.Loaded)
       {
           MessageBox.Show(
    "Failed to load OCR Resources");
       }
    }

     

    Where Form1 would be replaced with your form's name and the path would be to where you are deploying GlyphReader resources.  The path you choose should then have the directory path

     GlyphReader\v2.0\

    inside of it, with the resources in the v2.0 directory.

    You can find the necessary files in your installation at

     

    C:\Program Files\Atalasoft\DotImage 6.0\bin\OcrResources

  •  10 Nov 2008, 3:53 PM 16538 in reply to 16533

    Re: Dot Image in ClickOnce app

    Hi there, good catch! Thanks for that.

    I have a slight problem though - in ClickOnce you don't know the deployment path, they are generated by ClickOnce, example:

    C:\Users\bobflemming\AppData\Local\Apps\2.0\0QPLK9P1.WYB\NGWW98VO.VVY\atal...lib_2b02b46f7326f73b_0006.0000_none_bbad35cc60d2c47a

    is the location of Atalasoft.dotImage.Lib.dll

    Many thanks

  •  11 Nov 2008, 7:32 AM 16548 in reply to 16538

    Re: Dot Image in ClickOnce app

    Try this:

            private string GetAssemblyPath()
            {
                Assembly asm = Assembly.GetExecutingAssembly();
                return Path.GetDirectoryName(asm.Location);
            }
View as RSS news feed in XML