Sequential workflow console application template missing in VS2010 Ultimate Beta2 - visual-studio-2010

I am using VS2010 ultimate Beta2 and under Visual C# -> Workflow -> I don't see the Sequential workflow console application or state machine console application
Could someone please advise why these are missing in VS2010. I am able to see them on VS2008 ->Workflow.
Thank you

In VS2010 Pro RC1 the sequential workflow console app and state machine workflow console application are only available if you choose .Net Framework 3.5 in the combobox above the project types.
But why worry about beta 2, now that RC1 is out?
I would think that if this is a true and serious error, a bug report is probably better than a SO question.

As Guge says this is by design (It's the same in Beta/RC or RTM). In Visual Studio 2010 you have 2 different versions of Windows Workflow. The new one (4.0) uses a new runtime under the hood and has a WPF look and feel. The designer/activities are different.
The old one (3.5) -also called Legacy- can only be created in Visual Studio 2010 if you change the target framework to 3.5 or 3.0. After you do that you will have the option of State Machine/Sequential WF Console App.
Note however that after you have created the 3.5 workflow you can retarget to 4.0. This will keep the same designer/runtime but it will be running under the 4.0 Framework. Everything will work as expected.
If you try to upgrade and existing VS2008 project you will get the option of doing this.

Related

For Console Application using VS2022, I can't choose the desired .NET Framework

I have a console application. VS2022 is not listing any .NET Frameworks except 6.0 although I have others installed on the machine.
When using a Windows Application (not console application), I get to select the framework I want such as 4.7.2 for example.
I tried to re-install 4.7.2, but the installer was clever and figured that I already have it.
Confusing aspects in the project configuration from within the solution:
When no OS is selected, the programmer gets no warnings.
When OS is selected to be Windows, Not all the available .NET frameworks appear.
My question is how to "make/force" VS2022 to allow me to select the desired framework?
Thanks.

.Net 6 Not show in Visual studio TFM,

It's weird.
If I create a new project and choose DotNet 6 framework by Visual Studio 2022. I will get the NETSDK1045 error code.
But create a new project from the console, everything is Ok.
Run dotnet --list-sdks and see if the expected .NET6 version is installed.
My guess is that you might have x86 issue. If you have installed x64 version, install x86 version and vice versa and test if the issue is gone.
You can also try to repair your VS 2022 instance and/or upgrade to latest official version.
There is also a small probability that you select a project type that does not supports .NET 6 (for example .NET Framework Web App project type).
Also you may check your path contains the dotnet folders in the correct order for your architecture.
References:
https://learn.microsoft.com/en-us/dotnet/core/tools/sdk-errors/netsdk1045
VS2017 : Target framework drop down does not show .NET Core 2.1 option

.net core console application throws System.ExecutionEngineException

I have absolutely no idea what's going on. I create a new project of type .net core console application, hit run and get that exception:
System.ExecutionEngineException
Your app has entered a break state, but no code is currently executing
that is supported by the selected debug engine (e.g. only native
runtime code is executing).
It's quite a while ago when I last ran a .net core project on this machine.
More Information:
It happens only in visual studio. If I run the console via cmd everything works fine. Any idea how to find out what is causing this? I suspect maybe a visual studio extension like Roslynator is causing this exception.
After repairing Visual Studio everything works again.
I was using .net core 2.2 on visual studio 2017 when i had this error.
So I tried .net core 3.0 on visual studio 2019 preview.....
voila, it worked... can't explain it, i guess .net core is constantly improving to support legacy code

How MSBuild multitargeting works

I will try to explain this as clear as I can
I want to fully understand how MSBuild multitargeting works.
I have read several articles from Microsoft and I think I understand the basic but I want to be sure I am not missing anything.
According to Microsoft:
By using Visual Studio, you can compile an application to run on any one of several versions of the .NET Framework. For example, you can compile an application to run on the .NET Framework version 2.0, and compile the same application to run on the .NET Framework version 4. The ability to compile to more than one framework is named multitargeting.
Visual Studio runs under the most current version of the .NET Framework that is installed on the development computer.
http://msdn.microsoft.com/en-us/library/ee395432.aspx
So do this mean that Visual Studio always calls MSBuild from the latest framework installed? assuming Visual Studio 2010 is installed, it will always call: %WINDIR%\Microsoft.NET\Framework\v4.0.30319\MsBuild.exe when building any project targettting any .Net Framework version right???
If yes, then the ability to target old .Net Framewrok versions is based on the ToolsVersion and/or TargetFrameworkVersion properties right???
If yes again, it would mean that just installing the latest framework (and also the older frameworks but not installing visual studio) in my Continuous Integration box, I could point to build always any solution to: %WINDIR%\Microsoft.NET\Framework\v4.0.30319\MsBuild.exe and just specify the ToolsVersion argument (if required, since each project can have its own target version specified in the TargetFrameworkVersion which it would cause to target an older .Net Framework version).
Following this I think my CI box would be building like Visual Studio does. Am I right? What am I missing? Is there a way to be completely sure?
I did a quick test, and I think it works :p the projects are being built according to the .Net Framework specified but like I said I want to be sure I am not missing anything.
Any thoughts?
BTW:
The simple reason to want to do that is because I have several custom MSBuild scripts that are reusable accross projects, but some of the functionality in these scripts require MSBuild 4.0 and also I have several MSBuild tasks built on top of the framework 4.0 so if I have for example a solution targetting the Framework 2.0 and I try to build it using: %WINDIR%\Microsoft.NET\Framework\v2.0.50727\MsBuild.exe I get MSBuild errors trying to load my custom targets
Yes, you've got it mostly correct. Calling MSBuild from the 4.0 directory will do the correct thing against previous versions. They only thing I wanted to add was that 3.5 must be on the box to actually build projects targeting 2.0, 3.0 and 3.5.
This page here: http://msdn.microsoft.com/en-us/library/bb822049.aspx calls out the what versions Windows comes with what version of the framework pre-installed.

Visual Studio 2010 managed c++ targets .NET 2.0 PROBLEM

For someone who's been down this road, please share your breadcrumbs.
I have old VS2005 solution. Most of the parts are c# but I have one c++ managed project. Dev machine: Windows XP. Target framework version: 2.0
I moved the project to the Windows 7 64 BIT, VS 2010, did the project conversion. First thing I noticed were build errors - projects depending on one what is in c++ complained that project referenced has target 4.0 and I want to use it in project that (properly) targets 2.0.
OK, so I used some tips and set my project target to .NET 2.0. NOW: VS2010 complains that it cannot load the project because I need to install framework 2.0. OK, so I try to install it, and nothing - since installer detects .NET 2.0 as a part of the operating system.
WTF?
Admins, please create WTF tag for me here :)
It is not the .NET version that's the problem. The C++ build system currently does not directly support building for pre-.NET 4.0 targets. It requires VS2008 to be installed so it can use its tool chain. Sounds like you don't have it.
This blog post explains the workaround. You can upvote this feedback article if you're unhappy with that. No idea if this is slated to be fixed in SP1, this is not drawing a lot of votes.

Resources