Remote debugging vagrant asp.net webform site - asp.net

I'm not sure this is possible from the docs, but can you remote debug an vagrant ASP.NET webforms site using omnisharp remote debugger? I can't find much info on this anywhere
EDIT:
Trying to setup omnisharp for VScode
https://github.com/OmniSharp/omnisharp-vscode/wiki/Attaching-to-remote-processes
I'm using this vagrant setup
https://github.com/dmitry-zaets/vagrantfile-windows-iis-mssql/blob/master/Vagrantfile
I also added ASP.Net to this box
DISM /online /enable-feature /featurename:IIS-ISAPIFilter
DISM /online /enable-feature /featurename:IIS-ISAPIExtensions
DISM /online /enable-feature /featurename:IIS-NetFxExtensibility
DISM /online /enable-feature /featurename:IIS-ASPNET

Related

How do I use Visual Studio 2019 to remotely debug a .NetCore application on a Hyper-V Linux VM?

I am attempting to remotely debug a .NetCore application in Ubuntu Linux from Visual Studio 2019 in Windows 10. I can see the remote ipaddress (ping thru command line). I can RDT to the ipaddress. I can successfully transfer files to it via WinSCP.
I created a simple .NetCore "HelloWorld" app and copied onto the Linux VM.
I used the following commands to build and publish:
dotnet build -r linux-x64
dotnet publish --self-contained -r linux-x64
I ran the following command on the Linux VM to ensure that ssh is functional:
sudo apt-get install openssh-server unzip curl
The app is running on Linux.
From VS I try to attach to the process:
I get prompted for logon:
I get the following error:
Is there a step I'm missing somewhere?
Is there a configuration/permissions issue I am unaware of?
Thanks, JohnB
Microsoft has documented debugging a Linux target from a Windows development machine at https://learn.microsoft.com/en-us/visualstudio/debugger/remote-debugging-dotnet-core-linux-with-ssh?view=vs-2022
Unfortunately, using that method, you will need to manually deploy and manually attach the debugger. If you'd like Microsoft to change that, then it would be wise to upvote this issue: https://developercommunity.visualstudio.com/t/Convenient-way-to-add-a-remote-debug-con/917516
A 3rd party developer has created a Visual Studio extension that provides this missing feature to Visual Studio. It can be downloaded from https://github.com/radutomy/VSRemoteDebugger
I had the same problem initially because I didn't enter the connection target in the first screen.
After having entered the correct target myusername#192.168.178.95 in the first screen the second screen did not show up any longer and I got the expected list of processes

Couldn't install Microsoft.VisualStudio.AspNet45.Feature

Im having these problem after installing ASP.net on Visual Studio 2017
//Couldn't install Microsoft.VisualStudio.AspNet45.Feature
Package 'Microsoft.VisualStudio.AspNet45.Feature,version=15.7.27520.0'
failed to install.
Search URL
https://aka.ms/VSSetupErrorReports?q=PackageId=Microsoft.VisualStudio.AspNet45.Feature;PackageAction=Install;ReturnCode=87
Details
Command executed: "C:\Windows\system32\dism.exe" /online /quiet /norestart /Enable-Feature
/FeatureName:"netfx4extended-aspnet45" /All
/logPath:"C:\Users\lenovo\AppData\Local\Temp\dd_setup_20180624000214_074_Microsoft.VisualStudio.AspNet45.Feature.log"
Return code: 87
Return code details: No file path specified.
Log
C:\Users\lenovo\AppData\Local\Temp\dd_setup_20180624000214_074_Microsoft.VisualStudio.AspNet45.Feature.log
Impacted workloads
ASP.NET and web development (Microsoft.VisualStudio.Workload.NetWeb,version=15.7.27625.0)
Impacted components
Advanced ASP.NET features (Microsoft.VisualStudio.Component.AspNet45,version=15.7.27625.0)
As per thread https://developercommunity.visualstudio.com/content/problem/175324/couldnt-install-microsoftvisualstudioaspnet45featu.html this issue has been fixed in latest Visual Studio update. Please install latest Visual Studio update and then try.

Check the IIS virtual path in IIS 7.5

