您的位置:首页 > 其它

The file or Assembly "BMC.arnettoc.dll" or a dependency could not be found.

2011-10-11 15:34 916 查看
唉,做冷门的东西就是麻烦,出问题了都不好找资料的说~ T T

现在在用c#做接口连接remedy,还是新升级的7.6版本。

找api啊,测试代码啊,出错查错啊.... 这些就够头痛的了,偏偏google还时不时的抽风,公司还时不时的屏蔽,国外网站的网页还时不时和谐的打不开……

唉,不让人郁闷会死吖~

因为本人在修复问题前又忘了留取报错信息了...囧rz,于是借用一下别人的,大概就是这意思:找不到BMC.arnettoc.dll

The file or Assembly "BMC.arnettoc.dll" or a dependency could not be found.

因为api已经按照步骤注册了,BMC.ARSystem.dll也都正常引入了,但就是这个BMC.arnettoc怪物!明明路径正确的引用了,但是编译时就非得说找不到该引用.. 检查了好几十遍,眼泪哗哗的有木有!!(┬_┬)

查了一下,大致摘录一下网上看到的建议。

Well, placing the files in app's bin directory is not quite sufficient in AR .NET API case unfortunately. This API includes a bunch of unmanaged libraries (arcni, arapi, and so on) -- they need to be present in your typical Windows DLL search path. In web app's case, it is easiest to place them in a dir that is included in your PATH System environment variable. If it is not a hassle for you, I suggest you to add your .NET API install dir to the PATH, restart IIS, better yet restart your machine - and verify your app. I am fairly certain you'll see better results.

As noted in the readme.txt installation instructions of the .NET API -- any client app that needs to use the AR .NET API assembly, must place the .NET API installation directory in the DLL search path. For standalone apps, one solution is to copy the .NET API's entire directory contents into your app's build dir (or, other way around - copy/run your client program from .NET API dir as working dir).
For web apps, it is best to simply alter your System PATH env variable and include your .NET API install dir in there.

it maybe related to the runtime version of .NET, this would have been 3.5 or lower when compiled ...

The security settings for the DLL's in the AR.NET API does play a role too. Try allowing 'Everyone' or 'Users' access to the AR.NET API installation folder, and tighten security as appropriate from there.

Also, make sure that it's the AR.NET API is the exact same version (version, subversion) as on the development box. If you need to upgrade, remember to re-check file permissions in the AR.NET API folder once again, as those are reset when you apply the latest version.

- Please double check the readme for the installation instructions.
- As noted in the Troubleshooting section, try running the FieldLabelChanger program. Does it work correctly? If so your installation is fine. But if your app is not working, then look at your PATH.
- .NET API includes few unmanaged DLLs in addition to the BMC.ARSystem.DLL. So when you develop a custom program in .NET (C#, VB.NET etc), you have to do:
a. referenceBMC.ARSystem.DLL assembly from your .NET project
b. ensure .NET API installation directory is in the PATH
so that when running your app, the necessary unmanged DLLs can be found/loaded.

- If your app is a COM app,
a. check the readme for registering COM wrapper;
b. same rule about the PATH still applies.

In most cases, I deduce the issue to be PATH related issue. Ensure you've your path right, then this "module could not be found" error should go away.

https://communities.bmc.com/communities/thread/24881
https://communities.bmc.com/communities/thread/44225
https://communities.bmc.com/communities/message/60258
https://communities.bmc.com/communities/message/153033

总结一下,就是都说把api的路径加入到系统变量中 (← 都一样的建议你还复制那么多遍! = =+

并且注意只支持v3.5以下的。

============================================================================

这篇写的不错。

from:http://www.isrcomputing.com/knowledge-base/programming-tips/93-how-to-install-net-api-for-remedy-arsystem.html

How to install .NET API for Remedy (ARSystem)

Overview

Many of us would like to know how to interact with Remedy ticketing system using .NET framework. This is fairly easy to accomplish following several steps:

Login to BMC Developer Network http://developer.bmc.com/communities/index.jspa
Register accound and download API from this link:
http://developer.bmc.com/communities/docs/DOC-2062
http://developer.bmc.com/communities/servlet/JiveServlet/download/1215-1-5915/ARAPI71.NET.zip
http://developer.bmc.com/communities/servlet/JiveServlet/download/1215-1-5914/readme.txt

NOTE: .NET API is backward compatible. So you can use 7.1 with 6.3 server.

Create C:\ARAPI.NET folder
Unzip downloaded files to previously created folder
Create of modify several Environment variables:
"C:\ARAPI.NET" -> LIB
"C:\ARAPI.NET" -> PATH

Add dll into .NET framework
C:\ARAPI.NET>C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\regasm "C:\ARAPI.NET\BMC.ARSystem.dll" /codebase
Microsoft (R) .NET Framework Assembly Registration Utility 1.1.4322.573
Copyright (C) Microsoft Corporation 1998-2002.  All rights reserved.
Types registered successfully
C:\ARAPI.NET>

Create ARTCPPORT environment variable. Assign value "5920". This variable will be used as default port to connect to Remedy system.
Add BMC.ARSystem and BMC.arnettoc to Assembly Cache at .Net Configuration menu



Reboot your machine
Create sample code: createremedyticket.cs
// Create Remedy Ticket

// C#

// Copyright (C) 2008 Paul Greenberg. All Rights Reserved.

// http://www.isrcomputing.com

// Tested under .NET v1.1.4322

using System;
using System.Net;
using System.IO;
using System.Text;
using BMC.ARSystem;

namespace Isrcomputing {

class CreateRemedyRequest {

[STAThread]
static void Main(string[] args) {

try {
BMC.ARSystem.Server server;
server = new BMC.ARSystem.Server();
server.Login("remedyserver01", "myusername", "mypassword");  // Change this to your server, username , password
String formName = "HPD:HelpDesk";
BMC.ARSystem.FieldValueList fieldValues = new BMC.ARSystem.FieldValueList();
// Create an entry
fieldValues[8] = "C# - Generation II - Ticket that was automatically generated";
fieldValues[240000007] = "Net Trials....\n\rChecking possibilities";
// Category Field
fieldValues[200000003] = "Remedy";
// Type field
fieldValues[200000004] = "Import";
// Item Field
fieldValues[200000005] = "Assets";
// Case Type
fieldValues[260000130] = "Incident";
// Status
fieldValues[7] = "New";
// Priority
fieldValues[260000126] = "Low";
// Login+
fieldValues[240000005] = "myusername";
// Name+
fieldValues[240000001] = "Joe Shmo";
// Agency
fieldValues[200000012] = "ISRCOMPUTING";
// Location
fieldValues[200000007] = "50 Broadway";

// Department
fieldValues[200000006] = "Operations";

//BMC.ARSystem.EntryIdList entryId = server.CreateEntry(formName, fieldValues);
string entryId = server.CreateEntry(formName, fieldValues);
Console.WriteLine("Created Entry: " + entryId.ToString());
server.Logout();
} catch(Exception e) {
Console.WriteLine("ARSystem.Exception caught\n" + e.ToString()); }
}
}
}

Compile your code:
"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\csc.exe" /lib:C:\ARAPI.NET /reference:BMC.ARSystem.dll /define:DEBUG /optimize /out:createremedyticket.exe createremedyticket.cs

Many thanks to Oto Slavos from BMC Remedy Team, who helps developers around the globe to achieve their goals!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