Set start URL for Visual Studio 2022 MVC project - visual-studio-2022

Where can we set the URL that a MVC project starts at in Visual Studio 2022? This is the URL that will be loaded in the browser when we select Start without Debugging.

Go to Debug -> <YourProjectName> Debug Properties
A new dialog will open
Scroll down to Url
Enter the URL you want.
Note that the URL should already exists in our hosts file. (Assuming we are using this for local testing)
The URL should have a port taken from the App URL field. E.g. if your App URL field is
https://localhost:7172;http://localhost:5172 and you want your browser to start at https://test.example.com when you run the project, then enter https://test.example.com:7172 in the Url field.

Related

Visual Studio 2022 .NET 5+ API stops debugging on image upload

Whenever I start my .NET 5 API in debug mode and I try to upload an image with my browser, not associated in any way with the .NET project, VS 2022 stops the debug process.
For instance if I use https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_input_accept and upload an image with the input field , the debug process stops.
It also stops whenever I:
Try to log in using FB/Google login button anywhere
Using Brave (browser) have two separate browser profiles open and close one of them
Any ideas on what it might be? Or a way to search out a cause
Okay, I found the solution
In Visual Studio 2022 you need to uncheck: Tools -> Options -> Project and Solutions -> Web Projects: "Stop debugger when browser window is closed".
Apparently Visual studio treated every image upload or every browser that is closed as closing the debug browser window and stopping the process. Weird.

Can't change website url, VS2013 on win8.1

I'm trying to change IIS express and Website URL to point to a custom URL so i can try the website from my mobile. The point is, the changes I made (read below) don't change the website starting url.
I already changed the part at the IIS Express applicationhost.config file, from port:localhost to a port:custom name, tried to change the part at the .sln file where it points to the localhost.
I uploaded a screenshot from my project's property page, I can't find Use Custom Server option under Server or the Use Local IIS Web Server option.
First Right-click on your Web Site in Solution Explorer and select Convert to web application and then you can find the options you need under Properties -> Web

Publish Web Site Dialog is not opening in Visual studio Professional edition 2012

When i try to open the Publish Web Site Dialog in VS 2012, Publish Web Dialog is opening.
Me and my friend using VS 2012, When i try to open the same project in my friend pc(File->Open Website) and click build->Publish Web Site, Publish Web Site Dialog is opening,but when i tried the same procedure in my pc, to open the same project in my pc, Publish Web Dialog is opening instead of Publish Web Site Dialog
What will be the issues? I need to open Publish Web Site dialog instead of Publish Web Dialog
What i need to change?
Any ideas??
Here i attached the screenshots of Publish web and Publish Web Site
You can use the Publish Web Dialog like the Publish Web Site Dialog.
First of all you need to cretate a new profile from the main window.
Step 1:Just click on the select box than on "create new profile". Give a name to your profile.
Step 2:Click on "Connection" menù on the left. In the window on the left choose the publish method which you need (ftp , filesystem etc.).
Step 3: Click on publish button (it is on the bottom)
Please select the settings check the precompile during publishing.
Then the publishing, .cs files doesn't available

Security notification bar

I need to add a web reference in Visual Studio 2012 (because service reference generates a blank reference CS and I have given up after hours of googling).
When I go to add the web reference (add service reference → advanced → add web reference) and enter the WSDL URL I get the IE Notification Bar in the dialog with the message:
To help protect your security, your web browser has blocked this site from downloading files to your computer. The option to "Download file" does not work.
I've changed IE security settings to minimum and added the domain to the list of trusted sites but did not have any effect. I also uninstalled IE10 completely and still get the notification bar. I am using Windows 8.
Anyone shed any light on this or had any success adding a web reference in VS 2012?
If you can download the WSDL with your browser, download it and save it to a file. You can then reference it from Visual Studio by pointing it to that file. Or you can use svcutil.exe or wsdl.exe to generate a proxy from the commandline.

Does IntelliJ have an internal web server to serve static content of a web application?

Right now, the directory of my module is defined as an IIS virtual directory and IIS serves the files.
I was wondering whether IntelliJ has an internal web server, which can serve the files, without the need for any third party. Eclipse does.
UPDATE: built-in web server is available in the recent IntelliJ IDEA versions (starting from 13). You can find more details in the blog (yes, this feature first appeared in WebStorm).
IntelliJ IDEA has no this feature, you need to install and use any third-party web server that can serve the content from the project folders.
A built-in HTTP preview server will be part of Intellij IDEA 13 and is already available in the EAP: http://youtrack.jetbrains.com/issue/WEB-7148
"All existing actions — preview in browser (pop-up over html file or menu action or
shortcut), open in browser and create/debug html file action now open file on built-in web
server
http://localhost:63342/<project name>/<file path relative to source or content root>"
In other words, right-click on an HTML page and select "Debug" or "Open in browser", and IDEA 13+ will serve up that page via port 63342.
Here's another super simple option, install Python: http://www.python.org/getit/
Then open a shell prompt, navigate to your root web folder (e.g. public) and run python -m SimpleHTTPServer - This starts an HTTP Service on port 8000.
Further reading should you need it: http://www.linuxjournal.com/content/tech-tip-really-simple-http-server-python
I've got mine running on Windows 7 but the above article still applies.
Another option is is create a PHP project that, starting with v 5.4.0 of PHP includes a built in web server. This page explains it all ...
http://www.jetbrains.com/idea/webhelp/php-built-in-web-server.html
IntelliJ IDEA has a built-in web server that can be used to preview and debug your application. Just watch this YouTube video or follow the steps below.
Option 1
You need to add new 'JavaScript Debug' configuration:
Click Add Configuration... or Edit Configurations... in the Navigation bar
Click button in the toolbar or press Alt + Insert to create a new configuration
Select JavaScript Debug under the Templates node in the tree view of run configurations
Fill in Name, URL, Browser and click [OK] to save the configuration
Use http://localhost:63342/YOUR-PROJECT-NAME/index.html for URL
Now you can run the configuration:
Click run or debug button in the Navigation bar (or use Shift + F10 / Shift + F9 hotkeys).
Option 2
Running web page in browser without creating a configuration. Refer to the related IntelliJ IDEA Help article.
In the editor, open the HTML file. This HTML file does not necessarily have to be the one that implements the starting page of the application.
Do one of the following:
Choose View | Open in Browser on the main menu or press Alt+F2. Then select the desired browser from the pop-up menu.
Hover your mouse pointer over the code to show the browser icons bar: . Click the icon that indicates the desired browser.
Result
Google Chrome browser with a demo web page served by the Intelij IDEA's built-in webserver:
One simple way is to create a NodeJS / Express project in IntelliJ that is your web server. You can then use it to serve your static web pages and any other web content. The NodeJS web server is very small and runs fast - noticeably faster than IIS and Apache. Best of all you can just hit the Run button in IntelliJ or WebStorm to start it up.
By default, a NodeJS / Express project includes a public/ directory that you can use to contain your static pages that you can then view from http://localhost:3000/
This explains the steps required to enable NodeJS in IntelliJ and includes links to other Node resources:
http://www.jetbrains.com/idea/webhelp/node-js.html
If you feel the need, you can reconfigure your NodeJS server using server side Javscript code. You can add SSL support or almost any other server side features you care to dream up. Just add NodeJS modules using the npm (Node Package Manager) command line tool included with the install. NPM Registry https://npmjs.org/ indexes all the available modules.
You can configure IntelliJ to use a lot of different application containers, but each of them must be downloaded and installed separately. I currently have mine configured to serve via jetty, like eclipse, and also tomcat, tc-server, jboss, and node.js. It's pretty easy to set up.