I am trying to encrypt some sections of the web.config file of one of my applications by using RSA encryption at user level.
So I followed all the steps listed in here and I succesfully created the provider and granted access to my application. However, I have some problems in specifying the virtual path for my application.
I run IIS 7.5 in a Windows Server 2008 R2. My application is called www.testsite.com and its ID is 4.
The aspnet_regiis tool is placed in the Windows\Microsoft.NET\Framework\[version] folder:
Therefore in order to encrypt the connectionStrings section I run the command:
aspnet_regiis -pe connectionStrings -app "[Application Path]" -prov "myRSAProvider"
I tried as [Application Path], the followings:
/W3SVC/4
/W3SVC/4/root
/W3SVC/4/root/www.testsite.com
/www.testsite.com
And I always receive the error
The configuration for virtual path '[Application Path]' and site
'Default Web Site' cannot be opened.
Failed to map the path '[Application Path]'. Failed!
I tried to browse many resources on the web but this IIS virtual path specification is not extensively covered. In IIS6 I could get it by running aspet_regiis -lk but this command does not work anymore in IIS 7.5. May somebody help?
You may be having two issues.
At the end of your command statement specify your site with the command -site "4" Also note that instead of the #4 you could write in your site name instead. e.g. -site "www.testsite.com"
aspnet_regiis -pe connectionStrings -app "[Application Path]" -prov "myRSAProvider" -site "4"
It is also very important that you run the command prompt as Administrator.
I had the same error you had running IIS 7.5 in a Windows Server 2008 R2 and this is what helped me.

Command to add IIS6 Management Compatibility role in IIS7

I have tried adding IIS6 Management Compatibility role in IIS7 through the following command but it is not working. For rest of the roles same format have worked. Any ideas?
Used commands:
start /w pkgmgr /iu:IIS6-MetabaseCompatibility;
start /w pkgmgr /iu:IIS-IIS6MetabaseCompatibility;
Generally for windows features you can use the DISM too from command line. Reference Here: http://technet.microsoft.com/en-us/library/dd744382(WS.10).aspx
Use the command line
Dism /online /Get-Features
To browse for available features. Pick the one you like!
Dism /online /enable-feature /FeatureName:[yourfeaturehere]

How to get rid of this error Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list

Using IIS7.5, the website works fine in Visual Studio but when I try to deploy on IIS get the following error.
Module IIS Web Core
Notification ExecuteRequestHandler
Handler PageHandlerFactory-Integrated
Error Code 0x8007000d
Requested URL http://localhost:80/EFT/default.aspx
Physical Path
C:\inetpub\wwwroot\EFT_Converter\default.aspx
Logon Method
Anonymous
Logon User
The version of .Net you are using has not been registered with IIS correctly.
If it is .Net version 4 on a 64-bit 2008 server use these two commands to fix it.
%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i
%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i
Open command prompt on window and run:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\ aspnet_regiis.exe -i
This will resolve your issue.
Where your handlers are defined in the web.config, add a <clear /> before the first item in the list, if there is not one there already. Also make sure that the application pool running the web site is running the version of .Net that you are targeting in your code.
Try to set web config in this way:
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
</system.webServer>
Ensure you have ASP.NET has been installed correctly. You should see default application pool named "ASP.NET 4" or something like this. If it's not looks like ASP.NET not installed correctly. Try aspnet_regiis -i in .NET 4 CMD.
Please go through this post.
From the post:
Click Start -> All Programs -> Accessories -> Run
In the Open textbox paste in the following line (see list of all .NET Framework version install, repair and unistall command lines here):
For silent repair on 32 bit computer with .Net Framework version 4.0.30319 use:
%windir%\Microsoft.NET\Framework\v4.0.30319\SetupCache\Client\setup.exe /repair /x86 /x64 /ia64 /parameterfolder Client /q /norestart
For silent repair on 64 bit computer with .Net Framework version 4.0.30319 use:
%windir%\Microsoft.NET\Framework64\v4.0.30319\SetupCache\Client\setup.exe /repair /x86 /x64 /ia64 /parameterfolder Client /q /norestart
2. Click OK to start the repair.
3. After, the repair ran for a few minutes, I restarted IIS 7.5, and things began to work correctly!
I had this problem and found that removing the following folder helped, even with the non-Express edition.Express:
C:\Users\<user>\Documents\IISExpress

Resources