Deployment of a asp.net core 6.0 application on a remote PC - visual-studio-2022

I would like to deploy my asp.net core 6.0 application on a remote PC using the publish option in visual studio 2022.
When I check the connection with the remote machine, I get the following error message :
ERROR_DESTINATION_NOT_REACHABLE
The remote PC is not configured as a server. I create the local administrator account "Sylvain' on it that I use for publishing.
I did a "net start wmsvc & net start msdepsvc" on the remote PC, as described in the following page :
web deploy error codes
But it doesn't work
Any idea ?

Related

Connect VS2022 debugger to ASP.NET Core application hosted on windows server IIS (2019)

I'm having issues with ASP.NET Core 6 app on my VPN Windows server 2019. Basically, I have Syncfusion OCRProcessor with tesseract files, but my application can't find part of the path for tesseract binaries on server when locally is working fine (on server error message is "cannot find part of the path C:\inetpub\wwwroot\myapp\x64").
After contacting Syncfusion support didn't solve the issue, I have checked for permissions in file system, double checked the locations of the binaries on IIS, checked if dll's are blocked in from Windows in file system. I have tried to connect from my machine with VS 2022 Community to my VPN server (public IP address) to try to debug the application, but going trough all the documents about remote debugging, still I can't connect to my app and hit the breakpoint in code to determine what is happening..
I have installed remote debugger for VS 2022 onto server, configure it and started, I have published application again over web deploy with debug config to IIS, but I just don't understand next step - how to attach to the process on external server..
Most of the videos and documentation suggests that IIS is installed locally on development machine, or IIS is on some PC in local network, but I have public server.. Can anyone help with the advice how to proceed further?
Thanks!
Ok, I have managed to connect debugger from VS 2022 to IIS.
The issue was in port, firewall and also in description on Microsoft help site https://learn.microsoft.com/en-us/visualstudio/debugger/remote-debugging-aspnet-on-a-remote-iis-7-5-computer?view=vs-2022 where in step 3 is written "Set the Qualifier field to and press Enter." - you need to enter ip address and port into connection target textbox.
After succesfull logging in onto server, I needed to select w3wp.exe process with title "CoreApp: https://.. ", set breakpoint in VS 2022 and open ASP.NET Core app in browser. After that I managed to debug application on IIS.
Hope this would be helpful to someone!

ASP.Net Core API giving a 503 error from SSIS

I can't get my IIS site to run and I've tried most of the solutions I've seen. I started with a clean IIS server for testing this. If I try to access via the DNS name I get a 503. If instead I get on the webserver and run dotnet path\to\app.dll it starts without issue, and I can then curl localhost:5000/weatherforecast and get back the default JSON. So the app itself is clearly fine and working, it's something in the IIS config. Here's what I did:
Installed the .NET Core Hosting Bundle on my Windows Server 2019 system, then rebooted.
Ran Computer Management and in System Tools -> Local Users and Group -> Groups I added the domain account to both Users and IIS_IUSRS groups.
In IIS Manager I created a new site and set the binding to my DNS name on port 80.
Set the application pool for that new site to No Managed Code for the CLR version and set the identity to the domain account.
Created a default VS 2019 ASP.NET Core API, set the target framework to .NET 5.0
Published, via a Folder Profile, with a target framework of net5.0 and a runtime of win-x64.
Restarted the IIS site then went to http://my.domain.name/weatherforecast and got a 503.
I'm not even remotely close to being an IIS administrator, so at this point I don't know how to further debug the issue.

How to debug an Asp.Net Mvc Application in Visual Studio 2012 from a remote computer

I have two computers connected and I have made Remote Desktop Connection from Computer A to Computer B.
I opened Visual Studio 2012 in Computer B , and started debugging Asp.Net MVC Application , it works correctly in browser of local machine and it is also hosted on IIS. But when I open that MVC Application from Computer A's browser , than debuging does not work , i.e. no breakpoints are hit.
I have searched about it , and came across Remote Debugging Monitor , but I am not able to use it.
I need help in this.
If your remote machine is also the IIS server:
If you share your Remote Debugger Folder out so it can be accessed on the remote machine. Folder for 2012 should be
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Remote Debugger
On the remote machine access the folder and run the msvsmon.exe
It will give you a server name once launched. Then on your local machine, in VS2012, in the debug menu, select attach to process.
Enter the server name provided by the remote debugger into the Qualifier field and attach to the w3wp.exe process
if your IIS server is the localhost and your remote machine connects to it:
You dont need remote debugger, just attach to process from the debug menu and select the w3wp.exe process.
For good measure, here is the MSDN

WebDeploy gets Unauthorized error while deploying via remote Web Deployment Agent

I have a remote server (Win2008R2) with WebDeploy 3.0 installed on it. Web Management Service isn't installed on it (actually I tried to install it but it cannot be contacted due to closed ports on my side).
I'm trying to deploy a package (zip) to the server via local WebDeploy 3.0 tool.
Server.deploy.cmd /T /M:myserver.no-ip.org "/U:myserver\Administrator" "/P:pwd" /A:Basic
I tried both Basic and NTLM auth methods.
I'm getting error:
Error Code: ERROR_USER_NOT_ADMIN
More Information: Connected to 'myserver.no-ip.org' using the Web Deployment Agent Service, but could not authorize. Make sure you are an administrator on 'myserver.no-ip.org'. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_NOT_ADMIN.
Error: The remote server returned an error: (401) Unauthorized.
Error count: 1.
Please note that I'm actually connectin to WebDeploy Agent Service not Web Management Service. That's important as there are tons of info how to setup WMSrc with WebDeploy.
I know that WebDeploy Agent only supports connecting as Administrator. That is my case - I'm specifying the remote server Administrator credentials.
I tried to open WDAgentSrc url in the browser. I was promted for creditials and they were accepted.
I checked "Microsoft Web Deploy" log in the Event viewer - it's empty.
How to get it working?

Windows 2008R2 Server prerequisites to host WCF data services

I have made a WCF data service and a test client which both run fine on my local machine. The service is hosted on the local IIS on my machine.
Now I'm trying to setup a remote win 2008 R2 server to host the wcf data service, and this is where I run into trouble.
I have first tried to install "WCF Data Services 5.0 for OData V3" from http://www.microsoft.com/en-us/download/details.aspx?id=29306
But I get a "0x80070643 Fatal error during installation"-during installation. I have the log file if that helps.
Now I'm thinking, is it because I need to install "http://www.nuget.org/packages/Microsoft.Data.Services" on the server? I know I did this on my local machine. However this would require me to install Powershell, Visual Studio and NuGet on the server. Is this necessary to get things to work?
If you're using the NuGet packages in your project, then the easiest way is to bin-deploy the WCF DS runtime assemblies. More details here: http://blogs.msdn.com/b/astoriateam/archive/2012/08/29/odata-101-bin-deploying-wcf-data-services.aspx