Why is a razor view of my servicestack site displaying the metadata page on azure only? - razor

I have an application that displays my razor views of servicestack endpoints as expected on localhost. However when deployed to azure websites a particular page displays the metadata page for some reason. I don't know how to work out what has gone wrong as it all works on my machine :).
For reference, the view name matches the return DTO. I've tried the site in release mode on my machine. All other pages display as expected on azure and locally. I've cleared the cache and re-started the site from the control panel. I'm running out of things to try.
Any ideas appreciated.

Some general troubleshooting approaches that might help you:
Use Postman, cURL or Fiddler to watch the HTTP traffic between your computer and the website, looking for clues in HTTP headers, requests and responses.
Using FileZilla, connect to your website via FTP. Download the content of /site/wwwroot to a new directory on your local machine. Add this as a virtual website in IIS and run it locally. You'll be running exactly the same code that is deployed.
Instrument your application with tracing in a similar fashion to ASP.NET Tracing and look for exceptions or any other odd behavior.
Refer to Troubleshooting a Web Site for additional resources.

Related

How do I force Azure Apps to use latest html file?

I have a web application hosted on azure apps that I publish using visual studio. It is a flask app. One of the templates is called searchresult.html. I am making changes to this file that are made when I run locally. When I run it on the server though the changes are absent.
Using the azure console I can see that the changes are present in the file that is stored on the server, but the application continues to deliver the old html.
How can I force azure to see my updated file?
Things I have tried:
Deleting the file directly on the server and re-publishing it
Committing changes to git, even though I knew that would do nothing
Testing it locally (it works)
Restarting the application
Since you said you already check the file has been changed on the Kudu, so it supposed not an issue of deployment. You could disable caching in your browser.
such as in chrome browser, navigate to F11 window and select the Disable cache blanket.
or please try to access your website via incognito model.
In addition, I crashed into similar issue with you in other web app. My previous solution is that enable always on option on the portal and restart my app, it worked.
Just for your reference.Hope it helps you.

Why am I getting this ISAPI error on a cloned site?

I'm a corporate developer and was recently tasked with copying a live website that is already up. It's step one of a project and this is meant to be a testing copy. Project spec requires the site be an exact clone of how the site appears now. This is all being done on IIS 8.
I copied the folder and set it up as its own website, but the "_dev" version. I changed nothing at all in the web.config and even used KDIFF3 when I started having issues to ensure everything I'd copied was a binary copy (It's a Winforms site). Any time I attempt to navigate to the page, I get a 500 error. The original site, in the same box on the same IIS, is still fine.
Naturally, I enabled failed request logging and it turned out to be this:
ModuleName
IsapiModule
Notification
EXECUTE_REQUEST_HANDLER
HttpStatus
500
HttpReason
Internal Server Error
HttpSubStatus
0
ErrorCode
The specified module could not be found.
(0x8007007e)
ConfigExceptionInfo
I don't use IIS much, but I'm pretty sure the only reference either the working site or the problem site has which involves ISAPI is a reference to the .Net 2.0 aspnet_filter in System32 for the .Net 2.0 framework.
Since the sites have identical content, which is very simple content, I thought it was permissions. For 20 minutes or so I gave r/w/x for "Everyone" with inheritance to child objects enabled, essentially ensuring permissions could be ruled out on the folders or on web.config, and still had the same issues.
I'm sort of at the end of my rope here. I can't find anything more than the steps above as a fix, but I'm in the same boat, even after restarting IIS. Both sites are using the same Application Pool (a 2.0 one, Classic mode) and are simple WebForms. Does anyone know why I'm having this issue?
Update: I also tried it locally on my desktop instead of on the web server. I can connect flawlessly to it via Localhost. I then installed a second on my desktop just by copying the folder and adding a page to IIS. That worked as well. Copying the working local install to the server still gives me a site that doesn't work.
The answer was a strange one. The previous developer working on the site was familiar with the AJAX tools from earlier versions of Visual Studio and had installed .Net 1.1 on the box to ensure compatibility with his code. IIS was defaulting new sites to point to the .Net 1.1 DLLs, while running in a .Net 2.0 app pool. Changing all of these manually to point to the 2.0 DLLs fixed the problem.

