GIT + HTTP fails across network - asp.net

As a follow on from this question on SO, I have been working with yysun's great handler-based solution for web access for GIT on a IIS platform. Their solution works perfectly when used locally on my machine (i.e. win 7, iis 7.5, .NET 4.0), but fails across the network.
Unfortunately, I need to have this running on a remote VM with Win 2003, IIS 6 and .NET 4. I'm running the web application as "Local Service" and have for now given that identity full control over the repo base directory. The web application can see the dir (i.e. enumerate git repos under that base dir) but when I try to do a "git clone" using TortoiseGIT, MSysGIT and cygwin GIT from my machine, I get the following error:
git.exe clone --progress -v "http://1.2.3.4/git/AgentDesktop.git" "C:\dev2\tmp"
fatal: http://1.2.3.4/git/AgentDesktop.git/info/refs not found: did you run git update-server-info on the server?
Initialized empty Git repository in C:/dev2/tmp/.git/
I've run "git update-server-info" and "git update-server-info -f" on the server repo, and the .../info/refs file does exist and contains the revision SHAs of the branches I want.
This seems to be a very common issue, but so far I can't see a definitive answer on how to fix it.
Any ideas?

This is not exactly what you are looking for... but maybe a change in tack would be good. What about using the IIS plugin IIRF to configure a reverse proxy to Gitblit. Gitblit is written in Java, not .NET. Or maybe just run Gitblit directly?

Related

Jetbains Rider remote debugging ASP.NET Core 6.0 apps through SSH kept failing

I am trying to remote debug via ssh on an ubuntu host at Ali with no success. I'm using the the latest Rider, 2022.1 EAP 10.
The error is:
Debugger worker was not initialized within 100,000 ms
I’m running Ubuntu 20.04 64bit on Ali Cloud. And one side note: for the following steps from Jetbrains documents, I wasn’t able to succeed:
cd /[application path]/WebApplication to go to the application root folder.
chmod +x ./WebApplication to add the executable bit if needed.
ASPNETCORE_URLS=http://0.0.0.0:5000 ./WebApplication to run the application
WebApplication is a directory, the OS kept complaining it's a directory even after chmod+x. I managed to run the self-contained executable.
It is always better to ask such questions in JetBrains public issue tracker.
This problem should already be fixed in the next Rider versions:
https://youtrack.jetbrains.com/issue/RIDER-76083

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

Dotnet Core publish to IIS from Mac

I want to publish my dotnet core app to IIS from mac. I use VS code for code writing and Dotnet Core 1.1 for publishing to local directory. (for example: bin/release/publish). There are compiled my files, ready to copy to IIS. On my IIS I currently have installed web deploy 3.6 and this is my VPS machine. Is there elegant way, how to copy files? The another way is using docker, but in this case I have the same problem. Generated docker file with docker publisher tool and I need to copy from mac os.
Thank you for your time.
From a terminal window navigate to the folder where your .csproj file is. From there run 'dotnet publish -c release'. A folder called publish will be created in bin/Release/netcoreappX.X. You can copy those files to the appropriate directory on your server. If you need help setting up IIS, follow the link below.
https://learn.microsoft.com/en-us/aspnet/core/publishing/iis
You can also run 'dotnet publish -h' to see all of the different arguments you can pass to the publish command.
Web Deploy (msdeploy.exe) seems to work in Mono, at least in WSL (Ubuntu 18.04). The tricky part is to extract the msi package somehow, which you can do easily on a Windows machine (you'll find the files in C:\Program Files\IIS\Microsoft Web Deploy V3).
Once you install Mono and obtain msdeploy.exe, just call the command, e.g.
mono msdeploy.exe -verb:sync -source:contentPath=/mnt/c/Data -dest:contentPath=test,ComputerName=https://example.com:8172/msdeploy.axd,UserName=WDeployAdmin,Password=PASSWORD,IncludeAcls=False,AuthType=Basic -enableRule:AppOffline -enableRule:DoNotDeleteRule -verbose -allowUntrusted:true
This lets you sync/copy the contents of /mnt/c/Data with the test web site in IIS on example.com with Web Deploy enabled.

unable to launch the configured development web server

i have tried to repair from VS via "add or remove program" in control panel, but the error still appear..
The first error appears when I try to update my VS
I had the same problem and the following procedure fixed it:
I have set the Firewall system manually. This means that, at the time of communication by programs Firewall notify me. Incorrectly linked to "devenv.exe" was blocked by the Firewall. Correct mode of communication "devenv.exe" will solve the problem. "devenv.exe" is located in the following path.
"C: \ Program Files (x86) \ Microsoft Visual Studio 12.0 \ Common7 \
IDE \ devenv.exe"
Devenv lets you set various options for the integrated development environment (IDE), and also build, debug, and deploy projects, from the command line.
Backup data
Uninstall VS
Install VS

error 1002: 'LMW3SVC/1/ROOT/MyFirstWebsite' is not a well formed IIS metabase path

I am trying to learn how to deploy my first website which is physically located here (C:\Users\Amal\Documents\Visual Studio 2008\WebSites\ErrorHandlingTest). I am using instructions from some book. after installing the Internet Information Services on my laptop which has Windows 7 ultimate on it. I added a virtual directory and gave it the alias (MyFirstWebsite). after that I was able to open the website just by typing
http://localhost/myfirstwebsite/mypage.aspx
on the address bar of my firefox v.21 browser.
the book then told me to do some code compilation to the website by using the command-line tool named aspnet_compiler.exe which is supposed to compile my website into binary files after running this command :
aspnet_compiler -m W3SVC/1/ROOT/MyFirstWebsite C:\MyFirstWebsiteDeply
but I got this error:
error 1002: 'W3SVC/1/ROOT/MyFirstWebsite' is not a well formed IIS metabase path.
I use asp.net 3.5 , visual studio 2008 , internet information services version 7.5.7600.16385
Try
aspnet_compiler -m LM/W3SVC/1/ROOT/MyFirstWebsite -f C:\MyFirstWebsiteDeply
You had missed the "LM" at the start of the metabase path.
Actually the iispath should be /LM/W3SVC/1/ROOT/XXX.
Pay attention to the '/' at the beginning.

Resources