Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Unable to find type[ ]: make sure that the assembly containing this type is loaded.

$
0
0

I created an Enum, and while trying to run it by running the command [MyNamespace.MyEnum], I get the error that says"Unable to find type[MyNamespace.MyEnum]: make sure that the assembly containing this type is loaded." This is what my enum looks like

$enum = "
namespace MyNamespace
{
    public enum MyEnum
   {
      value1 = 0, value2 = 1
   }
}"

Add-Type -TypeDefinition $enum -Language CSharp

Does anyone have an idea why I keep getting this error? I really appreciate the suggestions. Thanks.


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>