After Installing IronPython Studio or Visual Studio Integration, when
we want to build WPF Application with IronPython we take an error;
"Unknown build error, 'Object reference not set to an instance of an object.'"
To solve this problem
%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config
Copy this code to “Run” which has short cut (Windows+R) or open this file in any text editor from it’s directory.
Add the code below to under <configuration> branch.
<system.codedom>
<compilers>
<compiler language="py;IronPython" extension=".py"
type="IronPython.CodeDom.PythonProvider, IronPython,
Version=1.1.0.0, Culture=neutral, PublicKeyToken=4afbdc4d950a9602" />
</compilers>
</system.codedom>
Close this configuration file after saving.
Now our WPF applications can be built without any error.
We solve WPF problem with this trick but there will be an error in IronPython ASP.NET Projects VS Integrated mode because of this code. To solve this problem in ASP.NET is removing code which we added for WPF Error Problem. If I solve this problems in one trick, i will blog it.
PDF version of this article >>
8 - IronPython WPF Error
If you have any questions or discover any errors / typos please let me know
ik@ibrahimkivanc.com
All The Best!