After publishing all code, getting ERR_UNSAFE_PORT on Chrome - visual-studio

I published my project's code on development server. Before publishing it, I created a website on IIS it's link 192.168.1.133:601 (localhost)
But on chrome get ERR_UNSAFE_PORT error.
Tried Explorer and Edge browser therefore it works.
Actual Result: On chrome get ERR_UNSAFE_PORT
Expected Result: Website works.

After my long researches, I found some port list this is restircted by Google.
Thus, I realized that, my port in the list then I changed the port.
Link is https://chromium.googlesource.com/chromium/src.git/+/refs/heads/master/net/base/port_util.cc

In July 2021, I encountered this problem and most of the standard fixes had already become obsolete (especially the one where you open 'Chrome Properties', since I use a Macbook.)
This is a MacOS-specific workaround, and here are the steps:
First, locate the Chrome icon in your 'Applications' folder, then right-click to select 'Show Package Content'. Double-click, to enter into the sub-folder. Select 'MacOS'. Inside, you'll see the Google Chrome executable. Rename it 'portfix', then open up a terminal.
/Applications/Google\ Chrome.app/Contents/MacOS/portfix --explicitly-allowed-ports={port_you_want_unblocked}
Don't forget to undo all of this when you're done with your tests, as this is a vulnerable way to leave your browser for too long!

In my case I used Port 87 and got the error ERR_UNSAFE_PORT.
After changing the Port the site is working...

Related

Chrome Extension Issue in UiPath Robot Only

I am facing the chrome extension issue. The following is the issue:
“UiPath.Core.BrowserOperationException: Cannot communicate with the browser, please check the UiPath extension”
I have UiPath Robot only so I cannot install extension from Studio. I am running the package from the tray.
Things I did to solve the issue by myself:
Removed extension and installed again (multiple times).
Cleared browsing data before execution.
Update the package few times.
Restarted my machine.
It's not clear whether you have installed the extension from the Chrome web store, but it is preferable to install the extension using the following command:
C:\Program Files\UiPath\Studio\UiPath\SetupExtensions.exe /chrome
This will work without having Studio installed. Also bear in mind that if you are launching Chrome in Incognito, you will need to explicitly allow the extension in Incognito by going to the following URL in Chrome:
chrome://extensions/
Choose "Details" on the UiPath extension, and "Allow in Incognito".
Further information can be found here: Extension for Chrome
Try this.
1 Use the StartProcess to start Internet explorer exe file from program files.
2 Send Url as argument eg “www.abc.com”
3 Use on element appear to check if the home page is loaded.
4 Attach browser and use the browser variable to pass to other workflows.

Invalid port used by Browser Link in .NET Core application

I have my app configured to use Kestrel and port 54321 for local debugging.
Previously, when the project was started I used port 12345.
Browser Link Dashboard shows always 0 connections despite I connect browsers (I tried Edge, IE, Firefox, Chrome and Visual Studio internal browser)
. Debugging works, browsing works, Browser Link Dashboard shows zero connections.
When I click "View in Browser" link, it opens the address http://localhost:12345/ which is NOT CONFIGURED ANYWHERE! The string doesn't exist in entire solution. At least in cannot be found using Shift+Ctrl+F.
Find all "localhost:12345", Subfolders, Find Results 1, Entire Solution, "."
Matching lines: 0 Matching files: 0 Total files searched: 825
I think Browser Link doesn't work because it expects the connections be made to port 12345 instead of 54321. I have no idea where this stupid port address is stored and how to change it. I have explicitly configured "App URL" configurations. Both "Browse with" and "Debug" options work properly. The effective port used is 54321.
BTW, I can't use port 12345 because it's used on my PC by GOG Galaxy service.
I tested it both with Kestrel and IIS configurations. Browsing works, Browser Link doesn't.
Though I haven't found the answer about wrong port number, I found the answer why the Browser Link feature didn't work. It is not obvious at all.
To make Browser Link feature work I had to uninstall Microsoft.VisualStudio.Web.BrowserLink.Loader NuGet package and install Microsoft.VisualStudio.Web.BrowserLink.
Those packages have exactly the same description! Anyway, it works.
In my case, I saw in Firefox' Web Developer Console, that the port used by the BrowserLink javascript was not correct. Clicking on the error message brought up a warning to accept the certificate for localhost, and after accepting the certificate, BrowserLink worked again. I realized that the error was with the browser after discovering that BrowserLink worked with other browser and that just Firefox was broken and showed a wrong port number.

