Page 1 of 1

Error running executable package - .NET

Posted: Thu Jan 28, 2016 3:01 pm
by bansonln
Product, version and build: 4.2.99
32 or 64 bit version of product: 64-bit
Operating system: Windows 2008 R2
32 or 64 bit OS: 64-bit

I have created a form to reset passwords in SharePoint 2010. In the script I am trying to capture errors. If I run the script in PowerShell Studio it returns the correct error:

I get this error when I package it and run it as an executable: Microsoft SharePoint is not supported with version 4.0.30319.34209 of the Microsoft .Net Runtime.

Re: Error running executable package - .NET

Posted: Thu Jan 28, 2016 3:19 pm
by bansonln
I think I found the solution. I updated the config file for the package and made sure it said this:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v2.0.50727"/>
<supportedRuntime version="v2.0" />
</startup>
</configuration>

It now runs and gives the correct error messages.

Re: Error running executable package - .NET

Posted: Thu Jan 28, 2016 4:17 pm
by DevinL
Glad to know it works! Thanks for the update, and if you have any further issues don't hesitate to make another post.