I just installed new VS and opened existing project.
It is showing error:
"The C# project "..." is targeting ".NETFramework,Version 4.7" which is not installed on this machine...
But I just installed new VS (November 2018) and pretty sure it comes with newer .NET.
What configuration settings I should change to make this work (open existing project with correct .NET version)?
Right click on project, Properties --> Application --> Target framework. Target framework dropdown displays list of frameworks installed on your machine.
It's not enough to install the latest version of Visual Studio; you need to ensure that you're actually installing the version of .NET Framework you want. It won't install all of them by default.
Re-run your Visual Studio 2017 installer.
It should detect that you already have Visual Studio 2017 installed, and click Modify.
After that, click on the box that says .NET Desktop Development (note, don't uncheck the box -- simply click the box itself). On the right pane, you should see some optional components. If you see .NET Framework 4.7 development tools unchecked, that means it is currently not installed and you need to check that box and anything else additional that you need, and install it.
Conversely, you can also go to the Individual Components section and find the .NET Framework 4.7 SDK/Targeting Pack components and install them from there as well (they should be at the top of the list).
Related
When I try to right click (in the Solution Explorer) and add the existing project to solution, I get the error:
The .NET Core SDK cannot be located. .NET Core debugging will not be enabled. Make sure the .NET Core SDK is installed and is on the path
I checked here (where they get the same error on VS Code) and tried repairing, installing, reinstalling Visual Studio and my .Net 6.0 and 7.0 SDKs. Made sure to install the SDKs even with VS not open, even after a fresh restart. Nothing worked. Plus, some of those solutions seemed specific to VS code, not VS Studio.
Not sure how relevant this detail is, but this my first attempt at installing Visual Studio on this computer.
The problem persisted regardless of project type (WPF and Console were attempted), .Net version (tried making .Net 6.0 and 7.0 apps, which are the 2 sdks I've got installed), and whether or not I indicated I wanted the project and solution in the same directory.
Those were my guesses, and nothing's worked.
Here's what it looks like when I create a new project:
Open visual studio installer and make sure you have installed .Net Framework Developer correctly.
Select .Net 6.0 on this page
Can you create a wpf .net 6 project according to this flow.
If it still doesn't work, please try the repair button in the installer.
The problem turned out to be that the SDKs weren't ordered correctly in the environment variables. C:\Program Files (x86)\dotnet was listed before C:\Program Files\dotnet. I found the solution here.
Not exactly a duplicate issue though, as issues were sort of different, but had the same fix.
In Rider IDE, I am trying to create a new solution:
But I'm unable to change the .NET Framework as the dropdown is disabled. How can I change the version? I have installed .NET Framework 3.5, 4.5, 4.6.
This is one of the way to change the build framework in Rider. It allows you to switch the MSBuild version explicitly by selecting MSBuild.dll.
When you have multiple .NET framework, you can change it here.
This example is for .NET core project.
In my system I installed latest .NET core RC after which Rider started complaining in older projects (when there were working fine prior to installation)
I had following versions
I selected the older version of MSBuild.dll and my project were back to normal.
in Rider IDE in solution explorer - right mouse click on the project,
in properties (left pane) select Application (should be selected by default)
in the right - change Target framework - click on ellipses, check your new framework
Save
Actually for now Rider contains the only one Web App Template - for net45.
We are going to add another one - for net4.6.1 (or 4.6.2) in 2018.1.
You can track status here: https://youtrack.jetbrains.com/issue/RIDER-10888
The main issue here - we can not just change target framework version, but change all referenced package versions and some template files...
#FaizanRabbani You should have installed suitable .NET Developer Pack to change this option. You can download it from https://www.microsoft.com/net/download/windows
I am trying to make a simple Windows Forms app that communicates with Arduino.
As this is my first WinForm application, I am currently stuck on the publish process.
I manage to publish the app with a installer, but, when I open the installer, it asks for the .NET Framework 4.6.2 to be installed.
I tried targeting the .NET 4 version on my project, but the installer keeps requiring the 4.6.2.
Do you know how to solve this? OR is this maybe due to the installer itself needing the 4.6.2 framework?
Thanks,
did you change the .net version required on the installer project ? if not, you should check your launch conditions (right click your project → vies → launch conditions). There you can right click ".NET Framework" and chose properties. In the properties window you can adjust your .net version required.
I'm assuming you use the installer projects from the "Visual Studio Installer Projects" extension.
I've got a simple ClickOnce application - it only targets .NET 2.0, but in the prerequisites I've got to select .NET 3.5 as a minimum prerequisite, whereas I really want to have .NET 2.0 as a prerequisite.
I'm in Visual Studio 2010... What do I do?
Right click on the project, select Properties and then Application. Make sure the target framework is .NET Framework 2.0
(Repeat the operation if your solution contains more than one project.)
Then select Publish. Click on the prerequisites button and make sure that if the setup program creation is selected, on .NET Framework 2.0 is checked.
That should do it.
You can copy the .NET 2.0 bootstrapper package from Visual Studio 2008's folders to Visual Studio 2010's folders and it will magically show up and work.
I would like to know how can i transform a .NET 4.0 VS 2010 C# project intro a 3.x .NET version? I just made an app for someone and i don't think he has the .NET 4.0 platform installed . Any ideas?
Change project target framework to 3.5 might work unless your using some 4.0 specific things.
Or make sure that the user has 4.0 installed if possible.
No, you cannot do it directly. You have three options:
create a new project file that targets the 3.x framework and add the files to it (make sure they are not using v4.0 features)
get your friend to install the v4.0 framework - it is roughly 50MB, not really that big
as Jon pointed out, just retarget your project to v3.x in your VS2010 IDE (in the solution explorer, right click on your project, select Properties, go to the Application tab, use the Target framework dropdown)
if you have completed a reasonable amount of code it may be simpler to just install the new version of the framework.
Change the target framework.
But if you want to use it in Visual Studio 2008 (the URL of your question suggests it), then:
Open the sln file with notepad, and change the following line:
Microsoft Visual Studio Solution File, Format Version 11.00
to:
Microsoft Visual Studio Solution File, Format Version 10.00
The easiest way is to create a new Visual Studio 2008 project with your requirements (.NET version, namespace, etc) and just copy all sources from your Visual Studio 2010 project to that project. The solution explorer has an option that shows all files in your project that are not included, and you can include these files in your project by right clicking on the files and selecting "Include in project." Then just compile and see what problems you get.
Use the "Properties" from the project and select the version of the framework in "Target Framework"; that is required.