How do I make VS2015 to use HTTP/2? - visual-studio

I tried looking for option to enable http/2 in Web Project file (.csproj), also on HttpRequest object without luck. Is it a setting in web.config by any chance?
How do I enable/disable use of HTTP/2 in Visual Studio?

First of all, you must have IIS 10 installed, and it's only available on Windows 10.
Then, the only thing you need to do is to turn on the Enable SSL label on your Web Application project, and if when you run your localhost to the HTTPS port, it will be automatically running on HTTP/2.
At the time of writing, there is no option for doing that on ASP.NET 5 Web Applications though.
You can grab more information here: https://weblogs.asp.net/scottgu/released-today-visual-studio-2015-asp-net-4-6-asp-net-5-ef-7-previews

Related

Why do I need to change IE settings to enable HTTP/2 on Windows 10?

I recently enabled HTTP/2 on a site I was developing.
To do this I had to
Be on Windows 10
Use a browser that supports HTTP/2 (in my case Chrome)
Configure my webserver (iisexpress) to serve the site using https
Enable HTTP/2 in the Internet Explorer options
It all works, but I'm confused about why 1 and 4 are necessary. Especially 4 as I'm not actually using Internet Explorer. Now the above link suggests that it has something to do with the WININET library and I understand that IE options occasionally affect settings in the operating system itself but that's where my understanding abruptly stops.
What does the operating system even have to do with any of this? Isn't http/2 just between the browser and server application? Are there system resources being used by IIS? Does that mean if I set up something like Katana or nginx I could use HTTP/2 without Win10 or toggling the IE setting?
Disabling of HTTP/2 in the Internet Explorer options (it's enabled by default):
have relation only on IE11 on your Windows 10 computer. Chrome and even Microsoft Edge can still use HTTP/2 to communicate with your IIS (I tested with IIS instead of iisexpress). You can verify that using Developer Tools. You should only clear the browser cache to see that H2 (HTTP/2) be used during the communication:

standalone web application

Is there way to run web application as standalone desktop application? Could be web application written using PHP, MySQL and Apache converted to standalone application which meets following requirements:
1. Application should be called as http://myapp.localhost.
2. Application should have desktop icon which directly opens browser with application's URL.
3. Source code of web application should be hidden from users.
4. Installation for end user must be as easy as possible.
Now I do steps 1-2 using xampp and manually creating shortcut. I was interested in some wrapper, installer which do above steps automatically. But I have no idea about 3rd step.
Regarding item 3, see Can you "compile" PHP code?. This would allow you to develop in PHP and deploy the application via an installer.
There are several installer packages which would allow you to automate these steps, depending on your development environment.
PHP and MySQL require to have a web server running. That means you will need to copy the code over to the client's machine and then run the web server locally still on the client's machine.
If that's what you want, look into the Microsoft IIS Express (here).
In short, IIS is a web server that can host and run a server side web application, written in ASP.NET or PHP.
Here are the steps you need to take:
Install IIS express on the client's machine (one-time process, and I think quite acceptable - treat this as a runtime installation).
Create a designated (hidden) folder for the source files of the web application that you want to deploy (one-time process).
Create a windows batch file (bat or cmd) that starts the IIS (as described here) and then opens the website's URL so that the default browser starts. This file will serve as a shortcut, so you can place it on the desktop or wherever appropriate (one-time process).
Deploy your web application to the hidden folder from step 2 above (repetitive process - deploy to the same folder when you want to upgrade the clients to a new version).
Please have in mind that I am basing my suggestion on your requirement to host and run the application locally (on localhost).
However, if there's an option to run the application on a separate machine (not a localhost), then you could simply place a desktop shortcut to the network or internet address URL that would open the default browser without problems.
i would suggest Pouchdb http://pouchdb.com/api.html and Adobe Air http://www.adobe.com/devnet/air/air-sdk-download.edu.html. This way you can code with html and javascript and package it with Adobe Air.
I'm afraid it's not that simple.
If you want to use this approach (and I highly discourage it), you will have to deploy a webserver of some sorts on the client. You should be able to run the Apache/IIS Express and MySQL/SQLite executable and start a simple webserver and database.
If you'd also like a icon, you can create an installer that creates this icon and points to the URL you wish.
I'm afraid that's not possible. PHP is and always will be a scripting language. You might be able to obfuscate it somehow, but anyone who can download your application will be able to de-obfuscate it.
Again, you can create an installer. Inno Setup is pretty good from what I've heard.

Is it possible to access the Azure emulator from another computer on the same network?

I'm running Windows 7 (x64) with VS 2010 SP1 and the Windows Azure SDK 1.5. I'd like to be able to debug a web application on an iPhone connected to the same network to shorten debug cycles.
IIS is running on this machine and can see that a temporary site is being created when I debug the Azure project. Is there a way to add an additional binding to the IIS site so that I can connect from the the iPhone when the debug is started? I can manually add a binding once the debugger starts up but this is lost when I stop debugging.
This is a very old thread, but I came across it trying to do the same thing- after more searching I found this: and it worked great for me (Using Passport to pass the traffic)
http://blog.sacaluta.com/2012/03/windows-azure-dev-fabric-access-it.html
you can use port forwarding to do that.
netsh interface portproxy add v4tov4 listenport=800 connectaddress=127.255.0.0 connectport=82 protocol=tcp
More info here: http://fabriccontroller.net/blog/posts/remotely-accessing-the-windows-azure-compute-emulator/
I have managed to find a solution that kind of works.
I went to IIS manager and created a new website that points to the folder were I'm developing, on the port 8000.
Now I can access it through http://ip-of-server:8000, and also debug the application.
Hope it works for you also.
I have discovery this solution http://blog.piyushthacker.com/?p=24
Works fine for me :)
In newer version (1.3 and higher) you may need to change file IISConfigurator.exe.config file like in this solution http://blog.syntaxc4.net/post/2011/01/06/changing-the-windows-azure-compute-emulator-ip-address.aspx
I use Fiddler to create a proxy server (tick options Act as system proxy on startup, Monitor all connections and Allow remote computers to connect), configure the remote browser to use the proxy server, and access my Azure website via http://ipv4.fiddler:81/ Technique from here.
There is a solution for this,
Look at This SO Answer,
which is based on this post

