# ArgumentTypeException expected X got X

**URL:** https://forum.alternetsoft.com/t/argumenttypeexception-expected-x-got-x/242
**Category:** AlterNET Studio Support
**Created:** [September 20, 2021, 11:00am UTC](https://forum.alternetsoft.com/t/argumenttypeexception-expected-x-got-x/242 "2021-09-20T11:00:55Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![YesWhyNot](https://forum.alternetsoft.com/letter_avatar_proxy/v4/letter/y/606060/32.png) [@YesWhyNot](https://forum.alternetsoft.com/u/YesWhyNot)
#### Post date: [September 27, 2021, 6:50am UTC](https://forum.alternetsoft.com/t/argumenttypeexception-expected-x-got-x/242/3 "2021-09-27T06:50:49Z")

</div>

Hello,

I solved the problem by using clr.AddReference() instead of AddReferenceToFileAndPath(). Probably the additional copy into sys.path caused the type error problem.

---

_[View the full topic](https://forum.alternetsoft.com/t/argumenttypeexception-expected-x-got-x/242)._
