Skip to Content
0

SP21 System.InvalidCastException with VS2015 and VS2017 for SetDataSource

Sep 14, 2017 at 05:55 AM

157

avatar image
Former Member

Hello - I installed SP21 for Visual Studio 2015 and 2017 - but when I run a report that works with SP20 in VS2015, with SP21 it shows an error in both VS2015 and VS2017 System.InvalidCastException occurred for ReportDocument.SetDataSource(mydataset) I ran the install as Administrator I have Windows 10 version 1703 Net Framework is 4.5 Please advise - Thank you

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Don Williams
Oct 31, 2017 at 08:13 PM
0

Did you remove all of the CR assemblies and then add the new 13.0.3500.0 versions?

Don

Share
10 |10000 characters needed characters left characters exceeded
Don Williams
Sep 14, 2017 at 09:48 PM
0

Hi David,

Remove the LegacyMode from the <start> section in your app.config file now. It's not need now that CR is using the updated Framework.

Don

Show 3 Share
10 |10000 characters needed characters left characters exceeded
Former Member

I have the same trouble, with SetDataSource(Ds) but in web application, i don't have any app.config file.

0

edit your web.config file

0
Former Member

Hi Don

In my web.config i don't have any LegacyMode label or start section.

I was using my web.config with Visual Studio 2012 and i haven't had any trouble, and i haven't need the start section

in my web.config, now i'm trying Visual Studio 2017 and crystal reports sp21.

Regards

0
avatar image
Former Member Nov 06, 2017 at 12:32 AM
0

I could resolve, taking out all crystal reports references in my web.config (13.0.2000 and 13.0.3500),

and changing from net.framework 3.5 to 4.6.1 in the application properties.

Thxs

:) :)

Share
10 |10000 characters needed characters left characters exceeded