This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - c# IOM.dll Aras.net System.io.DileNotFoundException

Peter Berger - Monday, February 29, 2016 6:15 AM:

Hallo,

At the moment I'm trying to build an easy Aras11 Filedownloader using c# and Visual Studio 2012.

I'm trying to use IOM Version 11. But when I run the programm I get the System.io.FileNotFoundException concerning Aras.net. But when I use version 9 of IOM.dll it works.

 

This is my Code :

static void Main(string[] args)
        {  
            Aras.IOM.HttpServerConnection MyConnection;
            Aras.IOM.Innovator MyInnovator;
            String url = "http://***.***.***.*.***/InnovatorServer/";
            String db = "InnovatorSolutions";
            String user = "Admin";
            String password = "innovator";
            Aras.IOM.Item login_result;
            Console.WriteLine("Aras Innovator Filedownloader!");
            try
            {
                MyConnection = IomFactory.CreateHttpServerConnection(url, db, user, password);
                Console.WriteLine("HTTPSerververbindung hergestellt");
                login_result = MyConnection.Login();
                MyInnovator = new Aras.IOM.Innovator(MyConnection);
                Console.WriteLine("Downloading Files");
                Item myfiles = MyInnovator.newItem("File", "get");
                Item result1 = myfiles.apply();
                Item files = result1.getItemsByXPath("//Item[@type='File']");
                for (int i = 0; i < files.getItemCount(); i++)
                {
                    Item file = files.getItemByIndex(i);
                   try
                    {
                        Console.WriteLine(file.getFileName() + " ");
                        file.lockItem();
                        file.checkout("C:\Test\Ausgabe\");
                    }
                    catch (System.Exception EX)
                    {
                        Console.WriteLine(EX.ToString());
                    }
                }
                MyConnection.Logout();
            }
            catch (System.Exception e)
            {
                Console.WriteLine(e.ToString());
            }
            Console.WriteLine("Press any key to exit.");
            Console.ReadKey();
        }

 

 

 

Any help would be apprechiated!!!



zahar - Monday, February 29, 2016 6:46 AM:

Peter,

In Aras 11 API changed, check example, in Programmers guide (page 69):

www.aras.com/.../Aras Innovator 11.0 - Programmers Guide.pdf

If your File is property of the document you need to get this document and then use the fetchFileProperty method on the file property to check out the file.

Another option is to use CheckOutManager to 'download' files. Check Aras .NET help file.



Peter Berger - Monday, February 29, 2016 7:38 AM:

Thank you Zahar,

but I think I did not describe the reason for the exception clearly enough. Sorry, my fault.

The problem is, that the program doesn't even come to that point you mentioned. The exception is already thrown while creating the httpserverconnection. And it says that some file in the iom.dll can not be found. So I can't even log in althoug no errormessage occures while writing the code.

Is it possible, that my Visual Studio 2012 Project is broken or something like that?



Peter Berger - Monday, February 29, 2016 7:59 AM:

Addendum:

 

the esception says that "Aras.net" can not be found. Isn't part of the IOM.dll or du ei have to add it myselv to the project and where can i get it?



zahar - Monday, February 29, 2016 8:27 AM:

You can find more DLL files below:

<Innovator install>serverin

 



Peter Berger - Tuesday, March 1, 2016 5:19 AM:

Thanks a lot!!!!

I imported all the dll-files. Now, everythiing works. Great!

 

Excuse my english please. ;-)