Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
Copper Contributor
ACTDevNet
Posts: 119
Country: USA
Message 1 of 6 (3,161 Views)

Error Logging for plug in?

by mhopkins on 12-11-2007 10:36 AM

Hello all,

I have created my first AcT! plug in. It works great and was very easy to pull off.

But I am having trouble debugging it.

The plugin works fine on my machine and another one in the office but on two other ones it cause act to show an error when loading starting and of course it does not load the plugin. One is PX one is Vista.

I need to find some error logging so I can trouble shoot.

I am using the code in the plug in template to log to some place I just don't know where.

catch (Exception ex)
{
  if (trace Switch.Trace Error)
  {
    Act.Shared.Diagnostics.
Trace.WriteLine(ex, trace Switch.Category, Trace Level.Error);
  }
}

I tried using the LogViewer app in the ACT directory but it did not show anything useful.

I even added this to see if it was writing to the same place I was looking.

traceSwitch = new Act.Shared.Diagnostics.TraceSwitch(Assembly.GetExecutingAssembly());

if (traceSwitch.Trace Info)
{

Act.Shared.Diagnostics.
Trace.WriteLine(string.Format("Test Message From Mike.{0}", Assembly.GetExecutingAssembly().FullName),
traceSwitch.Category, Trace Level.Info);

}

Am I looking for error logging in the wrong place?  I could not find the Diagnostics classes in the docs so I am clueless.

Please use plain text.
Copper Contributor
ACTDevNet
Posts: 119
Country: USA
Message 2 of 6 (3,158 Views)

Re: Error Logging for plug in?

by mhopkins on 12-11-2007 10:18 PM

I have found out why the plugin works on some machines and not others.

The logging did log this on one of the machines that the plugin never loaded:

                Informative Exception: Could not load file or assembly 'Act.Shared.Diagnostics, Version=10.1.199.0, Culture=neutral, PublicKeyToken=ebf6b2ff4d0a08aa' or one of its dependencies. The system cannot find the file specified.System.IO.FileNotFoundException: Could not load file or assembly 'Act.Shared.Diagnostics, Version=10.1.199.0, Culture=neutral, PublicKeyToken=ebf6b2ff4d0a08aa' or one of its dependencies. The system cannot find the file specified.

File name: 'Act.Shared.Diagnostics, Version=10.1.199.0, Culture=neutral, PublicKeyToken=ebf6b2ff4d0a08aa'

   at com.hmi.add_tabs.Plugin.Act.UI.IPlugin.OnLoad(ActApplication application)

   at Act.UI.PluginManager.LoadPlugins()

 I see Act.Shared.Diagnostice in the c:\windows\assembly. why would ACT! not find it?

Please use plain text.
Copper Contributor
ACTDevNet
Posts: 119
Country: USA
Message 3 of 6 (3,157 Views)

Re: Error Logging for plug in?

by Xavier on 12-11-2007 11:29 PM

Looks like the version that failed to load is ACT! 10.0.1 - could it be that the machines where the error occurs don't have 10.0.1 installed, and have older versions of ACT!?  As a best practice, you usually want to build your plugin against the oldest version of ACT! you want to support, such that you have backwards compatibility.

HTH

Please use plain text.
Copper Contributor
ACTDevNet
Posts: 119
Country: USA
Message 4 of 6 (3,156 Views)

Re: Error Logging for plug in?

by mhopkins on 12-12-2007 12:33 AM

Xavier you are correct.

My dev machine has version 10.1.199 of the frame work as does the other machine in the office that the plug-in works on.  But the problem machines have version 10.0.237.  I did not see that coming.

I tried to use the ACT updater to update the problem machine but it just says that it is the current version.

I am guessing that I will need to un-install ACT! on my Dev machine and reinstall with the same cd every one else used.

Thanks For the help

Please use plain text.
Copper Contributor
ACTDevNet
Posts: 119
Country: USA
Message 5 of 6 (3,155 Views)

Re: Error Logging for plug in?

by Pierre on 12-12-2007 5:11 PM

You can just copy the appropriate version DLLs from your CD into a local folder.  then in Visual Studio, you can specifically point to that folder in your "references" section (Right click on the DLL and choose the folder explicitly).

After compiling your plug-in, it should use the DLLs in the separate folder (note if you run the plug-in, the policy files kick in and it will actually load the INSTALLED version of the DLL not the folder ones).

You can use ILDASM to open your plug-in and make sure it references the correct version of the DLLs.

Suggest you use the oldest DLLs that you want to support as the policy files will automatically re-direct to new versions of ACT!

-- Pierre
Please use plain text.
Copper Contributor
ACTDevNet
Posts: 119
Country: USA
Message 6 of 6 (3,154 Views)

Re: Error Logging for plug in?

by Carlton Jones on 12-13-2007 8:52 AM

If you still wish to update your 'problem' machine the download can be found here:

http://www.act.com/support/updates/index.cfm?DOWNLOAD=363

It will require you to log-on but if you don't have a profile they are painless to setup.

 

Hope this helps,

Carlton Jones

ACT! SDK Support

Please use plain text.