Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Can we migrate between .NET versions in Visual Studio?

Can we migrate between .NET versions in Visual Studio?

Can we migrate between .NET versions in Visual Studio?

Hi all,

First time posting.

An application was originally developed in older versions of VS, and is currently maintained in Windows 10 / VS 2017. The application executes on .NET 4.0, but there are some features of .NET 4.5.1 that I would like to take advantage of.

Changing the application target from .NET 4.0 to .NET 4.5.1 did not help because the referenced assemblies were still .NET 4.0

Manually editing app.config and changing the supported runtime version also had no effect. Removing the .NET 4.0 assemblies and referencing .NET 4.5.1 was a near miss: the change updated Intellisense and a build succeeded, but its world fell apart at runtime by loading the .NET 4.0 assemblies and throwing the most peculiar exceptions declaring "bug"

I was annoyed and tried all of the above and setting a search path to the .NET 4.5.1 assemblies. This made the refences in VS2017 look right, and the .NET 4.5.1 features are picked up by intellisense ... but build failed and bigger problems emerged!

CODE -->

'byte[]' does not contain a definition for Length
object does not contain a constructor that takes 0 arguments
'System.Boolean' is not defined or imported
(attached screenshot shows over 3000 more ...) 

Please tell me why I am finding it so hard to migrate from .NET 4.0 to .NET 4.5.1

Most assemblies with version are from .NET 4.0
System.Runtime is from .NET 4.5.1

There seemed to be no references to .NET 4.0 in the project, so what causes the error output referencing the automagically added mscorlib and user specified System.Runtime

CODE -->

Severity	Code	Description	Project	File	Line	Suppression State
Error	CS0433	The type 'AssemblyCompanyAttribute' exists in both 'mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' and 'System.Runtime, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'	AssemblyInfo.cs	12	Active 

I tried undoing all this by removing the 4.5.1 Assemblies from the project and reverting to .NET 4 settings. This also failed. VS2017 requires references to the previous file versions, and those probably came fom GAC. I cannot find the .NET 4 assemblies on the filesystem and they are not downloadable for Windows 10.

Visual Studio seems unable to recover from this. Source control cannot help because the code has not changed. How do I make this go away? Please help, many thanks!

Promised screenshot: http://files.engineering.com/download.aspx?folder=...

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close