Visual Studio 2015 unrecognized error in Windows Web Services Framework - visual-c++

I see the following error with Visual Studio 2015 (Tried both community and professional edition).
Wrote a simple Visual C++ CosoleApplication which has "printf("Hello World\n");".
Debug with Platform "x86" Compile and step through Works.
Debug with Platform "x64" Compiles but when it runs it throws this error.
Code is simple with following lines:
// ConsoleApplication1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
int main()
{
printf("Hello World \n");
return 0;
}
My desktop has following configuration:
OS: Windows 7 Enterprise 64-bit version
Anti-Virus: McAfee Anti-virus software running; Can't disable that.
Firewall: ON (Can't disable that for security)
Question: Stepping through the code with (Debug x86 platform) works. Why "Debug x64 platform" does NOT work ?
Any suggestion would be helpful.
Thanks
gshant

I was having the same trouble. This is what I did.
Go to Project, Project properties.
Select Application Tab and make note of what framework you are using. For me it was 4.5.2.
Use the pull down to select a different Framework. At the bottom there is an option to install additional Frameworks.
After the web page opens, select the Framework you previously noted and download the Development Pack.
Close Visual Studio and install the Development Pack.
This worked for me when I selected x64.
Hope this helps you.

Make sure you have both the x86 and x64 .NET Core runtimes installed.
https://www.microsoft.com/net/download/windows

This answer deals with using IIS 7 to debug. I have not checked it with IIS Express.
If your web application is 32-bit (x86), you need to run IIS Manager and:
Look at the "Basic Settings" of your web site. Check what IIS
application pool your project is using.
Look at the "Advanced Settings" of this application pool and ensure
that "Enable 32-bit applications" is True.

This was a firewall issue for me. I'm not sure the exact root cause, but I found stopping my firewall resolves this. If I find the exact root cause, I'll update my answer so firewall exception rules can be written.
I believe the issue is when you are debugging it is actually using the remote debugger still under the hood (connecting x86 Visual Studio to an x64 process, etc) and a firewall can block this.

The solution for me was to go:
Project -> Properties -> Build -> Prefer 32-bit enabled
with Platform target -> "Any CPU".

Related

IIS express crashes after successfully debugged and build

I am running my mvc project in visual studio 2013 no errors comes in debugging and all projects build up successfully. after it when visual studio run the project and launch IIS express process it got crashes with following error which comes in result window.
The program '[13280] iisexpress.exe' has exited with code -1073740771
(0xc000041d). The program '[13280] iisexpress.exe: Program Trace' has
exited with code 0 (0x0).
I also re install visual studio reset its all settings problem still exist.
I also check whether iis is working ok? I deployed the websites on iis and they are working fine, Only the websites which i run from visual studio did not work and gives upper mention error message.
I solved my problem myself... I make a couple of changes which solved my problem, Steps are as follows....
Uninstall IIS
1.1. Go to control panel-> Programs and features -> Turn Windows Features On or Off.
1.2 De-select Internet Information Services and Internet Information Services Hostable Web Core.
1.3 Restart the system.
1.4 Go to My Documents and delete folder "IISExpress".
Install IIS again
2.1. Go to control panel-> Programs and features -> Turn Windows Features On or Off.
2.2 select Internet Information Services and Internet Information Services Hostable Web Core.
2.3 Restart the system.
this solved the problem.

running a vc++ command line application on non development machine,

When I run command line application (executable generated using visual studio 2008) on non development windows 7 machine it gives following run time error "application has requested run time to terminate in unusual way. Please contact application support team for more information". It runs fine on a development machine.
With VS 2005 and VS 2008, Visual C++ used a side-by-side versioning scheme that requires manifest entries embeddded in the EXE to really work correctly in all cases. It's possible you are dealing with one of these. See these articles for details on debugging these side-by-side issues.
Diagnosing SideBySide failures
Part 1: Troubleshooting VC++ Side by Side Problems
Part 2: Troubleshooting VC++ Side by Side Problems
Note that with VS 2010 and later, Visual C++ no longer uses this side-by-side scheme. That said, there are still lots of reasons to use embedded manifests anyhow. See this article.

Microsoft SharePoint is not supported in 32-bit process. Please verify that you are running in a 64-bit executable

I'm writing a console app for SharePoint 2013 on a 64-bit machine. I get this error when I try to execute the program:
"Microsoft SharePoint is not supported in 32-bit process. Please verify that you are running in a 64-bit executable."
Please let me know if you've had this problem in the past and can help. Thank you!
Have you checked the the properties for your project? (solution explorer, right click on the project, click on properties)
On the build tab check for that you select "Any CPU".
This worked for me:
In Visual Studio: TOOLS>OPTIONS>Projects and Solutions>WEB PROJECT and Use the 64 bit versions of IIS Express for web sites and projects
I hit this problem while running a Unit Test (well, an integration test in "Unit Test" clothing). Changing the target for the unit test project just made the tests disappear from the Test Explorer. It is possible to run your tests (at least in VS2013+) as an x64 environment.
In Visual Studio, choose Test > Test Settings > Default Processor Architecture > x64.
https://msdn.microsoft.com/en-us/library/ee782531(v=vs.120).aspx
Sometimes, if "Prefer 32-bit" is greyed out, and your Platform Target is already "Any CPU", the problem is that IIS Express is not 32 bit.
The solution is to change the solution's web server to Local IIS.
This blog details the steps in more detail:
Platform Not supported Exception when running Visual Studio Web Application
What worked for me was changing a registry key:
HCU\Software\Microsoft\VisualStudio\12.0\WebProjects\Use64BitIISExpress
to 1, as shown here:
https://rule30.wordpress.com/2015/06/22/microsoft-sharepoint-is-not-supported-in-32-bit-process-please-verify-that-you-are-running-in-a-64-bit-executable/
I got the same issue. The Build tab has the option Any CPU, but still it was not working.
I have selected explicitly x64 as the Platform target, and the application works fine :)
for me it was because of invalid reference to Microsoft.Shareppoint.dllafter migrating to SharePoint 2013 in a console application we used for some automation
just add below address of Microsoft.Shareppoint.dll
Correct
C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.dll
you can found this reference to this correct dll , after creating a empty SharePoint 2013 project in your UAT.
I was getting this error inside my Windows 2012 R2 UAT and Visual Studio 2015 Update 1 , when my reference was incorrectly to a dll found in GAC
Incorrect
C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SharePoint\v4.0_15.0.0.0__71e9bce111e9429c\Microsoft.SharePoint.dll