ASP.NET websites under IIS 7.5 (Windows 7) running extremely slow

I've just installed Windows 7 x64 Ultimate on my desktop PC. I installed IIS, Visual Studio 2008, registered ASP.NET, etc.
I have this ASP.NET 3.5 website I'm working on running EXTREMELY slow on this new IIS. On STA and PROD servers (Windows 2003 Server) and on my old XP/IIS 5.1 everything runs smoothly.
A page which usually takes 1-2 seconds to load is taking 8 seconds!!!
I saw this post on IIS forum. It says something about Vista/7 not pooling connections (just to let you know, the website is running locally but it's connecting to a SQL Server 2005 hosted on a remote server).
It seems that it takes a while to "start loading" the page... I mean, I click refresh and it stays for several seconds "Waiting for localhost"... Then when it gets response it loads the whole page normally...
I don't have a clue how to force Win7/IIS7.5 to pool database connections.
EDIT: I've created a new empty ASP.NET web application to see if the problems happens too. The answer is no, it responds fast as it should with an empty default page. Maybe is something related to the DB connection. I will do a further test. It should be a way to fix it...
EDIT 2: Debugging the app I noticed that the delay occurs AFTER the execution of .NET code (Page_Load, etc)... so the delay seems to be somewhere when IIS serves the page to the browser.
For those having the same problem, here's two possible solution.
1) Disabling IPv6 support in Firefox (only for Firefox)
Most of the authors that I found out about suggest this approach as quickest and cleanest solution. What you need to do is basically to open configuration settings in Firefox (about:config) and to change network.dns.disableIPv6 setting to true.
2) Change localhost settings in your hosts file (all browsers)
This came to me as an idea to check where and how can I interfere in IPv6 settings on my machine. I saw one of the comments on above mentioned sources saying that one can get rid of the problem by simply replacing localhost with machine name in the url.
It didn’t take me long to check and see that disabling my IPv6 localhost lookup does the same thing as disabling IPv6 directly in Firefox.
What you need to do is basically to comment / delete this particular line in your hosts file:
#::1 localhost
Note: ::1 notation is IPv6 equivalent of the IPv4 127.0.0.1 lookup address.
I believe the second solution might be more suitable for users who do not want to disable IPv6 in general, and the first one for all others that still do not use IPv6 in their regular work.
I was having the same issue: extremely dead slow site performance using IIS 7.5 on Windows 7 64-bit with a Core 2 Duo with 4GB RAM and 3 Application Pool Processes running only 1 website. Here's what I did to get the speed back to IIS, problem solved...
The trick for me was to run IIS using 32-bit workers, as instructed by Microsoft on IIS.net, which you can read here:
http://learn.iis.net/page.aspx/201/32-bit-mode-worker-processes/
Simple solution provided (I don't want to rewrite it here)... Either you can run a 1-line command from the Windows Command Prompt or a 1-line command from Windows PowerShell. I just ran it from the command line (make sure you open Command Line or PowerShell as Administrator -- right-click > Run as Administrator).
Thanks,
Marty McGee
You can try running multiple processes as application pools:
Open IIS
Click Application Pools
Right click the app pool for your app
and click Advanced Settings
Find the
"Maximum Worker Processes" and update
it to 3 (or the number of processes
you want to allow to run).
I know the op was running IIS 7.5 and this may not apply to him, but I'm posting this as it might help others running IIS Express 8.0. I had the same problem and none of the IPv6 or hosts file changes worked for me. My asp.net MVC4 project was really slow after hitting F5 to refresh js changes on localhost. It was happening across all browsers - Chrome, FF, and IE. Eventually I discovered that IIS Express 8.0 is extremely slow when serving up js files and seems to be a bug. If I ran iisexpress on the command line and hit F5 I could see each js file took 4 or 5 seconds to load.
I ended up uninstalling IIS 8.0 and installing IIS express 7.5 and straight away the problem was fixed. Here are the steps I followed:
Uninstall IIS express 8.0
Delete the IISExpress folder (on Win 7 it's in My Documents\IISExpress)
Install IIS express 7.5 (Link to IIS Express 7.5 download)
IIS Express 8.0 seems to be installed with VS 2012 so if you had a new install or possibly a service pack update this might upgrade the previous IIS Express version.

Prefered method to map a remote filesystem in windows?

For a current project, I need to allow users to access their files remotely from Windows. I'm looking for a solution with an explorer integration (using Shell Namespace Extensions).
I first try using WebDAV and the built-in client in Windows but the client is not of equal quality in all Windows version and adding SSL and/or authentication is not working as espected.
I am not attached to WebDAV, it can be any protocol. I prefer open-source project or a commercial one with a SDK license (must be integrated in a product).
Have you tried "sharing" the filesystem? If your server runs Linux, you could try samba. I haven't tried Windows in a while, but I seem to remember that the Explorer did ftp as well.
I'm assuming plain HTTP is a no go here.

Resources