Problems with using .NET 5 [closed] - c#

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 years ago.
Improve this question
I wanted to play with new features of .NET and C#.
In order to do that, I downloaded newest .NET SDK and .NET runtime and installed it successfully.
Then I tried to create app with new features and failed, as I couldn't set target framework to .NET 5.
So I googled for that and found that I need to enable "using previews of .NET SDKs" in Visual Studio's Tools (Preiview Features tab).
After that, when I created console project, it set my target framework to .NET 5.0, I got this section in my csproj:
<TargetFramework>net5.0</TargetFramework>
Now, when I try to build, I get this error:
The reference assemblies for .NETFramework,Version=v5.0 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks
I tried to search anything about this, but I just run into the same articles suggesting enabling using preivew of .NET Core SDKs.
Also, my VS version is VS Studio Professional 16.7.6 (as far as I remember, other suggestions were about updateing VS to 16.6 or newer).

In terms of development with Visual Studio, .NET 5 requires VS 2019 16.8 or later. I'm using it with .NET 5 without problems.

Related

I can't upgrade my .NET to anything over 4.8 [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 days ago.
Improve this question
I've installed multiple .NET SDKs from Microsoft site. They do not appear in Visual Studio when I want to change it. How do I fix this?
I've downloaded SDKs, Nugets, and nothing. I want to be able to use .net 7+ on a C# project.
Your project is a .NET Framework project (the "older" dot net). You'll not be able to select dotnet 5+ directly in the visual studio project's properties as dotnet net 5+ is the evolution of the dotnet core branch. Those versions will not appear at all.
You can create a new dotnet core project and import your code (and adapt if necessary), or use the tool microsoft released to "upgrade" a .NET Framework project to dotnet core one. (https://dotnet.microsoft.com/en-us/platform/upgrade-assistant)
You'll then be able to select any dotnet core framework you want (ie 7.0)
If your project is targeting .Net framework 4.8, you can't simply upgrade to .Net 7 by selecting from a list,
You need to migrate your project to .Net 7,
A very useful tool is the .Net upgrade assistant provided by Microsoft.
You can find it here:
https://dotnet.microsoft.com/en-us/platform/upgrade-assistant/tutorial/install-sdk
and follow the step-by-step instructions in that page to complete your migration.
Try installing everything related to .NET using the Visual Studio Installer - https://visualstudio.microsoft.com/downloads
In order to be able to create .NET 7 application, you will need to select ".NET 7 Runtime" under the "Individual components" section.
After the installation, you should be able to select ".NET 7" as your application Framework.

Dotnet new project cannot run [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 years ago.
Improve this question
I (almost) try to get an helloworld with dotnet cli on Linux. In fact I simply try to create a MVC project.
I installed (and reinstall multiple times during this process) dotnet-sdk-bin from AUR.
dotnet new mvc -n foo
cd foo/
dotnet run
Result :
It was not possible to find any compatible framework version
The framework 'Microsoft.AspNetCore.App', version '3.1.0' was not found.
No frameworks were found.
You can resolve the problem by installing the specified framework and/or SDK.
The specified framework can be found at:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.AspNetCore.App&>framework_version=3.1.0&arch=x64&rid=manjaro-x64
dotnet --info :
I also tried with and without dotnet-runtim-bin and dotnet-host-bin but the result remain the same. Also found this thread on github but it didn't help me that much.
You need to install the runtime to the AspNetCore, I'm sure that you have the runtime to the .NETCORE, but the Asp is a separate runtime and you need to install, I share the URL https://dotnet.microsoft.com/download/dotnet-core/3.1
NOTE: Remember before you type dotnet run is a good practice dotnet build it's help you to find any break references in your code or any lost library.

Upgrading Visual Studio 2008 to 2013 and .NET 3.5 to 4.5.1 [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I am planning a 3pt upgrade for our solution, and it will include an upgrade from VS2008 SP1 to VS2013 and .NET 3.5 to 4.5.1 (and also MS SQL Server 2008 to 2012) I am trying to prepare as much as possible in advance so that I can provide accurate LOEs and make the process as painless as possible. However, I haven't had any luck finding information about how to upgrade a solution from VS2008 to VS2013. For anyone who has done this before, are there any guides you found useful or problems that you faced that you wish you had addressed before hand?
Without knowing much (really anything) about your project, it is going to be very hard to give you a straight answer. However, I can say this. Microsoft has prided itself since day one on its backwards compatibility. Simply opening the project in VS 2013 will trigger the upgrade process for the actual SLN. This is usually quite painless. Once this is complete, you are still able to target .NET 3.5, so you don't have to make the jump from VS2008 -> VS2013 && NET35 -> NET451 at the same time.
The framework itself shouldn't present you with any serious issues, however any referenced 3rd party dlls can cause (sometimes serious) issues. They may not be maintained anymore, may have changed names, or simply do not exist. In this case you will need to find a new library to do what the old one did, which will require refactoring at best, significant rewrite at worst.
None of this takes into account the features ADDED to NET45 from NET35, such as the async/await keywords and many, many, many other features.
Since your question is very vague, its hard to give you a good answer other than just do it, the update to VS2013 should take very little time, and it will tell you if you are going to have issues even building. Once you do that, it should take no time at all to change your target framework to NET45 or NET451 and find out once again, if you can even compile. Without doing either of those, you cannot possibly estimate the level of work required. Then you still have to do all of your testing to see if something changed at runtime.
The problem is not upgrading from Visual Studio 2008 to 2013, because you can still run and compile .NET 3.5 applications in Visual Studio 2013 just fine. The real time consuming process is migrating from .NET 3.5 to 4.5.1 which can be short or long depending on how large is your application and what technology you use.
Usually, .NET 3.5 is very forward compatible.
Changing from one runtime to another (3.5 to 4.5) is simply a matter of changing a setting in your Project (Target Framework).
Be aware that .NET 4.5 is not supported on Windows XP. If your solution needs to run on XP you need to stay on .NET 4.0 or lower.

Is .net 4.5 a major upgrade to 4.0 or is it just a matter of including updating .dll? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
If my server is currently setup with .net 4.0, is 4.5 a major release or is it something like .net mvc where I just have to include the mvc related dll's in my /bin folder?
.NET 4.5 must be installed on the server. It is not simply a .dll to include. You do have to specify 4.5 in your web.config to use 4.5 features. You only have to include the dlls for packages you use that use the 4.5 framework. I recommend using NuGet package manager to handle this so you don't have to do it manually.
However, in IIS, 4.5 does not appear as a .NET version for application pools and uses the 4.0 runtime. In that sense, it is similar to 3.5 where you need to set your app pool to version 2.0.

The C# project is targeting ".Net Framework, Version =v4.5",which is not installed on this machine [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I am working on a C# project using VS 2012 installed on windows 8 this afternoon. It works well and I upload my code to TFS before I left for home.
But when I download and open this project using VS 2012 installed on windows 7. I got the error message below.
The C# project is targeting ".Net Framework, Version =v4.5",which is
not installed on this machine. To proceed, select an option below.
Change the target to .Net Framework 4.5. You can change back to ".Net Framework, Version=v4.5" at later time.
Download the targeting pack for ".Net Framework, Version=v4.5". The project will not change.
Do not load the project.
I am sure I have installed .Net Framework 4.5 on my windows 7 laptop.
Now, I cannot load my project. Any one knows how to solve this problem?
Many thanks!
--------------- updates--------
For people who have the same problem:
I uninstalled VS 2012 and .Net Framework 4.5 and re install both of them. The problem is solved. Now I can load my project.
Right-click your project and click in "Properties". In the tab "Application" see if you have the option for the 4.5 framework in the "Target Framework" dropdown list. If you have it, just select it and try to build your project again.
If you don't have this option, go to "Programs and Features" in Windows 7 and make sure you have .NET Framework 4.5 installed. If you have it, then try repairing your installation of VS 2012 in this same menu and verify again your options in the "Target Framework" dropdown list.

Categories