I am using vs 2019 version 16.9.4 (april 2021) and wanted to create a WPF App (.NET) project using .NET 5 as described at Microsoft's tutorial (https://learn.microsoft.com/de-de/dotnet/desktop/wpf/get-started/create-app-visual-studio?view=netdesktop-5.0) (january 2021).
Unfortunately, only WPF App (.NET Framework), but not WPF App (.NET) is available in the menu as shown in the tutorial. I also checked the installer for any missing components without success.
Related
I have read all the topics on this. I actually have it working on Visual Studio on one computer. I have used the installer to install the necessary work loads. I have tried downloading dotnet 5 and .net core 3.1. It just will not show up on the create projects window of Visual Studio. I only get WPF App(.NET Framework) or WPF App(.NET). I want to make WPF .netcore applications and this is a roadblock. Else, I can only make .Net Framework applications that can not be used for multi-platform development. I can make a core project in the Visual Studio with wpf .netcore template and then move it to my other computer and it works fine. The template just will not show up for core project (wpf). I am taking a wpf udemey course and it tells of the advantages of using core wpf in many applications.
Open the Visual Studio Installer (This is for VS2022, but the same should apply for 2019.)
Add the ".NET desktop development" Workload (see image below) which allows you to "Build WPF, Windows Forms, and console apps using C#, VB, & F#... "
And then it will appear (or should):
I have downloaded and installed the new .NET framework 5.0 from this website.
But I would like to know how to add this framework to a project created on Visual Studio 2019 16.8.0.
Note:
I have launched VS installer and I have searched for the new framework, but I can't find it.
I have already opened: Project -> Properties -> Target Framework.
But the most recent framework that I got is .NET framework 4.8
How can I add the new framework to the target frameworks in Visual Studio 2019?
Update:
I have a conflict now and I would like to know what's the difference between .NET framework SDK and .NET framework Developer pack, I'm wrong in this point.
As mentioned in the link above, there is no .NET framework 5.0 in the developer pack list.
Can anyone explain this to me?
Download and install the Visual Studio 2019 SDK from the .NET Core releases site.
.NET 5.0 is continued development of .NET Core and it no longer follows the old (.NET 4 and older) targeting pack. Instead, .NET 5 is installed as an SDK into the .NET Core framework & sdk directory structure. For folks who have been doing .NET Core for some time, this feels natural, but coming from .NET 4, it's new.
Create a new .NET Core project type and set the .NET version to .NET 5.0:
There are specific .NET (not .NET Framework) project templates for Winforms and a few other project types. These will also target .NET 5 or .NET Core where appropriate:
Unfortunately, there is no magic wizard to upgrade a .NET 4 project over to .NET 5. The step-by-step guidance can be found here:
Winforms Migration from .NET 4 to .NET 5
WPF Migration from .NET 4 to .NET 5
Many ASP.NET folks have gone through these steps to move from .NET 4 to .NET Core in the past. There are many blog posts on the issues they bumped into and how they solved that. The process is very similar and there are some tools now to help you along the way.
The main steps are the same for every .NET 4 project:
Change your packages.config to <packageReference> format.
Change your project file to the new SDK project format.
Run the API Compatibility analyzers. This will tell you where to expect breaking changes.
Switch the target framework to .NET 5 in the project file
Update/change/add required nuget packages to the versions that support .NET Core/.NET 5.
Fix any build issues.
Alternatively:
Create a new .NET 5 project of the desired target type.
Add the required project configurations etc.
Add the NuGet Packages you're going to need.
Copy the sources over from your .NET 4 project. Or copy the project file into the folder where your existing project resides. It should automatically import all source files.
Fix build issues
It may be possible there won't be a NuGet package of 3rd party components you use that are compatible with .NET 5. In that case you'll need to either wait for one to be released or find an alternative. Of course, in case of open source projects, you could help them out by porting the package for them and sending a pull request.
The Migration guidance linked above gives you multiple approaches to achieve each step.
I have recently created a rehosted Workflow Designer application and noticed that the UI looks outdated when compared with how it looks in Visual Studio. Does anyone know which could be the problem?
No matter what version of .NET I'm using (for example 4.6 or 4.7), the UI still doesn't update. I have also followed the next article to enable Workflow 4.5 features, but without any success on the UI side.
(WF4.5) Enabling new .Net framework 4.5 features in your rehosted designer application https://blogs.msdn.microsoft.com/tilovell/2012/06/04/wf4-5-enabling-new-net-framework-4-5-features-in-your-rehosted-designer-application
In the rehosted WF application it looks like this:
While in Visual Studio 2017 Community Edition if looks like this (notice the updated colours, icons and toolbox):
Any clues? Thanks!
I've previously created a Silverlight application for CRM-2011 and there has been samples for Silverlight in the CRM-2011 SDK. However, I installed CRM 2015 SDK and I couldn't find any sample codes for Silverlight, does it no longer support silverlight ? If it still supports it, how can i create a connection to the CRM 2015 within my Silverlight application ?
Microsoft abandoned Silverlight a couple of years ago, in favour of HTML5. Silverlight is not supported on all platforms (mobile to begin with) and it does not fit in the cross-platform/execute-anywhere strategy Microsoft follows nowadays.
Microsoft may not say this out loud, but Silverlight can be seen as legacy and therefore should be avoided when possible.
However, Dynamics CRM 2015 still supports Silverlight web resources. You can find documentation in the help-file (.CHM) in the SDK. CRM 2011 examples should still work. (B.t.w, Silverlight sample code appears to have been removed from the CRM 2013 SDK already.)
I have discovered that when I install .NET RIA Services (July preview) it breaks all of my projects that were created with Michael Sync's Silverlight MVVM toolkit.
This MVVM toolkit includes a Visual Studio project template which is now failing to build. Here is the message I get:
The project file "..\SilverlightModelViewApplication.Web\SilverlightModelViewApplication.Web.csproj" was not found.
I don't find the string "SilverlightModelViewApplication" anywhere in the solution. I get the same message if I create an empty new project using the template. If I uninstall .NET RIA Services with Programs & Features, my MVVM projects build successfully; when I reinstall .NET RIA Services my projects fail to build again.
How can I debug this? I posted a comment on the MVVM toolkit site but there has been no response. Thanks!
+tom
This question was answered on the MS Silverlight forum by MS engineer Brett Samblanet.
Short-term fix: Turn off the RIA Service link to "SilverlightModelViewApplication.Web.csproj" in the .web project properties.
Long-term fix: Change the MVVM template .csproj file entry for <LinkedServerProject> to an empty entry.