Could not load type '%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll'. - web-services

New Windows server 2012 R2 installation, added ASP.Net and .Net 3.5
Getting following error when trying to browse web service file svc:
Could not load type '%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll'.
Any thoughts?

Open command prompt as administrator
Navigate to C:\Windows\Microsoft.Net\Framework\v3.0\Windows Communication Foundation
and execute the command:
ServiceModelReg.exe /i
Navigate to c:\windows\Microsoft.NET\Framework\v4.0.30319
and execute the command:
aspnet_regiis -iru
Some roles and features are required on the server
enable server role "Internet Information Services", all underlaying services will be included
enable feature "HTTP Activation", this both under .NET framework 3.5 and .NET framework 4.5
In IIS make sure there is a "handler mappings" configured for the "*.svc" files

That error message turned out to be a bit of a red herring when I encountered it. I simply didn't have a HEAD route setup in WebApiConfig and was getting hundreds of HEAD requests per day. So, if you've verified that you have all the necessary Windows Features installed, then next check that you have default routes setup for each HTTP request method.

Related

React Native: API calls work locally but not from APK

I have deployed a botpress application to AWS (EC2) with Dokku, following the docs of botpress. To communicate with the bot I'm doing API calls to the IP address (52.xx.xxx.xx:3000).
This works fine when I'm running my RN app locally or when I test the API with Postmen. As soon as I release an APK I can't communicate with the API anymore, and I don't have a way to see why network requests are failing.
Since I'm not very experienced with servers, I'm assuming the problem lies somewhere in the server settings, thank you for any advice.
are you using HTTP? in that case use android:usesCleartextTraffic="true" in AndroidManifest.xml
In order to view remote documents from an HTTP URL, cleartext network traffic support is required. On Android 9.0 (API level 28) or higher, cleartext support is disabled by default and apps targeting Android 9.0 or higher will need to add the android:usesClearTextTraffic="true" flag in the AndroidManifest.xml file.
If you are only working with HTTPS files, this flag is not required.

Azure App Service "Server Error in '/' Application"

I have a business website that has been running perfectly well on IIS using .NET 4.5, but in Azure it fails.
Now before I lead you too far down this rabbit hole, I can make the IIS fault in the same way as the Azure fault detailed below by NOT converting the website to Application. However, for the life of me I cannot find the equivalent option in Azure; how to convert to Application or equivalent?
I have uploaded to Azure using the Azure App Service Migration Assistant. The only alert was:
"IIS7+ Schema Compliance: One or more elements and/or attributes are being used which are not defined in Azure App Service IIS schema. Consider using XDT transforms."
This links to https://learn.microsoft.com/en-nz/azure/app-service/web-sites-configure which indicates various Azure Application Settings, which I have played with to no avail.
Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
Source Error:
An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Source File: D:\home\site\wwwroot\peterfinch\service.desktop\web.config Line: 143
Can anyone please provide any guidance as to what I am missing? many thanks for your time, Peter Finch
so the answer was setting virtual applications and directories for each website, and this now just worked. App Service, Application Settings, at the end of the list, Virtual applictions and directories.
This was the part that was missing, how to 'convert to application'
So resolved it myself, thanks for looking and I hope this helps someone else in the future.
/ site\wwwroot   Application x
/mysitename site\wwwroot\mysitename   Application
/mysitename/Console site\wwwroot\mysitename\Console\   Application x
/mysitename/Service.App site\wwwroot\mysitename\Service.App\  Application x
/mysitename/Service.Desktop site\wwwroot\mysitename\Service.Desktop Application x

Click once application to connect to remote server