Why does WebStorm's LiveEdit not work in Chrome?

I am exploring WebStorm's trial version and would like to use the LiveEdit features.
I am not able to use the LiveEdit features after performing the following actions:
Made sure that LiveEdit is turned on
Installed the Chrome extension
Restarted the browser after installing the extension (I still suspect it is not required)
Run the HTML page in chrome
When I modify the HTML body, I don't see the changes reflected in Chrome.
I read on a forum that netty is not required.
Do we need it?
What else do I need to configure so that I can use the LiveEdit feature?
PS: I am using WebStorm 5.0.
Do you happen to have IntelliJ open by chance?
The point is that the port, 63342, is 'seized' by another app (even if it has nothing to do with HTML debugging).
When the port is busy, LiveEdit tries the next one, 63343. If you right click the JB icon on Chrome, choose Options, increment the port by one, and press Apply, you will magically connect. I wish Jetbrains would have bothered to inform the user what is the port that they are currently attempting to use.
In my PC it happened when I had Mac on. Either one of the following worked:
1. Kill IntelliJ IDEA (that was also open) and try again
2. Increment the port by one as I mentioned above.
I had to go to Run -> Debug (CTRL+F5 on Windows)
What helped in my case was activating "Can accept external connections" under the Settings -> Build, Execute, Deployment -> Debugger
WebStorm Settings
More details as requested:
Installed the JetBrains IDE Extension for Chrome
Make sure the LiveEdit Plugin is installed and activated (Settings -> Plugins)
Make sure "Can accept external connections" is checked (Settings -> Build, Execute, Deployment -> Debugger) AND Port is the same as in the Chrome Extension
Make sure Update ist set to "Auto in (ms)" e.g. 300 (Settings -> Build, Execute, Deployment -> Debugger -> Live Edit)
In my case live edit was just disabled (for some reason)
For anyone googling this thread, LiveEdit is now supported without a plugin. Just go into settings and uncheck "Use JetBrains IDE Support extension for debugging and Live Edit".
Without the extension, the debugging and live edit are more reliable based on my personal experience.
I couldn't make Chrome and Webstorm to link with each other. Chrome plugin was set to 63343 port or something like that.
I am on Windows. I opened command line with administrator privileges and typed:
netstat -a -b
to see all programs and ports they are listening to. I then found first entry regarding WebStorm.exe and saw that it was listening on port 30897. I set that port number in my chrome plugin options, and everything worked.
A quick fix: in the Chrome addon configuration, use the ip 0.0.0.0 for the host.
Turning off the automatic connection configuration from Internet Explorer properties worked for me smoothly. IE is the boss.

Unable to start program 'http://localhost/Default.aspx'. VS2010

