MSDEPLOY: How can I access the command generated by Visual Studio - msdeploy

How can I access the MSDEPLOY command line generated by Visual Studio 2010.
I am asking because when I manually run MSDEPLOY I can easly deploy on a remote server and when I run it throught Visual Studio, I get this error
Web deployment task failed.(Remote Agent (url https://x.x.x.x:8172/msdeply.axd?site=Default Web Site) could not be contacted
Make sure the remote agent service is installed and started on the target computer.
An unsupported response was received. The response header 'MSDeploy.Response' was '' but 'v1' was expected
The remote server returned an error:(404) not found

If you follow this guys instructions you can see more verbose output:
http://sedodream.com/2010/11/04/WebDeployHowToSeeTheCommandExecutedInVisualStudioDuringPublish.aspx
FYI, I tested this myself because MSDeploy.exe from the command line was working but the Publish form Visual Studio 2010 wasn't working (using Web Deploy). MSBuild gave me the error messages I needed to fix my issues.
My issues were specifically that the web server I was deploying to did not have .NET 4 installed, and therefore the App Pools were set to 2.0. Visual Studio in all it's greatness says nothing about this, but MSBuild did. After that, I had an ACL issue and had to add another delegation rule in addition to the ones they tell you to add in the intro guides.

Related

Visual Studio 2017 throws error on debugging an ASP.NET MVC application

I am setting up my new workstation (Windows 10 Pro) with my ASP.NET projects with Visual Studio 2017. I have enabled local IIS and the project throws a timeout error while trying to debug the project.
It is not failing 100% of the time though, mostly fails but when it runs it is taking longer than expected to give the startup page. The error thrown is
Unable to start debugging on the web server. The operation has timed out
I did notice that the IIS worker process (w3wp.exe) was only executed in the completed console output. So it looks like the IIS worker process is not always being executed.
Any help would be appreciated!
Thank you!
The project runs successfully on an old workstation (Windows 10 Edu) with Visual Studio 2017. App pool settings has been compared between both and it seems same. IIS reset is tried as well. Visual studio has been repaired and IIS local has been restarted as well (unchecking and enabling followed by restarting the machine). Default app pool is used and its been recycled as well. Nothing worked!
Possibly the Visual Studio project version does not match the ASP.NET configured application pool. Update the ASP.NET version in the application pool and restart it.
Make sure you have the correct version of ASP.NET installed on IIS. A version mismatch between ASP.NET in IIS and the Visual Studio project can cause this issue. May need to set the framework version in web.config. To install ASP.NET on IIS, use the Web Platform Installer (WebPI).
If the issue is not related to IIS configuration, try the following steps:
Restart Visual Studio with administrator privileges and try again.
For example, using the Web to deploy some ASP.NET debugging scenarios that require elevated Visual Studio privileges.
If you are running multiple instances of Visual Studio, reopen your project in one instance of Visual Studio (with administrator privileges) and try again.
If using a HOSTS file with a local address, try using the loopback address instead of the computer's IP address.
If not using a local address, make sure the HOSTS file contains the same project URL as in the project properties, Properties > Web > Server or Properties > Debug, depending on the project type.
Reference link:
Visual Studio "Unable to start debugging on the web server. The web server did not respond in a timely manner.".

"Path too long" when publishing ASP.NET Core from Visual Studio 2017

I'm having a problem deploying an ASP.NET Core web app to a remote IIS server using Visual Studio 2017. Everything compiles and runs fine on my local machine but when I want to publish using VS, I keep getting error messages saying its unable to copy some files since the path length is too long.
I found a similar posting from 2015 but the selected answer there does not seem to work for me in VS2017.
I am able to publish manually via the CLI command:
dotnet publish -f netcoreapp2.2 -r win10-x64 --self-contained false -o c:\temp\publish
and then manually copy the output from the C:\temp\publish directory to the remote IIS server, but this seems unnecessarily long-winded given that Visual Studio 2017 has a publishing feature.
Does anyone know what settings need to be changed to get VS2017 to use a shorter path for its intermediate files instead of deepening the directory tree of my project directory?
keep your solution in simple path like d:\project\yourprojectname\youproject.sln and publish, IF there are so many subfolder then definitely it will throw error

ASP.Net Core 2 - IIS 502.5 Error

I am creating an ASP .Net Core (2.0) MVC application within Visual Studio 2017 which was working absolutely fine.
After turning off my computer yesterday and coming back to my application today, I now receive this browser error when I start the application in chrome without debugging.
Running dotnet run within the directory of the application, I can access the site just fine. It is just when I run it via Visual Studio/IIS Express I get this error.
HTTP Error 502.5 - Process Failure
The application builds and compiles just fine. I have also cleaned the solution.
Looking in the event logs I find:
Application 'MACHINE/WEBROOT/APPHOST/MYAPP' with
physical root 'C:\Users\Ben Hawkins\Desktop\Development Folder
\Dev\Website\Version_2\MYAPP\MYAPP\'
failed to start process with commandline 'C:\Program Files
(x86)\Microsoft Visual
Studio\2017\Community\Common7\IDE\Extensions\Microsoft\Web
Tools\ProjectSystem\VSIISExeLauncher.exe -argFile "C:\Users\Ben
Hawkins\AppData\Local\Temp\tmp3547.tmp"', ErrorCode = '0x80004005 :
0.
Within my output window in Visual Studio 2017 I recieve this message under
ASP NET CORE WebServer
Failed to initialize CoreCLR, HRESULT: 0x80131534
What I have tried:
Cleaning the solution, rebuilding etc
Restarting the computer
Trying to launch another application. (Same result)
Created a new application from scratch. Same result.
Repairing Visual Studio Community 2017. Same result.
Stopping/Closing IIS Express
My setup was working perfectly yesterday and suddenly is not.
Thank you for your time. I hope we can find a solution.
We finally found the issue! After logging on to the machine as a different user, we saw a warning that the main user had ignored initially. There was a 0 byte file in the root of the directory named "Program" with no file extension. It appears that this causes some sort of issue when VSIISExeLauncher.exe is invoked through Visual Studio. (Note it would work if executed from the command prompt). After deleting the file, everything worked!
We do not know how this file was placed there for certain, but suspect it was some sort of copy error when the user was pulling in files from his old hard drive.
I don't know if anyone else will come across this, but if so hopefully this helps!
Maybe you need install previous versions of .NET Core, isn't it? I installed here and it works now. I had only .NET Core 2.0 installed and I realized that applications with 1.1 stopped so when running. In Windows' event logs I've had the same error registered.
Try to change the IISExpress to IIS by creating new IIS profile and change the Lunch to IIS. It resolved my problem.
I have hit a very similar issue with ASP.net Core 2.0. I had copied my VS project to a new one, and I was getting this error message.
After doing some research, I was able to determine that the nlog.config file was not copied into the bin > Debug > net461 folder. Once I did this, I was able to run my application.
I found it by running dotnet run from the command line on my project where the csproj files live.
Had same issue yesterday (windows 10).
Solved it this way:
Update Microsoft.AspNetCore to latest (Nuget manager - 2.1.3)
Make sure the sdk also updated to latest version. if not, update it manually from Nuget console like this:
Install-Package Microsoft.NETCore.App -Version 2.1.3
Download and install latest ASP.NET Core/.NET Core: Runtime & Hosting Bundle
from here
Same problem with version 2.2. Reinstalling .NET Core SDK fixed the problem for us.
In my case, my project was setup as a website in IIS and the file "bin\IISSupport\VSIISExeLauncher.exe" was missing in the project's directory.
I simply selected "IIS" when debugging the project in Visual Studio 2019 and it generated the missing file. It also generated 2 text files (IISExeLauncherArgs.txt, pidfile.txt) in the IISSupport folder, made changes to my web.config file, and my project ran successfully.
After that I was able to access the local website that was setup in IIS without running it in Visual Studio.

ASP.NET on mono: System.TypeLoadException

I would like to develop a website with ASP and run it on a Ubuntu or Debian server using Mono. To start I have created a very simple application with Visual Studio on Windows and want to deploy it to a Ubuntu box, just to see that it works. But so far it doesn't.
What I have done: I have created an ASP.NET (version 2) application with Visual Studio 2012 on Windows. Then I have published the project to my file system an copied it to the server. It runs Mono version 3.2.8. I have configured a vhost following this instruction: http://devblog.rayonnant.net/2012/11/mvc3-working-in-mono-ubuntu-1210.html.
However, if I open the browser and try to open the website, I get a System.TypeLoadException. It says:
Description: HTTP 500.Error processing request.
Details: Non-web exception. Exception origin (name of application or object): <myprojectname>
Needless to say that this error does not occur in the debug environment.
I have been trying to fight this all day but I can't figure it out. Any help will be greatly appreciated.

Deploy from Visual Studio 2010 stopped working after upgrade to Web Deployment Tool 2.1

I have a web site project that has been existing for a while - it has been ASP.NET MVC2 based up until right now. .Net 4, Visual Studio 2010 Sp1, deployed to IIS 7.5 running on Win2008 R2.
I have four separate deployment profiles - "alpha", "test", "staging" and "live". Yes, I could probably have come up with better names, but they should hopefully convey what they are for.
It was recently decided to upgrade to MVC3 to take advantage of new awesomeness like Razor, global filter attributes, and start using NuGet etc. So I went on an upgrade binge with the Web Platform Installer. One of the things I updated was the Web Deployment Tool - both my developer machine (where the MVC3 upgrade happens) and the web server got this new version of the tool installed.
Since then, I have not been able to do deployments. I have gone back to earlier versions of my project (thanks to git for allowing me to painlessly go back to any previous version) and tried to deploy them, and they don't work either.
Whenever I try to do a deployment from Visual Studio I get the following error:
Web deployment task failed.((23.05.2011 11:18:24) An error occurred when the request was processed on the remote computer.)
(23.05.2011 11:18:24) An error occurred when the request was processed on the remote computer.
Unable to cast object of type 'Microsoft.Web.Deployment.DeploymentSyncOptions' to type 'Microsoft.Web.Deployment.DeploymentSyncOptions'.
I can see why that cast would be hard. ;)
But seriously - how can we get deployment from Visual Studio to work again? In the future we will do this using our CI server, and install a deployment package using MsBuild automatically on the correct web server depending on the git branch that was updated, but that is some time in the future.
I have full access to both machines so any other information need can hopefully be gathered.
You might be having beta version of web deploy on your box if you have ever installed web platform installer v2 beta. YOu can check that by
gacutil -l Microsoft.web.deployment.
If you see any 7.5.0.0 version then you have a beta version. Uninstall this version. You need to check and change this on both the client as well as the server.
Owais is right - this is very likely because you have a pre-release version installed. Rune can you please check and let me know?

Resources