1

I need to use Powershell ISE to run the method that is in the dll, but it always show this error :

Unable to find type [ExportTestResultNamespace.ExportTestResultClass]. Make sure that the assembly that contains this type is loaded. At C:\selenium\TestInPowerShell_Net.ps1:36 char:1 + [ExportTestResultNamespace.ExportTestResultClass]::WriteAndRead() + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

CategoryInfo : InvalidOperation: (ExportTestResul...TestResultClass:TypeName) [], RuntimeException + FullyQualifiedErrorId : TypeNotFound

Here is my powershell code :

[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()

I really don't know what is wrong, can anybody help me?

  • 1
    Possible duplicate of [How to reference .NET assemblies using PowerShell](http://stackoverflow.com/questions/3079346/how-to-reference-net-assemblies-using-powershell) – vonPryz Dec 23 '16 at 08:55
  • 2
    Are you sure that's the actual namespace and class names? Is `ExportTestResultClass` public? – Mathias R. Jessen Dec 23 '16 at 09:04

0 Answers0