C++/CLI using .NET 2+ [duplicate] - .net-4.0

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Change C++/CLI project to another framework than 4.0 with vs2010
I wrote a hello world app in C++/CLI and i compiled (with safe clr) and ran it under windows. No problem. I ran it under linux and i got this error
WARNING: The runtime version supported by this application is unavailable.
Using default runtime: v1.1.4322
How do I compile C++/CLI so it will work for either .NET run time 2/3.5 or .NET 4?
-edit- I found this answer why says mono 2.6 falls back (or reports?) version 1 when it comes across .NET 4 runtimes. Ok, so now i know this is a .NET 4 runtime but how do i compile it as .NET 2 or 3.5? I rather deal with .NET 4 than 1 so good :). But my server isnt setup for that ATM (monos VM image is tho which i am testing now with success)

The VC++ 2010 compiler only generates .NET 4.0 assemblies.
The VC++ 2008 compiler only generates .NET 2.0-3.5 assemblies.
If you have VC++ 2008 installed, you can instruct Visual Studio 2010 to use the VC++ 2008 compiler which will create a .NET 2.0-3.5 assembly. Simply change the "Platform Toolset" setting under project properties to "v90".

Related

SAP NCO x64 Visual Studio 2013 VB aspx page directive error

I have had a website up and running for over 3 years with SAP .net connector 3.0 in 32 bit format. Unfortunately the Windows 2003 server that was hosting this application has failed. Our network team has created a new Windows 2012 server, and request the website be re-written in 64 bit. I have successfully added the reference to the x64 version of sapnco dll's, but now when I try to compile website, I'm getting an error on my page directive.
The error is "ASP.NET Runtime error: Object reference not set to instance of an object"
None of the code itself (ECCDestConfig.vb and code behinds) does not show any errors. This error is appearing on the page directive of ALL my .aspx web pages in this project, even pages that don't call SAP.
I have set the configuration manager to use x64 as the active solution platform.
I am really stuck - and could use some help.
SAP .NET Connector needs Microsoft Visual C++ runtime of a specific version, which depends on both the .NET framework version and the version of the Operating System (32-bit or 64-bit).
According to the SAP official documentation, you need one of the followings:
NCo 3.0 32-bit (x86), .NET 2.0 (also 3.0, and/or 3.5): Microsoft Visual C++ 2008 Redistributable Pack (x86) (mscvp80.dll)
NCo 3.0 64-bit (x64), .NET 2.0 (also 3.0, and/or 3.5): Microsoft Visual C++ 2008 Redistributable Pack (x64) (mscvp80.dll)
NCo 3.0 32-bit (x86), .NET 4.0: Microsoft Visual C++ 2010 Redistributable Pack (x86) (mscvp100.dll)
NCo 3.0 64-bit (x64), .NET 4.0: Microsoft Visual C++ 2010 Redistributable Pack (x64) (mscvp100.dll)
Problem solved. I used VB in Visual Studio 2013 with the 64 bit SAP .nco . The problem was I had created a "website" not a new "project. Once I did, and loaded the SAP DLL's as references to the project, and changed the configuration to use x64, new web pages I added did so without error. I might note, I aslo installed SAP GUI 730 on the same server. Its working now, both interacting with SAP and a separate SQL database,
Thanks for your answer
To be able to execute the x64 dlls in VStudio, it must be verified that the project is being compiled also in x64. You have to go to Tools, Options ..., Projects and Solutions, Web Projects. And check "Use the 64 bits."

CMake: "cl.exe not able to compile a simple test program"

I want to build DCMTK in Visual Studio 2010.
I followed the advice here enter link description here, as the image shows.
And I still get the same error. Any ideas?
Run the following script before running cmake.
>vcvars32 (to set some system vars, C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat)
A similar problem has been reported here
The solution is:
First, check if you have .NET 4.5 on your system. If you do, that is very likely causing the problem. Try either upgrading to VS2010 SP1 or downgrade .NET to 4.0
CAUSES:
This error appear because you have installed Visual C++ 2012 after you have actually installed Visual C++ 2010 in your system; another cause is because .net Framework 4.5 replace .net Framework 4.0; .net Framework corrupted files;
HOW TO SOLVE:
Uninstall .NET Framework 4.5 from your system; then download .NET Framework 4.0 and install it; this should fix your problem;

Do VB .net Apps absolutely require .net framework to run? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Is the .Net framework required for even a single line of VB.Net?
I'm getting my programming feet wet by designing a simple vb .net program to run utilities and installations from a flash drive. I'm making good progress with the coding and design but I was surprised when I went to show off my work on a system with a fresh XP installation and got a "Not valid win32 application" error when I started the exe. Pretty embarrassing actually.
Is having the .net framework installed essential to loading a .exe coded in vb .net? If this is the case, is the only alternative to try and adapt the code to vbs script or something similar? Are there any other reasonable workarounds short of installing .net on the target system? Thanks in advance.
Yes.
It's named VB.Net for just that reason. :)
Adapting the code to VB6 (which needs a different series of DLLs installed on the target machine) or to VBScript will likely be quickest.
Yes, VB.Net does require the .Net Framework. However, Windows XP is getting pretty old now, and recently dropped below a 25% installed base on some indexes. Windows 7 ships with .Net 2.0 out of the box, and Windows 7 sp1 also has .Net 3.5 at least available on the machine.

