.NET 4 SDK corrupted? with Silverlight 4 Tools install - visual-studio

I installed Silverlight 4 and now my C# projects that use some of the new .NET 4 classes like System.Threading.Parallel and System.Numerics.BigInteger don't appear to be present.
Have tried switching between selected frameworks in the project properties, and downloading and running repair on the .NET 4 SDK, but didn't resolve the issue.
Edit: Project act's like it's being compiled with .NET 3.5 SDK.

Reboot apparently fixed the issue after the repair.

Related

VS writes references to the latest installed .NET Core SDK WinForms assemblies instead of the lowest version

I am writing a WinForms control for .NET 6. The target framework for this project is set as .NET 6.0. It turned out that when I compile the project in the latest VS 2022 (17.1.1) installed a couple of months ago, VS always writes references to the v6.0.2 of WinForms assemblies in the compiled DLL:
I can explain this because 6.0.2 is the latest version of the .NET 6.0 SDK installed on my pc, but why this does not happen for other referenced assemblies like System.Collections or System.Data.Common?
I want to specify the exact version for the WinForms assemblies in the compiled DLL as 6.0.0 to make it possible to launch the DLL with any .NET 6 runtime installed (6.0.1, 6.0.3, 6.1.0, and so on). I did not find a way to do this. I tried global.json and the RuntimeFrameworkVersion key in the csproj file (see also this question), but this did not help.
Is there a way to solve my problem?
I found a solution myself. The problem was in .NET SDK 6.0.2:
6.0.2 SDK update has broken WinForms apps
A solution that helped me was found here:
Issue building with Windows Desktop 6.0.2
All what I needed is to add the following setting to the csproj file:
<ItemGroup>
<FrameworkReference
Update="Microsoft.WindowsDesktop.App.WindowsForms"
TargetingPackVersion="6.0.0" />
</ItemGroup>

CodeTaskFactory" could not be found in the assembly"

I'm new in Dot net after I cloned some project from GitHub, I try to run then got below error.
OS: Mac 10.12.6 (16G29)
Tool version: Visual stuido 2017
SDK: 2
/Volumes/Users/Administrator/Documents/My Web Sites/nopCommerce-develop
/nopCommerce-develop/src/Build/ClearPluginAssemblies.proj(5,5): Error MSB4174:
The task factory "CodeTaskFactory" could not be found in the assembly "/Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/msbuild/15.0/bin/Micro
soft.Build.Tasks.v4.0.dll". (MSB4174) (Nop.Web)
As per the previous answer:
nopCommerce 4.0 has developed with .NET core, but still its targeting to .NET Framework 4.6 and not .NET Core. So you cannot run nopCommerce 4.0 to MAC or Linux.
Still if you would like to run it to cross platform, you can change the targeted framework to .NET Core and solve the errors may you face.

VS2015 .net framework versions are not listed while creating new project

After installing vs2015 with updates on window10, I am not able to select targeting .net framework versions although they are installed and listed on programs and features. .net framework versions are not listing on Create new project window.
I am not able to understand the problem over here. It was working fine previously. Tried to reinstall the vs2015 still same issue. Please need help to solve the issue.
Installed framework versions:
Installed framework versions
Framework versions are not available on create new project window.
framework versions are not available
Thank you.

How can I change the targeted framework from 4.0 to 4.0.3

I have the Portable Library Tools beta 2 installed in Visual Studio 2010. I created a new library and set it to be compatible with .Net 4.0.3 and Silverlight 5. I then tried to add a reference to the PCL project from a Silverlight Web project. I got the message:
Unable to add a reference to project "PortableClassLibrary". The
current project's target framework is not one of or compatible with
the target frameworks of Portable Library project
"PortableClassLibrary".
A Portable Library project's target frameworks can be changed via the
Library tab in the project's properties.
I don't want to change the PCL target, I want to change the target of the Web project. I went the the Properties > Application tab and the Target framework is ".Net Framework 4.0". There wasn't an option for 4.0.3. I checked and realised that the update for 4.0.3 (KB2600211) wasn't installed on this machine, so I installed it and rebooted, as requested.
There still isn't a 4.0.3 option in VS and I'm still getting the message. Any ideas?
EDIT
VS 2010 SP1 is already installed.
To target .NET Framework 4.0.3, you need to install KB2600214, and then change the Project Properties -> Application -> Target Framework to .NET Framework 4.0.3.
You may have to consult this page on Microsoft's site. It offers a few workarounds for these Targeted Framework errors. Personally, I ended up manually modifying this line in my csproj file:
<TargetFrameworkVersion>v4.0.3</TargetFrameworkVersion>

Target Silverlight Version is stuck

I have my shiny new Visual Studio 2010. I want to develop a Silverlight 4 web app with it.
I made a project and it told me that I needed to update my Developer version of Silverlight. I followed the link provided and did what it suggested.
I then went back and created my project (under a different directory).
But when I try to select the target version of Silverlight all I can see is Silverlight 3.
What do I need to do to get this to show the Silverlight 4 option?
Make sure you've installed the Silverlight 4 Tools to enable this all in VS 2010.

Resources