I cannot start my website from Visual Studio 2010 anymore.
For a few days I cannot start my project in a web browser using F5. When I open my web application directly by typing the same url 'http://localhost/Default.aspx' everthing works fine.
When I run the project (F5) a new webbrowser starts, but after a few seconds it is stuck and Visual Studio gives an error dialog:
Microsoft Visual Studio
Unable to start program 'http://localhost/Default.aspx'.
OK
When I run the project in release mode it gives an extra error:
Microsoft Visual Studio
The following module was built either with optimizations enabled or without debug information:
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\6552bec6\694bce32\assembly\dl3\8c9bd8d8\fb1d75cb_af26cc01\[name].Presentation.DLL
To debug this module, change its project build configuration to Debug mode. To suppress this message, disable the 'Warn if no user code on launch' debugger option.
OK
I have already repaired, removed and reinstalled Visual Studio 2010, I've tried using different browsers (including Chrome and Firefox), used different aspnet_regiis.exe options, etc. etc.
Nothing helps, and yeah now I'm stuck pulling hair out of my head ...
Anyone any idea how to solve this?
Does it work if you start it with [CTRL]+[F5] which runs without the debugger?
If so, then you have an issue with the debugger auto-attaching to the web server. I would check that debugging is enabled for your web project - a warning that usually crops up automatically from VS when it detects that a project is not built in Debug mode.
This is not as simple as switching the project configuration over to Release, because the DLL that the debugger is moaning about is one of the dynamically generated ones originated by Asp.Net itself.
Typically you should have, in your web.config:
<configuration>
<system.web>
<compilation debug="true" >
</compilation
<system.web>
<configuration>
(Along with any other stuff in <configuration> and <system.web> nodes).
There's also the possibility that Asp.Net debugging is not, for some reason, enabled.
Check out this msdn article on debugging asp.net applications in VS2010 for more information.
Note that if this is VS010 express, then you won't be able to debug - as confirmed by the aforementioned link; but since you way it used to work then I guess that's not your problem.
Update
Since that hasn't worked - you can try emptying the Temporary ASP.Net files folder. Easiest first is to do an iisreset. Then navigate to C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files and delete everything in it. I've had issues in the past where the Asp.Net binaries don't get refreshed and so when I'm debugging it moans that the files are out of date.
Change the View Browser to another browser. Run the view in browser or debug, then change back to original browser should work after that.
Had same problem, answer for me was to remove Avast Free AV. Everything worked for a year with avast free up until a week or so ago, uninstalling it fixed the problem.
I had this exact problem with Visual Studio 2008. The solution was to set the default web browser that VS uses to a real browser (e.g. IE) and not the "Internal Web Browser".
Right click on an ASPX file in your project and select "Browser With...". This lets you select the default browser to use when you select the "View in Browser" option and for when you debug/run the app (this is key).
Select your favourite browser (i.e "Internet Explorer") and click on "Set as Default". Do not pick "Internal Web Browser".
Debug away! Your app should come up in your browser now and debug as normal.
the solutions for me is to test with 127.0.0.1 in place of localhost. and all goes well for.
so the problem come from the host resolution name, to solve it please proceed like :
open cmd and then tape : %systemroot%\System32\drivers\etc\
open hosts file with notepad and the look for localhost ligne(you'll find 0.0.0.0 befor it )
change the 0.0.0.0 with 127.0.0.1 at all lignes with localhost .
I solved in this way:
Right click on a aspx page
Browse with set internal browser as default
Remove the previous default browser
Add %programfiles(x86)%\internet Explorer\iexplore.exe
Set this choice as default
For me I just did a Build /ReBuild on the project level and it started working!!!
I had the same problem. When I debug my code it says:
Unable to start program 'C:\homework.exe'. this system cannot find the file specified."
I'm using Microsoft Visual C++ 2010 Express but when I made a new project by the following steps:
Open C++:
Press new project
Press win32
Press win32 Console Application
Rename it
Click next
make sure: that the application type is console application
additional options: empty project*
Press Ctrl+Shift+A
In Visual C++/Code section press C++ File (.cpp)
rename it and press add
It works fine with for me now.
Please set your page name e.g Default.aspx revert to parent in IIS configuration
I'll share my experience with this same problem. This is not a solution, but someone may be able to figure out the problem from my particular experience.
I've been having this same problem for a few weeks now. (I don't know what changed on my system.) I do not run as local admin, because we are not allowed to have admin privileges on our PCs where I work.
Until today, I could expect F5 (Start Debugging) to start up a new local VS web server, open an IE window, and then issue an "unable to start program http://localhost:nnnn/Login.aspx" and "access is denied" error pop-up. If I closed the IE window, waited a few seconds, and then clicked F5 again, it usually started up my web app in debug mode just fine from that point on.
But today, that all changed. I did not change any configuration on my web app, which has been running fine, but I did add a couple of more classes to one of my subprojects. At this point, I could never get past the "unable to start program" message. I could run my app without debugging, but that was rather pointless. I even tried attaching to a running (non-debug) IE process, but that did not work.
Finally, I modified some of the properties in the WebAppName >Web >Servers screen. Specifically, I enabled "Specific port" for a specific HTTP port (which VS had been using all along), and I disabled "NTLM Authentication". I also enabled "ASP.NET" in the Debuggers section. Some of these I first clicked, then unclicked, then clicked again, saving in between each click.
This time, running with debug (F5) worked.
After running several times, I still usually get a "unable to start" error the first time after a recompile, but I can still usually get a debuggable running app to start after the second or third try. At least I'm back to where I was yesterday.
I suspect it has do with VS reloading its execution profile, and also probably something to do with permissions (since I cannot run as admin).
I'm using VS2012 with an ASP.net app that was written using VS2003... I've tried everything to get the IE page to open automatically when I select F5, or even Ctrl+F5... Haven't been able to get anything to work... However, I have stumbled upon a very poor work-around. When I select debug and I get the 'Unable to start program...' msgbox... I noticed that on the icon-tray I get a msg saying local-host has started
You'll notice a picture that the msgbox is pointing to:
Well, if you right click it, you get three options:
When you select the first: 'Open in Web Browser', it will open IE with the page your working with...
Like I said, it's a very poor work-around... but it works. This isn't an issue when I select debug using 'Chrome' or the page-inspector... But they have their own issues.
Try to turn on Bypass proxy for local addresses.
First you can go to your browser settings-> Change proxy Settings-> Connection-> Lan Setting and just check bypass proxy for local addresses.
If this solution don't work then also copy the following code check your web.config file for settings to bypass firewall:
<system.net>
<defaultProxy>
<proxy usesystemdefault="true" proxyaddress="http://proxy:port" bypassonlocal="false" />
</defaultProxy>
</system.net>
I easily resolved this problem by enabling script debugging in the browser.
When I ran into this problem (using IE 11) I noticed that iexplore was open about a hundred times in the task manager. After killing them all I was able to open my project just fine.
Since then, I have made a .bat file with this code:
taskkill /F /IM iexplore.exe /T
so now I just run the .bat when I get that error.
(alternatively you could run that code from the cmd)
I just ran into this problem in Visual Studio 2013. I had to enable Anonymous Authentication.
Click on the project node in solution explorer.
Hit F4 to show the properties window.
Change the Anonymous Authentication option to Enabled.