I have added this question on ServerFault but no one replied.
I have a .net application which calls a webservice deployed on my local windows server 2012 on IIS, and the sql server database resides on that server too. All employees connect to the same service and DB since we're all on the same domain, and I publish the app and webservice to the server through visual studio (2012).
Now I need to make employees access this application when they are outside the company's network, so I deployed the webservice on IIS on one of our remote windows 2012 servers, I created a public shared folder in my remote server and added to app webservice files to it and in visual studio I changed the publish method to web deploy and filled in the information as below:
Server: https://x.x.x.x/
Site Name: https://x.x.x.x/PublicFolder
Destication URL: https://x.x.x.x/PublicFolder/Application
When I click Validate Connection, it fails with the following message:
Could not connect to the remote computer ("x.x.x.x"). on the remote
computer make sure that Web Deploy is installed and that the required
process ("Web Management Service") is started. Learn more at:
http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DESTINATION_NOT_REACHABLE.
Unable to connect to the remote server
Note that I tried to replace https with http and I got another error:
Could not connect to the remote computer ("x.x.x.x"). on the remote
computer make sure that Web Deploy is installed and that the required
process ("Web Management Service") is started. Learn more at:
http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_NOT_ADMIN.
the remote server returned an error: (401)Unauthorized
I went to the previous link and I did what they suggested:
Create a separate user group MSDepSvcUsers on remote computer.
Create an local account A on both local & remote computer.
Add A to MSDepSvcUsers on remote computer.
Use account A to publish, this will allow you to publish without
needing to use built-in admin account.
but the same error (NOT_ADMIN) remained
UPDATE: I found another possible solution:
Add/modify windows registery key
“HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\”
and set it “1”.
After I added this registry key, the error changed to:
site 'http:' does not exist ... #ERROR_SITE_DOES_NOT_EXIST
So now if I put wrong credentials, I get the unauthorized error, if I use correct credentials I get side does not exist error.
What should I do?
It worked!!
I mean the connection, it's now validated, all I had to do is change site name from "http://x.x.x.x/PublicFolder" to "Default Web Site\SiteName" !!
This was really confusing, finally got it!

How to Configure Wso2 AM and BAM?

I am using WSO2 API Manager (1.8) and WSO2 BAM server(2.5.0) . I have done the
following configurations for getting statistics.
Configurations in :
https://github.com/Prasanthmv/Wso2/blob/master/configurations/all.doc
After that I started BAM and AM, but the following error appears :(I have
pushed the error in github):
AM error
BAM error
Why this error is showing, is my configuration
correct?
Here's documentation on how to set up API Manager / BAM integration: https://docs.wso2.com/display/AM180/Publishing+API+Runtime+Statistics
Alternatively, you can use WSO2 API Cloud (SaaS version of API Manager) in which everything is preconfigured and works out of the box.
According to the carbon logs, You must be using windows 7.
Therefore,
This could be due the BAM cannot execute cygwin commands. Please try to install Cywin into C drive and make sure no space in file path and append "C:\cygwin64\bin" to the windows PATH (using "Edit the system environment variables").

Visual Studio web reference - $metadata vs. ?wsdl

This is a legacy project that I have not touched in a while. Now the web reference is causing me trouble.
I connect to a SOAP service from a Windows Mobile 6 client. When the service host runs locally on my development box, I can point the web reference to it and it will discover the WSDL, i.e. it will attempt to pull the service description by appending ?wsdl to the endpoint URL. I can build the app and connect to the service from the emulator.
I can for some reason not point Visual Studio to the current production environment for discovery. There it appends /$metadata to the URL instead of ?wsdl. The wsdl is there and I can view it in a browser, though. The mobile app is live and has been connecting to the service for years.
The HTML document does not contain Web service discovery information.
There was an error downloading 'https://mysite/myservice.asmx/$metadata'.
The request failed with the error message:
--
<html>
<head>
<title>Request format is unrecognized for
I know that it is not possible to discover a web service on a non-standard port from Visual Studio. Does it not work with SSL, either? How does Visual Studio decide to use either method for discovery?Or do you have any other thoughts?
I still have no clue what's going wrong with your service but I can discover webservices on non standard ports adding the port to the url (and the ?wsdl as well) from within WS
http://10.177.55.13:10321/MyServices/?wsdl
If this doesn't help open the wsdl in your browser. Copy the xml code, paste it into your editor and save it as .wsdl file. In VS use the filename as url for the service.
HTH
Ruediger