Localhost not loading in any browser

I have asked a similar question before here I sort of fixed it but im still facing a similar issue. Every time I try to load localhost, port 8095, I receive this error message in Google Chrome:
Google Chrome's connection attempt to localhost was rejected. The
website may be down, or your network may not be properly configured.
If there is a way to fix it, please tell me,
If not, please could someone inform me how to reset IIS to its original settings. Or if I can reset Windows Features so I can re-install ISS from scratch.
My website uses ASP with a connection to a SQL Server database (2012). Basic HTML pages also don't load under the URL, localhost:8095/
The servers were stopped because 2 services within administrative tools had stopped. World Wide Web Publishing Service and Web Management Service

how html5 apache works first time

I have created one HTML5 web app which works in offline mode.I load it first time form server and then when server is off it works perfectly.Webapp url is http://localhost/index.html
Now , if I try to load that webapp first time on any new machine then how can it resolve the localhost url.I have all the resources bundled with webapp.
In this case server is off and browser is not able to locate url http://localhost/index.html
Any idea if webapp can work in offline mode , even if its not connected to server ever.
What you are doing and expecting seems to make sense. It would be smart to check the console in the Chrome Developer tools. Something along the lines of the following should be shown:
You might be serving the manifest file with the wrong content type (should be text/cache-manifest) or the fact that you're working on localhost might somehow interfere (dunno).

having problems integrating Kaazing with my website: Unable to post message to X. Recipient has origin Y

I keep getting the error trying to integrate Kaazing jms version with my .net website and activemq message broker:
Unable to post message to http://www.xgateway.com:8001. Recipient has origin http://www.x.com.
When I try to build a javascript client that is hosted by my Asp .NET website trying to connect to kaazing gateway.
I know I have everything setup ok, because i can go to www.xgateway.com:8001 and i can browse all the documentation and run the demos. I have run the stock ticker demo and watch it work perfectly. so all setup seems OK.
Now the problem is, I also have my asp .net website hosted on IIS 7 on the same machine. i'm trying to build javascript clients hosted on my .net website (port 80) that connect with the kaazing gateway. But I keep getting the above cross origin error.
In my client I am referencing StompJms.js as instructed. I have activemq setup up properly and working as well as the message broker. All demos working prove everything is setup properly.
i have also taken these steps following the instructions in the documentation:
Copy the file GATEWAY_HOME/lib/client/javascript/PostMessageBridge.html and serve it from the source origin web server (http://www.example.com); for example at http://www.example.com/bridge/PostMessageBridge.html.
Note: You must ensure that the file PostMessageBridge.html is hosted on the same origin (same scheme, host, and port) as the web server.
Add the following tags (shown in lines 2 and 3) to the section of your main application page:
<head>
<meta name="kaazing:postMessageBridgeURL"
content="http://www.x.com/PostMessageBridge.html" >
.
.
.
</head>
but still get the error. What else am i missing?
Since the port numbers used by your .NET app and your kaazing websocket gateway are different, these are considered to be separate sites. Therefore, you'll need to specify cross-site-constraint for your service.
Here's a sample snippet you'll need to add to your gateway-config.xml:
<service>
<accept>ws://localhost:8001/remoteService</accept>
<connect>tcp://localhost:61613</connect>
<type>stomp.proxy</type>
<auth-constraint>
<require-role>AUTHORIZED</require-role>
</auth-constraint>
<cross-site-constraint>
<allow-origin>http://localhost:8000</allow-origin>
</cross-site-constraint>
</service>
And here you find detailed documentation on the topic.