HTTP Error 404.3-Not Found in IIS 7.5

I'm using IIS 7.5 on Windows Server 2008 R2 x64 Enterprise Edition. In the project we have developed with ASP.NET 4.0 we used WCF Service. But it doesn't run over domain when the software is running from local computer. Otherwise, I am getting the following error:
HTTP Error 404.3-Not Found
The page you are requesting cannot be served because of the extension
configuration. If the page is script, add a handler. If the file should
be downloaded, add a MIME map.
You should install IIS sub components from
Control Panel -> Programs and Features -> Turn Windows features on or off
Internet Information Services has subsection World Wide Web Services / Application Development Features
There you must check ASP.NET (.NET Extensibility, ISAPI Extensions, ISAPI Filters will be selected automatically). Double check that specific versions are checked. Under Windows Server 2012 R2, these options are split into 4 & 4.5.
Run from cmd:
%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -ir
Finally check in IIS manager, that your application uses application pool with .NET framework version v4.0.
Also, look at this answer.
In my case, along with Mekanik's suggestions, I was receiving this error in Windows Server 2012 and I had to tick "HTTP Activation" in "Add Role Services".
In windows server 2012, even after installing asp.net you might run into this issue.
Check for "Http activation" feature. This feature is present under Web services as well.
Make sure you add the above and everything should be awesome for you !!!
I was having trouble accessing wcf service hosted locally in IIS. Running aspnet_regiis.exe -i wasn't working.
However, I fortunately came across the following:
Rahul's blog
which informs that servicemodelreg also needs to be run:
Run Visual Studio 2008 Command Prompt as “Administrator”.
Navigate to C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation.
Run this command servicemodelreg –i.

Is a COMException of 0x80040154 always 'Class not registered'?

Does a System.Runtime.InteropServices.COMException of 0x80040154 always mean that the class isn't registered? I'm getting a COMException which says "Retrieving the COM class factory for component with CLSID {29131539-2EED-1069-BF5D-00DD011186B7} failed due to the following error: 80040154." It's trying to load Interop.Domino.dll which is a reference I got from the COM tab of Add Reference called "Lotus Domino Objects" which points to domobj.tlb in the Notes program folder.
I wrote the code years ago - it's the only thing I've ever done with interop and it's fair to say that I never really got to grips with it.
I'm seeing this error again after moving the code to a 2008 R2 server (so it's x64). It was written on XP and run on 2003 (both x86). In order to diagnose the problem, I built a Win7 x86 (because there's no R2 x86) box and it worked. I also built a 2003 x64 box and it fails with the same error, so it looks like it's caused by moving to x64 architecture. Is there something I should do when doing interop to get x86 COM DLLs to work on x64 machines?
I had the same problem trying to build and run a .NET application on Windows 7 x64 that called interop.domino.dll, which is 32 bit only.
To resolve, I recompiled the .NET application to run specifically as x86 when run on x64 operating systems.
I was using Visual Studio 2010 Express Edition which is trickier to target specifically for x86 platforms than the paid for versions.
The solution was:
Click TOOLS > OPTIONS > PROJECTS AND SOLUTIONS
Check the box "Show advanced build configurations" and click OK
Click TOOLS > SETTINGS > check EXPERT SETTINGS to see the build configuration manager
Click BUILD > CONFIGURATION MANAGER select the platform dropdown to X86 and click CLOSE
Now rebuild the project
Pay attention to register of 32-bit components using the correct register (C:\Windows\SysWOW64\regsvr32.exe).
If you have already registered up with the 64-bit version, unregister each dll with the same version.
More help you find here Team is Going from XP32 to XP64 for .NET Development - Any Gotchas?
Good luck
There's an IBM technote that indicates that the Domino COM classes are not supported on a 64-bit OS. See https://www-304.ibm.com/support/docview.wss?uid=swg21454291 So it seems like even by compiling the code to run as x86 (as per mpownie's answer), you're still taking some chances.

Resources