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>









share|improve this question






















  • 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















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>









share|improve this question






















  • 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













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>









share|improve this question













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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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


















  • 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

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















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






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

How to change which sound is reproduced for terminal bell?

Can I use Tabulator js library in my java Spring + Thymeleaf project?

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents