Launch ASP.NET website without debugging - c#

In the default structure of ASP.NET 4.6.1 I was able, to set the IIS to run directly an application without the need of debugging or publishing it. But on ASP.NET 5 I couldn't manage to do so. I have tried to point the IIS to the wwwroot of the project and to enable "Produce outputs on build", but when i want to access the application I only get the following error:
HTTP-Fehler 502.3 - Bad Gateway
There was a connection error while trying to route the request.
Does anyone have experience with this or had a similar issue?

it's not available for right now , to do it we still need for IIS 10 but you can still do it with some trick check link below
your answer is here

Okay as I wasn't able to find any way to get this working, i spotted a little icon on top right next to "IIS Express" or "web", which is called "View in Browser".
Now you just need to go to the project's preferences, select Debug and choose IIS Express from the profile dropdown. Make sure, the checkbox at "Launch URL" is set and specify a App URL (Sometimes port 80 won't wor, so just choose any other one, for example localhost:5324) and then click on the icon like in the screenshot. Then you don't have to deploy the project or start debugging to see the project in action. Hopefully, this will be helpful to some of you.

Related

Visual Studio 2019 .NET CORE and React Template Subsite

I am having a hard time getting this template to work as a subsite.
The steps that I took to create the project were:
Launch Visual Studio
Create a new project
Select ASP.NET Core Web Application
Gave the details for where the project should be stored, etc
Create
At this time I am not interested in redux so I just selected the "React.js A project template for creating an ASP.NET core application with React.js"
After that I thought that the steps to make this work at a sub-site would be:
Right-Click and Properties on the Web App Project, on the debug tab I set the App URL to what was there + /mysub, for example: http://localhost:57197/mysub
Inside the Client App Folder I modified package.json and set the "homepage" to "/mysub"
When I debug the application nothing renders in the browser. The browser's console shows that it is getting invalid characters when trying to load resources such as manifest.json, and even bundle.js, which tells me that the client side router is probably intercepting the requests for those files, and when I look at the network tab it looks pretty more obvious that is what is going on. The strange thing is though that tag does appear to be right and thus it is setting the %PUBLIC_URL% environment variable as I would expect, but for some reason it just will not work at this subsite location. I suspect that maybe there is more that I may need to do in Startup.cs, or even appsettings.json but I am not sure what that might be, or if even that is the route to go. Any suggestions would be great.

Copying mini website into main website giving configuration error

Recently,
I developed one mini site and had to deploy that site in one of our main project.
What I did is, I copied the whole mini project and pasted into the main project. And when I tried running the mini project, I got error as
*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.*
Also, the error was generated from my mini web.config file from the line no : 45. Where the code was
<profile defaultProvider="DefaultProfileProvider">
I don't know what was the error all about. I also tried searching on the net for the issue and I got one link from here but it also didn't helped me out.
Please suggest something which can be of any help. Also let me know know If I have to make some changes.
Try using the System.Diagnostics.Process.Start("Link of your website.com");
or please try iframe.
The error is very specific as to what the problem is. You need to configure the virtual directory your "mini site" is in as an application in IIS.
Open up Internet Information Services Manager, expand the list of sites until you find your "mini site". Right click on it and choose "Convert to Application". Problem solved.
It sounds as though you need to mount the mini site as an application. What version of IIS are you using? The following steps for IIS 7 may help:
Creating a Web Application (Virtual Directory) in IIS 7
In case of link-rot, I'll summarise the points as well:
Open IIS Manager
Right-click on your master site and select "Add Application"
Fill out the resulting dialogue box. The alias is the "subfolder" the app will be mounted within, and the physical path is the directory your "mini site" resides in
Hope that helps.
Finally after researching so much, I got my answer.
What I need to do is(My mistake)
Converted the Web.Config file of the mini site as Convert to Application.
After that I got error as Excel03ConString already exist. For that, I commented out that line from the mini site.
Next, When I browsed the site I got error as: The Site needs default document as it was giving Membership page which comes by default.
SO I selected the default page and it started working smoothly.

How Can I Host A WCF App In IIS?

I'm following Microsoft's tutorial on the topic here but it's not working and several items are unclear to me.
http://msdn.microsoft.com/en-us/library/ms733766.aspx
In step 2 it says, "ensure that ASP.NET has access to the contents of the folder". How can i do this?
Is it correct that the .cs code not be compiled? I've never ran .cs as a script of any kind.
Here is my error:
HTTP Error 404.17 - Not Found
The requested content appears to be script and will not be served by the static file handler.
Thanks.
Could you please ensure that your apppool in which your site is running in "Integrated" mode rather than Classic.
If the problem is not resolved after doing this, try to register your IIS with .netv4.0
For doing that
Go to Command Prompt
Go to the location C:\Windows\Microsoft.NET\Framework\v4.0.30319
Register the IIS using aspnet_regiis -i command
Open IISManager and go to handler mappings and right click on the static file and select "Revert to Parent"
You can Host a WCF App/Service in IIS as you host simple website. It seems to me that you are trying to access/browse .cs file. If so, then it is not possible as it is code file. You should browse only your service file i.e. .svc file.
You can refer http://adarshdchaurasia.wordpress.com/2013/09/26/create-restful-wcf-service-api-using-get-post-step-by-step-guide/ to create a WCF service.
Please ensure that:
You have .Net framework 4.0 installed and enabled on your machine. If
not, install or try to re-install. Sometimes re-installation fix the
unknown settings problem we accidentally create.
First try to host a simple demo web site to check if the problem is
with your WCF application or with hosting process your are
following.
In step 2 it says, "ensure that ASP.NET has access to the contents of
the folder". How can i do this?
I think it mean make sure your folder are accessible by the IIS_IUSRS
Check the publish folder properties -> Security tab -> group or user name.
Make sure the app is using application pool with correct .net framework version.
normally I will just set .net framework v4.0.30319