Targeting .NET 4.0 in VS 2012 on Windows 8

I just installed VS 2012 Ultimate RTM on Windows 8 Pro RTM and tried to open a solution containing several projects (class libraries and WinForms) targeting .NET 4.0.
When the solution is loaded, VS prompts that .NET 4.0 isn't supported. It gives me the chance to update my projects to 4.5 (and promises that I could change the target later) or install a "Multi targeting pack" for 4.0 from this page.
I decided to update my projects to 4.5 because I had no luck installing the offered Multi targeting pack (errors see below).
Unfortunately, VS does not show 4.0 as a target by default (when changing the target for an updated project), but redirects me to the page where I can download the Multi targeting pack.
So far so good, but I wasn't able to install any of the offered downloads (neither runtime nor targeting pack) again.
The error message says in case of .NET Framework 4.0.3 Targeting Pack:
Setup has detected that this computer does not meet the requirements to install this software. The following blocking issues must be resolved before you can install KB2600213 software package.
Installation Requirements:
Microsoft .NET Framework 4 Multi-Targeting Pack was not found. Please repair your installation for Microsoft Visual Studio 2010 in order to get this update.
Strange enough since I have no VS2010 installed.
.NET Framework 4.0.3 Runtime Installation stops with the following error:
KB2600211 does not apply, or is blocked by another condition on your computer.
I've checked that .NET 4.0 is installed (using the .NET Installation verification tool), I've tried to repair VS2012 but nothing let me target .NET 4 and the Event log does not contain any related reports. Any suggestions or hints (besides going back to Win7/VS2010)?
I'm honestly not sure what's going on. I have VS 2012 Ultimate RTM and all versions of .NET are supported.
I'm almost positive I never installed any .NET frameworks manually, though I did install Visual Studio 2010 Express for Windows Phone from http://create.msdn.com.

Development for .NET 4.0 (Windows XP) with Visual Studio 2012

.NET 4.5 is an in-place-upgrade and therefore replaces .NET 4.0. Consequently when I install .NET 4.5 with Visual Studio 2012 I can no longer develop applications for .NET 4.0.
As .NET 4.5 is not supported under Windows XP, how can I maintain my existing .NET 4.0 applications which still have to run under Windows XP after I installed Visual Studio 2012?
Until now I could always devlop .NET applications for every version, even .NET 1.1, as long as VS2003 was installed. I don't have a problem with Microsoft not supporting .NET 4.5 on XP, I think it's allright to cut off old stuff.
But as we have still customers using Windows XP, we need to be able to create .NET 4.0 programs at the same time as .NET 4.5.
EDIT:
I just had my first incompatibility issue: I installed VS 2012 on a Windows Server 2012. I created a project targeting .NET 4.0. In blend 4.0 I create a copy of a control template of a checkbox. The generated template contains references on colors which are available only under .NET 4.5. The solution cannot be compiled any longer. However the same case works fine on my Windows 7 installation.
I assume that the installation of .NET 4.5 has replaced the control templates for my standard controls. Therefore I cannot create copies any longer.
Ironically, it seems Mono supports much of the .NET 4.5 functionality, and that it can be installed on Windows XP.
If your need C# 5.0's async and your client refuses to upgrade it's OS, this can be an option.
I have run into some serious issues developing .NET programs for 4.0 against computers with 4.5 installed. One issue, for instance, is that if you are doing WPF development and have a private setter on a property - if you're binding to that property with Mode=TwoWay, you will not get an exception if you're developing against .NET 4.5! You should get an exception and you will if you're in an environment with only .NET 4.0 installed (even though you're developing to target 4.0 in Visual Studio). Now obviously you should not have Mode=TwoWay and a private setter, but maybe you had originally intended for the property to be only OneWay. The point is that this is just one of many examples of issues that are simply swept under the rug by 4.5 and has caused me to go back to developing in Windows 7 with Visual Studio 2010 and .NET 4.0 for anything targeting .NET 4.0.
In the meantime I have found a great blog of Scot Hanselman which answers my concerns: http://www.hanselman.com/blog/NETVersioningAndMultiTargetingNET45IsAnInplaceUpgradeToNET40.aspx
.NET 4.5 is an in-place-upgrade and replaces the .NET 4.0 CLR, but it will still be possible to create .NET 4.0 applications with Visual Studio 2012.
EDIT: I now installed the final release of VS2012. My existing .NET 4.0 projects compile and run, no problems so far. The only drawback is, it doesn't support Windows Installer Projects any longer. You can switch forward and backward between VS2010 and VS2012.
BIG EDIT: We should wait until Microsoft announces the final decision, it's not clear yet, only conclusions.
But, I think that Microsoft won't drop support for XP and Vista that easy, it appears that the matter of decreasing support is just for speed-purposes to show it to the developers.
Also, if the it comes true and Microsoft Stopped the support for XP and Vista, then you have the virtual machine as an excellent choice!
Best wishes