OSIsoft AF SDK 缺少程序集或参考也添加了参考
OSIsoft AF SDK Missing assembly or reference also the reference is added
我正在使用 OSIsoft AF SDK 版本 4。
添加引用后一切正常,visual studio 可以看到 OSISoft 名称空间和所有内容。但是当我尝试构建时,我在输出 windows 中收到此错误并且构建失败。
找不到类型或命名空间名称 'OSISoft'(是否缺少 using 指令或程序集引用?)
有什么解决办法吗?
我删除并重新添加了参考。打开和关闭 VS 并检查 .Net 框架版本(实际上我尝试了所有可用版本)。但是,构建仍然失败并且同样的错误仍然存在。
添加 AF SDK 的引用时,您应该使用位于 GAC Assemblies 中的 4.0.0.0 版本,而不是直接从文件资源管理器中选择它!这意味着您的 AF SDK 安装已通过 PI AF 客户端安装工具包.
正确完成
- 2.0.0.0 程序集针对 .net framework 3.5,是 AF SDKlegacy/obsolete 版本
- 4.0.0.0 程序集针对最新版本的 .Net 框架。
此处 PI AF SDK 文档中的更多信息:PI AF SDK Documentation
Deployment of your compiled code: The target client computer for your code must have PI AF Client installed (AF SDK is the only item necessary). Then you just need to copy the compiled executable (and your .dll if any) of your .NET application (do not use a copy of AFSDK.dll from the developement machine.). Then the .dlls from the GAC will be used on the client and everything will work as expected.
我正在使用 OSIsoft AF SDK 版本 4。
添加引用后一切正常,visual studio 可以看到 OSISoft 名称空间和所有内容。但是当我尝试构建时,我在输出 windows 中收到此错误并且构建失败。
找不到类型或命名空间名称 'OSISoft'(是否缺少 using 指令或程序集引用?)
有什么解决办法吗?
我删除并重新添加了参考。打开和关闭 VS 并检查 .Net 框架版本(实际上我尝试了所有可用版本)。但是,构建仍然失败并且同样的错误仍然存在。
添加 AF SDK 的引用时,您应该使用位于 GAC Assemblies 中的 4.0.0.0 版本,而不是直接从文件资源管理器中选择它!这意味着您的 AF SDK 安装已通过 PI AF 客户端安装工具包.
正确完成- 2.0.0.0 程序集针对 .net framework 3.5,是 AF SDKlegacy/obsolete 版本
- 4.0.0.0 程序集针对最新版本的 .Net 框架。
Deployment of your compiled code: The target client computer for your code must have PI AF Client installed (AF SDK is the only item necessary). Then you just need to copy the compiled executable (and your .dll if any) of your .NET application (do not use a copy of AFSDK.dll from the developement machine.). Then the .dlls from the GAC will be used on the client and everything will work as expected.