Locating CLI error logs when deploying an ASP.NET MVC5 app using web deploy fails - webdeploy

I am trying to deploy an ASP.NET MVC5 web app (web deploy deployment package) on my Windows Server using Command Prompt as I have done countless of times before with the same web app. When I try running the command
myproject.deploy.cmd /t
inside the correct folder the process starts but then abruptly stops and the CLI window closes.
Just before the window disappears I can see an error message in red, but I just do not have enough time to read what it says.
My question is where does one find the logs for commands that have failed? Alternatively is there a way to force the CLI to stay open in order to read the error displayed?

I managed to find the logs in the Event Viewer:
Event Viewer -> Applications and Services -> Microsoft -> Windows -> WebDeploy -> Errors

Related

ASP.NET Core Web Application console closes immediately

I'm trying to run an ASP.NET Core Web Application using its console profile. The console opens and closes immediately so I get ERR_CONNECTION_REFUSED error in browser. Is it possible to find out why the console/host closes? There is nothing in event log and I've enabled stdout but it doesn't produce any output.
Try to start you app from already open console window.
Run cmd, navigate to your project folder and execute dotnet run.
Your app will start and terminate, but console window will remain open and you will see exception (if any) or other output that may help you.

Web app not responding on localhost:5000 when run standalone

I have simple DotNet Core app that runs fine with dotnet run but when I do dotnet publish and then dotnet HelloWorld.dll (in the bin/Debug/netcoreapp1.1 directory; same with bin/Rebug/netcoreapp1.1), on my local machine, the command prompt says "Now listening on: http://localhost:5000" but the service is not responding when I navigate to that address with my browser. Are there any kind of logs to review?
I reproduce the same in Windows 10 and OSX 10.11, both with clean dotnet new -t web projects, without any modifications.
In Windows I ran netstat -noa | find "LISTENING" and can see port 5000 at the bottom of the list. But still no connection when I try.
Ideas?
The browser output is:
The localhost page isn’t working
localhost is currently unable to handle this request.
HTTP ERROR 500"
I run .Net Core 1.1.0 - SDK 1.0.0 Preview 2.1-003177 on both the Windows and Mac machine.
Click on the ^ icon of your toolbar to see hidden icons. If IIS is running, you will be able to see each instance and the port that the instance is listening on
I got the same error. To diagnose the error, I started up the app not in IIS Express but in what I think is a self-hosted option that opens in a console window.
If you look through the log in the console window, you might see an error in that log.
Also, I've noticed that sometimes the browser window pops up and navigates to the URL before the host environment is ready to handle the request. All you have to do when you get this error is wait a second and refresh the page, and the host environment will be ready and the page will load.

Web server for ASP.NET 5 that works without debugging active

