Re-Targeting .NET Framework in Visual Studio
up vote
-1
down vote
favorite
I have an old program that is targeting dotnet framework v4.0, and I am trying to run and edit it in visual studio 2017. I've tried editing the targeting manually in the .csproj file, with no success, normally with the following error:
[fail]: OmniSharp.MSBuild.ProjectLoader
The reference assemblies for framework ".NETFramework,Version=v4.0" were not found.
To resolve this, install the SDK or Targeting Pack for this framework version or retarget
your application to a version of the framework for which you have the SDK or Targeting
Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC)
and will be used in place of reference assemblies. Therefore your assembly may not be
correctly targeted for the framework you intend.
Is there a simple way to retarget this or is there something I am missing in my setup of the program? The code was retrieved from another computer (which no longer exists), so I don't know what the environment was on it.
This is the opening part of my .csproj file:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{526AF6ED-D8AE-460A-AA38-FAF6FCAEBDF7}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DDMFeedbackVS</RootNamespace>
<AssemblyName>DDMFeedbackVS</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
c# .net
add a comment |
up vote
-1
down vote
favorite
I have an old program that is targeting dotnet framework v4.0, and I am trying to run and edit it in visual studio 2017. I've tried editing the targeting manually in the .csproj file, with no success, normally with the following error:
[fail]: OmniSharp.MSBuild.ProjectLoader
The reference assemblies for framework ".NETFramework,Version=v4.0" were not found.
To resolve this, install the SDK or Targeting Pack for this framework version or retarget
your application to a version of the framework for which you have the SDK or Targeting
Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC)
and will be used in place of reference assemblies. Therefore your assembly may not be
correctly targeted for the framework you intend.
Is there a simple way to retarget this or is there something I am missing in my setup of the program? The code was retrieved from another computer (which no longer exists), so I don't know what the environment was on it.
This is the opening part of my .csproj file:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{526AF6ED-D8AE-460A-AA38-FAF6FCAEBDF7}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DDMFeedbackVS</RootNamespace>
<AssemblyName>DDMFeedbackVS</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
c# .net
Usually when you open the project, the VS asks you if you want to retarget the project. It's not you case?
– Patrik Valkovič
Nov 13 at 17:57
Nope. I open through command prompt right now, and it opens up directly.
– Sbradley
Nov 13 at 18:05
Can't you just change target framework by hand in.csproj
file<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
and put a newer version that you have SDK/Targeting pack for? docs.microsoft.com/en-us/visualstudio/msbuild/…
– ironstone13
Nov 13 at 18:08
I ended up reinstalling the targeting pack and doing that, which has solved that particular issue, but brought up a bunch more compiler errors. But I'll troubleshoot those separately. Thanks!
– Sbradley
Nov 13 at 18:39
add a comment |
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
I have an old program that is targeting dotnet framework v4.0, and I am trying to run and edit it in visual studio 2017. I've tried editing the targeting manually in the .csproj file, with no success, normally with the following error:
[fail]: OmniSharp.MSBuild.ProjectLoader
The reference assemblies for framework ".NETFramework,Version=v4.0" were not found.
To resolve this, install the SDK or Targeting Pack for this framework version or retarget
your application to a version of the framework for which you have the SDK or Targeting
Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC)
and will be used in place of reference assemblies. Therefore your assembly may not be
correctly targeted for the framework you intend.
Is there a simple way to retarget this or is there something I am missing in my setup of the program? The code was retrieved from another computer (which no longer exists), so I don't know what the environment was on it.
This is the opening part of my .csproj file:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{526AF6ED-D8AE-460A-AA38-FAF6FCAEBDF7}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DDMFeedbackVS</RootNamespace>
<AssemblyName>DDMFeedbackVS</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
c# .net
I have an old program that is targeting dotnet framework v4.0, and I am trying to run and edit it in visual studio 2017. I've tried editing the targeting manually in the .csproj file, with no success, normally with the following error:
[fail]: OmniSharp.MSBuild.ProjectLoader
The reference assemblies for framework ".NETFramework,Version=v4.0" were not found.
To resolve this, install the SDK or Targeting Pack for this framework version or retarget
your application to a version of the framework for which you have the SDK or Targeting
Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC)
and will be used in place of reference assemblies. Therefore your assembly may not be
correctly targeted for the framework you intend.
Is there a simple way to retarget this or is there something I am missing in my setup of the program? The code was retrieved from another computer (which no longer exists), so I don't know what the environment was on it.
This is the opening part of my .csproj file:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{526AF6ED-D8AE-460A-AA38-FAF6FCAEBDF7}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DDMFeedbackVS</RootNamespace>
<AssemblyName>DDMFeedbackVS</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
c# .net
c# .net
asked Nov 13 at 17:55
Sbradley
11
11
Usually when you open the project, the VS asks you if you want to retarget the project. It's not you case?
– Patrik Valkovič
Nov 13 at 17:57
Nope. I open through command prompt right now, and it opens up directly.
– Sbradley
Nov 13 at 18:05
Can't you just change target framework by hand in.csproj
file<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
and put a newer version that you have SDK/Targeting pack for? docs.microsoft.com/en-us/visualstudio/msbuild/…
– ironstone13
Nov 13 at 18:08
I ended up reinstalling the targeting pack and doing that, which has solved that particular issue, but brought up a bunch more compiler errors. But I'll troubleshoot those separately. Thanks!
– Sbradley
Nov 13 at 18:39
add a comment |
Usually when you open the project, the VS asks you if you want to retarget the project. It's not you case?
– Patrik Valkovič
Nov 13 at 17:57
Nope. I open through command prompt right now, and it opens up directly.
– Sbradley
Nov 13 at 18:05
Can't you just change target framework by hand in.csproj
file<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
and put a newer version that you have SDK/Targeting pack for? docs.microsoft.com/en-us/visualstudio/msbuild/…
– ironstone13
Nov 13 at 18:08
I ended up reinstalling the targeting pack and doing that, which has solved that particular issue, but brought up a bunch more compiler errors. But I'll troubleshoot those separately. Thanks!
– Sbradley
Nov 13 at 18:39
Usually when you open the project, the VS asks you if you want to retarget the project. It's not you case?
– Patrik Valkovič
Nov 13 at 17:57
Usually when you open the project, the VS asks you if you want to retarget the project. It's not you case?
– Patrik Valkovič
Nov 13 at 17:57
Nope. I open through command prompt right now, and it opens up directly.
– Sbradley
Nov 13 at 18:05
Nope. I open through command prompt right now, and it opens up directly.
– Sbradley
Nov 13 at 18:05
Can't you just change target framework by hand in
.csproj
file <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
and put a newer version that you have SDK/Targeting pack for? docs.microsoft.com/en-us/visualstudio/msbuild/…– ironstone13
Nov 13 at 18:08
Can't you just change target framework by hand in
.csproj
file <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
and put a newer version that you have SDK/Targeting pack for? docs.microsoft.com/en-us/visualstudio/msbuild/…– ironstone13
Nov 13 at 18:08
I ended up reinstalling the targeting pack and doing that, which has solved that particular issue, but brought up a bunch more compiler errors. But I'll troubleshoot those separately. Thanks!
– Sbradley
Nov 13 at 18:39
I ended up reinstalling the targeting pack and doing that, which has solved that particular issue, but brought up a bunch more compiler errors. But I'll troubleshoot those separately. Thanks!
– Sbradley
Nov 13 at 18:39
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53286903%2fre-targeting-net-framework-in-visual-studio%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Usually when you open the project, the VS asks you if you want to retarget the project. It's not you case?
– Patrik Valkovič
Nov 13 at 17:57
Nope. I open through command prompt right now, and it opens up directly.
– Sbradley
Nov 13 at 18:05
Can't you just change target framework by hand in
.csproj
file<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
and put a newer version that you have SDK/Targeting pack for? docs.microsoft.com/en-us/visualstudio/msbuild/…– ironstone13
Nov 13 at 18:08
I ended up reinstalling the targeting pack and doing that, which has solved that particular issue, but brought up a bunch more compiler errors. But I'll troubleshoot those separately. Thanks!
– Sbradley
Nov 13 at 18:39