Google Chrome --allow-file-access-from-files disabled for Chrome Beta 8

I have been developing an AJAX application using jQuery and Microsoft Seadragon technology.
I need to have access to the html5 canvas function toDataURL.
With Google Chrome, the same origin rule applies to this function which means that a page run locally (with the file:/// in the URL) failed to satisfy the same origin rule and an exception is thrown.
With Chrome 7, starting the application with --allow-file-access-from-files option, allows to call canvas.toDataURL() from local files.
However, it seems that starting the Chrome Beta 8 with the same option (--allow-file-access-from-files) does not allow the call canvas.toDataURL() on the local file.
Does Chrome gave up on the --allow-file-access-from-files option or it has just been disabled since it is a Beta release and not a full release?
Thanks!
Looking at the issues for this shows that the whole --allow-file-access-from-files thing was rushed.
"Firefox does it.."
"How can we do it?"
some time passes
"Here are the patches"
"Passes! On trunk wonder what happens in the next dev release"
"Ahhh it's broken" "Use the command line option" "ok"
"We shipped!"
"WTF guys? You broke all my stuff! Why didn't you tell us earlier?"
silence
On to your Problem
Indeed it seems that this is something special to the beta, I'm using Chrome 8.0.552.5 dev here and --allow-file-access-from-files works like expected, I've also tested this with Chromium 9.0.592.0 (66889) were it also works as expected.
I suspect there have been some changes on the dev branch. Unfortunately, finding something on chromium's issue tracker is nearly impossible.
Did you close all chrome instances before opening with the command line argument? You have to do that to make that parameter work.
To summarize all answers so far.
Before running chrome, make sure there are no chrome processes running.
Windows
-allow-file-access-from-files
(with one dash)
Linux
--allow-file-access-from-files
(with two dashes)
I've found a way around the issue using a JavaScript/Flash approach. If flash is compiled in the Local Only security sandbox, it has full access to local files. Using ExternalInterface, JavaScript can request a Flash Application to load a file, and Flash can pass the result back to JavaScript.
You can find my implementation here: https://code.google.com/p/flash-loader/
The trick that woked for me is that you have to give the absolute path of the file and not just file name in your HTML code. e.g file://... instead of direct name even though you are accessing the file in the same directory. It will work!

Resources