when should I use VS2015 platform toolset V140_XP? - c

I want to switch from VS2010 to VS2015 but the documentation about V140_XP is not clear to me. I have two questions about it:
I use static library(/MT). so I don't need vcruntime140.dll or any other previous runtime library. Should I set platform toolset to V140_XP to run my application in windows XP or not?
Will my application run OK on windows 7 and later if I don't set platform toolset to XP?

You only need the v140_XP toolset if you're targetting Windows XP machines (which in new applications you should not be doing).
All later versions of Windows (Vista and up) are supported by the v140 toolset, but applications built with the v140 toolset will not run under XP.

Related

Can i develop Windows 7 desktop apps using Windows 10?

Is it possible to develop desktop applications for Windows 7 using a machine running Windows 10? I am trying to use WPF for developing the app and have Visual Studio 2015 installed on my device.
I am aware that its not possible to develop Windows 8/10 stores apps on Windows 7 but am not sure if its possible the other way round?
Yes, there is no reason why you couldn't do that.
you can develop a backward compatible WPF app on Windows 10 as long as you don't run code that uses APIs introduced in Windows 10 when it runs on another version of Windows.
You can detect Windows version or better detect features to ensure your app will use the right API depending on the OS it runs.
Check the System.Environment.OSVersion API to detect Windows version

Application that works on pc and mobile

I have to create an application with metro design on vs2010 and windows 7.
The application should work both on pc and device without internet.
Initially i though of wpf but i do not know if it works on Mobile.
Please let me know how i can develop once such standalone application for
both device and PC also
Unfortunately, there is not a single platform that targets both PC and Phone...although, the presumption is that Windows Phone and Windows Store applications are moving toward a unified foundation.
Windows Store applications unfortunately don't run on Windows 7. Only Windows 8 and above, but the advantage is they work with the desktop version as well as the tablet version of windows.
If you want to target windows 7 and say windows phone as well, your best bet is to use portable class libraries to create a common "core" for the application. And use WPF for the desktop which has a lot in common with XAML for Windows Phone.
If you want to target windows phone 8, you have to use Visual Studio 2012 or above.
Pretty old question, but in case anyone is still blindfolded, there is UWP.
Furthermore, if you want to have XAML and C# deployed as native apps in a variety of platforms (UWP, Droid, iOS, WinPhone), be sure to check out Xamarin, which now belongs to Microsoft, and follows the awesomeness of open-source MIT just as the entire .NET does now.

Is prism using legacy code?

We are using prism for developing WPF applications. The newest(4.1) version supports only windows 7 and windows server 2008 as per the following link
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=28950
This begs a question. As far as I know specific operating system support is only required for assemblies with legacy code. If the assembly is completely written in .NET it just need the .NET frame work support as this itself is a "virtual machine".
If this is true is prism contains legacy code?
The Prism 4.1 Deveoper's Guide provided here says the following:
This guidance was designed to run on the Microsoft Windows 7, Windows Vista, or Windows Server 2008 operating system. This version has been smoke tested on Windows XP Professional and Windows Server 2003, but it has not been exhaustively tested. WPF applications built using this guidance require the .NET Framework 4.0 and Silverlight applications require Silverlight 5.
All this means is that they haven't tested it on XP, but you needed XP SP 3 and above for the last release (the minimum for .NET 4.0), so my guess is it will likely work for new projects.
No need to panic.

WPF one executable file from project

I have a WPF project with one external library. Is it possible to make one executable file "*.exe" from this project to run on windows systems even without .net? and how to insert that library into .exe file?
You will need to have the .net framework installed on the clients pc. What this says is that since .Net has been preinstalled on Windows since XP SP1, you should target your application to the runtime that is available on the system you wish to install it on. And since you are targeting WPF you will need to make sure that you have available .net 3.5 or greater. You may want to look into the Client installation of the framework since it is smaller. And you may want to look at this Stackoverflow question
i.e. from above link
Windows .Net Framework
Win 7 SP1 4
win 7 3.5.1 ( can be updated to .Net Framework 4 through windows updates )
windows vista 3.0 ( can be updated to .Net Framework 4 through windows updates )
windows XP Sp 1 2.0
You must have .net installed to use a wpf application. You can use clickonce to make the install experience more friendly to the user, if he doesn't the right version of the .net framework installed.
As for the external third party library, see my answer here for the same issue.

some troubles with WPF and Windows XP

is .net framework 3 compatible with xp? i install visual studio 9.0 (.net 3.5) on win XP. when i compile a WPF project and try to run it, this error occurs:
cannot initialize application ...... at address 0x<some digits>
(antivirus protection is off)
after first fail of wpf, all other project types (windows application, console &...) after compiling don't run.
where is problem?
WPF and .NET 3.5sp1 are supported on XP. You can create WPF applications with run on Windows XP.
It sounds like you have some other issue on your XP system. If other project types (ie: console) are failing, this is most likely some other, more serious issue.
Edit:
The System Requirements for .NET 3.5sp1, including WPF, are listed here. Basically, you need to have XPsp2 or better if you're using 32bit Windows XP, but both 32bit and 64bit XP are supported fully.

Resources