sorry if this is a stupid question but I don't get it.
So I've created an ASP.NET 5 page using Visual Studio 2015 and DNX.
Out of the box I have these two dependencies in my project.json:
"Microsoft.AspNet.Server.IIS": "1.0.0-beta4",
"Microsoft.AspNet.Server.WebListener": "1.0.0-beta4"
Under "commands" in project.json I have the following:
"web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5000"
In the project properties I can change profiles between "IIS Express" and "web" as deployment options. Both are working fine, when I start debug it starts the web server (either IIS Express or the WebListener) and the site is working. If I stop debugging the server stops. The WebListener opens a "dnx.exe" in a command prompt.
This pluggable server layer is really nice, I get the point. But how do I, as a developer setup an easy server where I can make a change to my site and quickly see the changes?
I can of course install IIS and create a site that is pointing to my wwwroot but is that my only option in the ASP.NET world? Can I have the WebListener "started in the background" (without showing me a command prompt with dnx.exe)? I can also start a node server but yet again - it's great that i can but why do I have to when I have the full ASP.NET toolbelt?
ASP.NET 5 has dynamic compilation but I'm not sure how to even test it since my web server is only started when I'm in debug mode.
I know that this is a pre-release but any help would be greatly appreciated.
But how do I, as a developer setup an easy server where I can make a
change to my site and quickly see the changes.
Regardless of the server used, you can use dynamic compilation by Starting the project without debugging (Shift + F5).
Due to architectural reasons, dynamic compilation does not work when starting with debugging (F5) in Visual Studio. This is due the fact that the difference between Shift + F5 and F5 is that in the latter, VS attaches the debugger to the process.
Will this every be supported in the future? That is unclear but right now because VS isn't "smart" enough to handle detaching from process, waiting for dnx to dynamically recompile, and then reattaching to the process. However until now it never had a reason to support such a scenario, so it is unclear if it is just a "it doesn't know how to do it yet" or a "it is impossible to do."
I can of course install IIS and create a site that is pointing to my
wwwroot but is that my only option in the ASP.NET world?
No. You can use any webserver which supports Microsoft.AspNet.Hosting. Today your choices are limited to IIS, IIS Express, and the two experimental servers you linked to but the goal is to enable third parties to develop alternatives by providing an interface that can be programmed against (Microsoft.AspNet.Hosting).
ASP.NET 5 has dynamic compilation but I'm not sure how to even test it
since my web server is only started when I'm in debug mode.
If the web application is running then the server is started. No webserver = no ASP.NET application. I assume by "debug mode" you mean "Start with Debug (F5)". If so then "Start without Debug (Shift + F5)" to fix the problem you're experiencing.
Here is an excercise:
Close Visual Studio (not a requirement but useful to show none of this is VS specific).
Start the web server. The easiest way would be dnx . web run from command line in the project root folder. You could however start IIS Express (should already be configured) or even configure the IIS and start it.
Verify the web server and web application is running by opening it in a browser.
Using notepad or some other text editor, edit a file in the project that would have a visible change or just force an error "throw new NullReferenceException()".
Save the file.
Refresh the browser.
The web application will reflect the change. You may notice a slight delay if you refresh quickly. That is the dynamic compilation to memory occurring.

MVC: workflow is not working in deployed server

In our MVC web application, we have integrated windows workflow. Its working locally without any issue. After deployment of the application in windows server 2008, workflow functionality is not working. I am not getting any error. But the application in browser is keep on running with no result.
Note: .Net4.5 framework is installed in server.
When I googled, I found few solutions and I tried the below
Right click the web site that hosts your service in the IIS Connections pane, click Manage Websites -> Advanced Settings and add ,net.pipe to the end of the “Enabled Protocols” setting (no spaces!)
Still facing the issue. Please guide to fix this issue
When I see the event viewer, I observed an information saying that
"Login failed for user 'IIS APPPOOL\ASP.NET v4.0'. Reason: Token-based server access validation failed with an infrastructure error. Check for previous errors."
I have added user, "IIS APPPOOL\ASP.NET v4.0" to DB Logins by openning SQL Management Studio, Navigate to database then open the Security then Logings and add new login. It solved the issue.

WCF Azure 403 error when running locally

I'm stumped. There are several threads out there that reference a similar problem, but not the same one. I'm trying to get a simple WCF service up and running in Azure, but my problem is happening before I even deploy. I'm following this article:
https://azure.microsoft.com/en-us/documentation/articles/cloud-services-how-to-create-deploy/
Which says to create your project, build the "Hello World" service interface and class, and then start your project locally. I get a 403 error when I try to start my project.
The only step I'm not following exactly is that I don't have a "Start Without Debugging" option (I'm using Visual Studio Express Web Developer), so I just push "Start Debugging."
Why would I get a 403 error on my own machine? I am running Visual Studio as Administrator.
On the WebRole project right click on your .svc (Service1.svc) and choose "Set As Start Page" And then run the project. Make sure to do this on the WebRole project not the Azure Cloude Project.
Is the Azure project the default project or is the WCF Web Role? If it's the role itself, that may be your issue - it's trying to access the root of virtual directory containing the web service versus running the cloud app in the local emulator. If you browse to http://127.0.0.1:81/Service1.svc in a new browser window do you still get the 403?
It seems VS has lost the its project settings. Bring up "Properties" page on the web service in VS. Go to the "Debug" tab. Under Servers/Virtual Path: my configuration was set to just "/". Put the name of your server back in there "/Service1.svc" and it should work from the debugger now. This fixed the problem for me.
The problem went away when I upgraded to VS 2010 Pro. I never fixed it on Express, but after upgrading the problem was gone ... I had the "Start without Debugging" option in the Pro edition, so I suspect that the problem may have been specific to Express.