ASP.NET Debugging Multiple Projects - Error

I have two seperate ASP.NET applications on the single solution. I change the startup order of projects from menu in order to debug them. Although the first ASP.NET application can start on debug mode, the second one gets an error like this:
"
Unable to start debugging on the web server. Unable to do an AutoAttach.
Make sure the server is operating correctly. Verify there are no syntax errors in web.config by doing a Debug.Start Without Debugging.You may also want to refer to the ASP.NET and ATLServer debugging topic in the online documentation"
How can I fix it?
Check the answer out here:
http://www.velocityreviews.com/forums/t65889-auto-attach-aspnet_wp-exe-in-visual-studio.html
Hope it helps
EDIT: Here's the text from the site as requested:
Since a default web application is OK and the problem only occurs in this
specific web application, please check the following settings of the
problem project.
Open the problem project in VS.NET IDE.
Select Project->"Project Name" Properties...
Select Configuration Properties->Debugging.
Please make sure the "Start Action" is set to "Start project" and the
"ASP.NET debugging" is enabled.

Unable to connect to ASP.Net Development Server issue

I am debugging codeplex simple project. I am using
VSTS 2008
C#
Windows Vista x86 Enterprise.
I have not modified any code of this codeplex project, and just press F5 to run VideoPlayerWeb project.
The current issue I met with is error message --
Unable to connect to ASP.Net Development Server.
Here is my screen snapshots when clicking F5. Any ideas what is wrong?
I had this problem with VS 2010, and it was as simple as terminating the "WebDev.WebServer40.EXE" process. Although the icon was no longer showing in the system tray, the process was still running.
Could be a number of things...try these (check the last one first)...
Disable IPv6
Make sure there isnt an edit in the
hosts file for localhost
Check firewall/virus settings to allow connections to/from
devenv.exe
If you can preview in the browser
make sure the URL in the browser uses
the same port number as the port
number shown in the ASP.NET dev
server taskbar icon.
Try setting a fixed, predefined port
in project properties
I got these from a couple of forums elsewhere, hopefully they can help. Good luck. Let us know what works and some more about your environment (firewall, anti virus etc) can help as well.
Under project settings, try specifying a different port like 64773 for example. I have encountered this issue many times and it has always worked for me.
It cause the already that project port server is running in the current thread. You need to end process using task manager.
Follow below step:
Pres Ctrl+Alt+Delete (Task Manager)
find the asp.net server like
WebDev.WebServer40.exe for VS2010
and press end process.
Now u continue with vs2010 run
button
I went to the project file and changed the development server port to 1504. Well 1504 worked on another project for me, so I went with that. Hope this helps.
I have tried all of the above solutions and others from other websites too but with no luck.
What worked for me, was to rename or delete the applicationhost file:
C:\Users\User\Documents\IISExpress\config\applicationhost < rename or delete.
That is very odd! I hate to suggest something as simple as restarting Visual Studio...but that is what sounds like the best first place to start. Also, check your project settings. As you said that you just downloaded this and tried to run it...perhaps the solution/project is not set up to use the Casini server that is shipped with Visual Studio?
Here are the steps
'Website' Menu in your visual studio ide.
select 'Start Options'
enable 'Use Custom Server' radio button.
Enter any URL you desire similar to 'http://localhost:8010/MyApp'
Note1: you can use any port number not only '8010' but not designated port numbers like 8080(tcpip),25(smtp),21(ftp) etc.,
Note2: you can use any name not only 'MyApp'
This solution works for sure unless your WebDev.Webserver.exe is physically corrupted.
Error
1) Unable to connect Asp.net development server ?
Answer: No way find for that error
Try 1)
Step 1: Select the “Tools->External Tools” menu option in VS or Visual Web Developer. This will allow you to configure and add new menu items to your Tools menu.
Step 2: Click the “Add” button to add a new external tool menu item. Name it “WebServer on Port 8010” (or anything else you want).
Step 3: For the “Command” textbox setting enter this value: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\WebD ev.WebServer.EXE (note: this points to the
web-server that VS usually automatically runs).
Step 4: For the “Arguments” textbox setting enter this value: /port:8010 /path:$(ProjectDir) (or any port you like)
Step 5: Select the “Use Output Window” checkbox (this will prevent the command-shell window from popping up.
Once you hit apply and ok you will now have a new menu item in your “Tools” menu called “WebServer on Port 8010”. You can now select any web project in your solution
and then choose this menu option to launch a web-server that has a root site on port 8010 (or whatever other port you want) for the project.
You can then connect to this site in a browser by simply saying http://localhost:8010/. All root based references will work fine.
Step 6: The last step is to configure your web project to automatically reference this web-server when you run or debug a site instead of launching the built-in
web-server itself. To-do this, select your web-project in the solution explorer, right click and select “property pages”. Select the “start options” setting on the left, and
under server change the radio button value from the default (which is use built-in webserver) to instead be “Use custom server”. Then set the Base URL value to be:
http://localhost:8010/
Obviously I don't know if this is the problem you had but definitely it is something similar, essentially the problem should be that the same port used by your
Development Server is not available because it is already used by another web server.
Try 2)
Here are the steps
1. 'Website' Menu in your visual studio ide.
2. select 'Start Options'
3. enable 'Use Custom Server' radio button.
4. Enter any URL you desire similar to 'http://localhost:8010/MyApp'
Note1: you can use any port number not only '8010' but not designated port numbers like 8080(tcpip),25(smtp),21(ftp) etc.,
Note2: you can use any name not only 'MyApp'
This solution works for sure unless your WebDev.Webserver.exe is physically corrupted.
Both of not worked after that Windows repair option remain
My solution was to turn off Internet Connection Sharing on my wireless adapter, after which it immediately worked. I made no other change. I suspect ICS's DHCP server was interfering.
Try commenting out the following line, if it exists, in your hosts file (%windir%\System32\drivers\etc\hosts):
::1 localhost
This worked for me using Visual Studio 2008 SP1 on Vista Ultimate x64 SP2.
I got this problem a couple of times and done different things to fix it. When I got it this time all I did to stop getting "unable to connect to asp..." error, was rename the web app folder directory from xpCal to xpCal2. I also tried moving the web app directory to a different directory from C:users\<me>\desktop\ to C:\users\<me>\desktop\new folder and it also worked.
I don't know why it worked, does VS 2010 keep information about web apps seperate from web apps folder.
In my case, when I had the ASP.NET Development Server crash, one thing that worked was to change the port for the project.
I suspect what happened was when the web server crashed it did not release a lock on the port. Even though it was not running in Task Manager, something was blocking a new instance of the web server from starting again on the original port. Changing the port was a decent enough work around. I could have rebooted, but who has time for that, right?
Details: Windows 7 x64, VS2010, .NET Framework 4.0, ASP.NET web site using the built in web server to VS2010.
BTW, I would be a little cautious with replacing the WebDev.WebServerServer.EXE as suggested in other posts. If that file has been corrupted then you have bigger problems with your OS.
hi
Just change the asp.netweb development server port from automatic to a specific port
e.g 8010
That's what worked for me
1) not reflecting HttpContext in class file ?
Answer:-Most of the time when using this syntax in class file is not working
we have to add reference then it work in class file
example using system.web write this syntax in class file
System.Web.HttpContext(HttpContext is not reflecting )
after that i add refrence system web than it reflect
None of the above solutions worked for me, but I did find one that worked: opening up the Administrative Tools/Services window and stopping the "WebClient" service. It's something of a pain to have to disable it when trying to work with my code, but it's easier than the logging off and back on I used to have to do.
--Problem Definition
------ whenever we debug our project (either by pressing ctrl+f5 or only f5) the first .exe which is called by VS is called WebDev.WebServer.EXE which got corrupted may be n number of reasons
--Solution
------ We need to replace this file
------Step 1 ---
go location C:\Program Files\Common Files\Microsoft Shared\DevServer\9.0
You will find this file
-------Step 2 ---
download WebDev.WebServer.rar file from
http://www.2shared.com/file/11532086/a7f9858a/WebDevWebServer.html
-------Step 3 ---
NOTE : You will need password for extraction this downloaded .rar file
Password : optimusprime
------ Step 4 ---
Copy the downloaded WebDev.WebServer.EXE file and replace in this below path
"C:\Program Files\Common Files\Microsoft Shared\DevServer\9.0
"
--------step 5------
run the program
Go to Run >> type >> cmd >> type
taskkill /IM webdev.webserver20.exe
and then try to re run the program
In my case I was using Windows 8 and Windows Firewall was blocking WebDev.WebServer.EXE
So I went to the settings of Windows Firewall > Allow an app through Windows Firewall > Add new
and browse to C:\Program Files (x86)\Common Files\Microsoft Shared\DevServer\11.0
Then select WebDev.WebServer to allow.
For some poor souls out there starting using TypeMock on ASP.NET unit tests like me, you need to disable it in Visual Studio to avoid this error: In Tools->Add-in Manager, untick the boxes for TypeMock Isolator. I guess you need to switch this back on for your unit tests.

Categories

Resources