我需要使用Powershell ISE来运行dll中的方法,但它始终显示此错误:
无法找到类型[ExportTestResultNamespace.ExportTestResultClass]。 确保已加载包含此类型的程序集。在 C:\ selenium \ TestInPowerShell_Net.ps1:36 char:1 + [ExportTestResultNamespace.ExportTestResultClass] :: WriteAndRead() + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~
CategoryInfo:InvalidOperation:(ExportTestResul ... TestResultClass:TypeName)[],RuntimeException + FullyQualifiedErrorId:TypeNotFound
这是我的powershell代码:
[Reflection.Assembly]::LoadFile('c:\users\brian\documents\visual studio 2015\Projects\NunitTestLibrary\NunitTestLibrary\bin\Debug\NunitTestLibrary.dll') |Out-Null
$obj_ETC = [ExportTestResultNamespace.ExportTestResultClass]::Create()
$obj_ETC.WriteAndRead()
我真的不知道出了什么问题,有人能帮助我吗?