How to compare TortoiseSVN project from different Repositories - c#

I have a c# project that I migrated from VS2010 to VS2015.
Each VS version of project had it's own Repository entry.
I want to compare current to a version from old repository - is this possible?
My structure is:
C:\Repositories\ProjectA
C:\Repositories\ProjectA_OLD
Is there a way to do this within VisualSVN?
If not, I could unix "diff" the inidivdual .cs files IF I new where the old version ones are stored. When I look in C:\Repositories\ProjectA_OLD, I don't see a "trunk" I just see:
drwxrwx---+ 1 Administrators None 0 Jun 18 05:59 locks
drwxrwx---+ 1 Administrators None 0 Jun 18 05:59 hooks
-rwxr-x---+ 1 Administrators None 251 Jun 18 05:59 README.txt
drwxrwx---+ 1 Administrators None 0 Jun 18 05:59 conf
-r-xr-x---+ 1 Administrators None 2 Jun 18 05:59 format
drwxrwx---+ 1 Administrators None 0 Nov 4 05:34 db
Where are the previous versions of files?

Related

Exec Format Error When Starting .NET 6.0 Linux Service

I have a .NET 6.0 minimal api that i have configured in my program.cs to run as a systemd service as seen below
if (Debugger.IsAttached == false)
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
builder.Host.UseWindowsService();
builder.WebHost.ConfigureKestrel(serverOptions =>
{
int port = 1000;
int.TryParse(config.GetValue<string>("MicroServicePort"), out port);
serverOptions.ListenAnyIP(port, listenOptions =>
{
listenOptions.Protocols = HttpProtocols.Http1AndHttp2;
listenOptions.UseHttps(config.GetValue<string>("WindowsCertificatePath"));
});
});
}
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
builder.Host.UseSystemd();
builder.WebHost.ConfigureKestrel(serverOptions =>
{
int port = 1000;
int.TryParse(config.GetValue<string>("MicroServicePort"), out port);
serverOptions.ListenAnyIP(port, listenOptions =>
{
listenOptions.Protocols = HttpProtocols.Http1AndHttp2;
listenOptions.UseHttps(config.GetValue<string>("LinuxCertificatePath"), config.GetValue<string>("CertificatePassword"));
});
});
}
}
I have published this service using the following Visual Studio profile
I did a self contained deployment thus I haven't installed the .NET runtime on the target linux server. As for the linux server, the uname -m command prints
x86_64 and the uname -a command prints:
Linux LoadTesting 4.18.0-305.el8.x86_64 #1 SMP Thu Apr 29 08:54:30 EDT 2021 x86_64 x86_64 x86_64 GNU/Linux
I then moved the published files to the linux (RedHat) server using WinSCP.
Below is the .service configuration file that i have put in /etc/systemd/system
[Unit]
Description=WebAPI
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=on-failure
RestartSec=60
User=johndoe
ExecStart=/usr/local/bin/Microservices/LinuxServices/WebAPI/Publish/WebAPI.dll
[Install]
WantedBy=multi-user.target
And finally the error that i am noting when i check the service logs by journalctl | grep WebAPI is:
Feb 03 02:39:42 LoadTesting systemd[1]: Stopped WebAPI.
Feb 03 02:39:42 LoadTesting systemd[1]: Started WebAPI.
Feb 03 02:39:42 LoadTesting systemd[14975]: WebAPI.service: Failed to execute command: Exec format error
Feb 03 02:39:42 LoadTesting systemd[14975]: WebAPI.service: Failed at step EXEC spawning /usr/local/bin/Microservices/LinuxServices/WebAPI/Publish/WebAPI.dll: Exec format error
Feb 03 02:39:42 LoadTesting systemd[1]: WebAPI.service: Main process exited, code=exited, status=203/EXEC
Feb 03 02:39:42 LoadTesting systemd[1]: WebAPI.service: Failed with result 'exit-code'.
Feb 03 02:40:42 LoadTesting systemd[1]: WebAPI.service: Service RestartSec=1min expired, scheduling restart.
Feb 03 02:40:42 LoadTesting systemd[1]: WebAPI.service: Scheduled restart job, restart counter is at 47.
Feb 03 02:40:42 LoadTesting systemd[1]: Stopped WebAPI.
I am very new to deploying services/APIs to linux so if there is a obvious config that i ought to already have done, feel free to bring it up.

.NET Core apps on Linux (Redhat) creating mysterious ".net" directories/files in user home directories

We have a series of .NET Core console apps that are installed in a particular directory:
/users/apps/app1/MyApp1
/users/apps/app2/MyApp2
etc...
The apps run fine. However, we have a problem where the .NET runtime seems to place some files in a ".net" folder in the current user's home directory.
unclejoe#myhost::/home/unclejoe> ls -la
total 40
drwx------. 8 unclejoe mygroup 139 Jan 24 14:42 .
drwxr-xr-x. 90 root root 4096 Jan 21 15:29 ..
-rw-------. 1 unclejoe mygroup 15510 Jan 24 14:42 .bash_history
drwx------. 10 unclejoe mygroup 190 Jan 24 01:42 .net
Within the .net folder, we see a bunch of seemingly temp folders:
[unclejoe#myhost .net]$ ls -la
total 4
drwx------. 10 unclejoe mygroup 190 Jan 24 01:42 .
drwx------. 14 unclejoe mygroup 4096 Jan 23 16:28 ..
drwx------. 4 unclejoe mygroup 46 Jan 24 12:09 MyApp1
drwx------. 5 unclejoe mygroup 66 Jan 24 01:42 MyApp2
Drilling further:
[unclejoe#myhost MyApp1]$ ls -la
total 24
drwx------. 4 unclejoe mygroup 46 Jan 24 12:09 .
drwx------. 10 unclejoe mygroup 190 Jan 24 01:42 ..
drwx------. 2 unclejoe mygroup 8192 Jan 24 01:42 cz1zui3n.uma
drwx------. 2 unclejoe mygroup 8192 Jan 24 12:09 pvwttlkm.z4s
Drilling furthest:
[unclejoe#myhost MyApp1]$ cd cz1zui3n.uma
[unclejoe#myhost cz1zui3n.uma]$ ls -l
total 30808
-rw-r--r--. 1 unclejoe mygroup 330240 Jan 24 01:42 Autofac.dll
-rw-r--r--. 1 unclejoe mygroup 16384 Jan 24 01:42 Autofac.Extensions.DependencyInjection.dll
-rw-r--r--. 1 unclejoe mygroup 143609 Jan 24 01:42 MyApp1.deps.json
-rw-r--r--. 1 unclejoe mygroup 10752 Jan 24 01:42 MyApp1.dll
-rw-r--r--. 1 unclejoe mygroup 149 Jan 24 01:42 MyApp1.runtimeconfig.json
-rw-r--r--. 1 unclejoe mygroup 27136 Jan 24 01:42 Common.dll
The problem is we don't expect these artifacts (dlls/app binaries) to be pushed here as its eating up a lot of space over time, especially when these strange temp directories get created (and never cleaned up on its own). We do not specify any environment variable in our .NET code to point to this home location.
Question:
Do you know what's causing these directories and files to get created? It appears to get created when the app runs after some period of time.
Any areas that we should be checking to identify root cause?
Thanks!
Are the apps published as Single File Applications? If so, the documentation have some pointers.
Looking at the fact that it's extracting 3rd-party libraries, I'm guessing this may be relevant:
Previously in .NET Core 3.0, when a user runs your single-file app, .NET Core host first extracts all files to a directory before running the application. .NET 5 improves this experience by directly running the code without the need to extract the files from the app.
And this explains the location:
If extraction is used the files are extracted to disk before the app
starts:
If environment variable DOTNET_BUNDLE_EXTRACT_BASE_DIR is set to a
path, the files will be extracted to a directory under that path.
Otherwise if running on Linux or MacOS, the files will be extracted to
a directory under $HOME/.net.
If running on Windows, the files will be
extracted to a directory under %TEMP%/.net.

How to execute a .NET Core console application on startup as a (daemon) service for the raspberry pi

I would like to know how i can run a dotnet console application as a service on a raspberry pi.
I can start the application mannualy by typing '''./dotnet/garagedeur_pi/publish/Garagedeur'''
I've created a Garagedeur.Service file:
Description=Garagedeur
[Service]
ExecStart=/home/pi/dotnet/garagedeur_pi/publish/Garagedeur.dll
WorkingDirectory=/home/pi/dotnet/garagedeur/pi/publish
#Restart=always
#RestartSec=10
User=pi
[Install]
WantedBy=multi-user.target
When I check the status I get this:
● Garagedeur.service - Garagedeur
Loaded: loaded (/lib/systemd/system/Garagedeur.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2020-02-17 12:09:49 CET; 11min ago
Process: 1142 ExecStart=/home/pi/dotnet/garagedeur_pi/publish/Garagedeur.dll (code=exited, status=200/CHDIR)
Main PID: 1142 (code=exited, status=200/CHDIR)
Feb 17 12:09:49 raspberrypi systemd[1]: Started Garagedeur.
Feb 17 12:09:49 raspberrypi systemd[1142]: Garagedeur.service: Changing to the requested working directory failed: No such file or directory
Feb 17 12:09:49 raspberrypi systemd[1142]: Garagedeur.service: Failed at step CHDIR spawning /home/pi/dotnet/garagedeur_pi/publish/Garagedeur.dll: No such file or directory
Feb 17 12:09:49 raspberrypi systemd[1]: Garagedeur.service: Main process exited, code=exited, status=200/CHDIR
Feb 17 12:09:49 raspberrypi systemd[1]: Garagedeur.service: Failed with result 'exit-code'.
Any help is greatly appreciated.
Solution:
Just read the error message and see that garagedeur/pi/ is different from garagedeur_pi/. Also there is a difference between Garagedeur.dll and Garagedeur – M. Spiller Feb 17 at 11:33
You can look here how to create the service file Host ASP.NET on Linux with Nginx.
In your service file you have to add the location of .NET installation, like this:
ExecStart=/usr/bin/dotnet /home/pi/dotnet/garagedeur_pi/publish/Garagedeur.dll
Here a example:
[Unit]
Description=Garagedeur
[Service]
ExecStart=/usr/bin/dotnet /home/pi/dotnet/garagedeur_pi/publish/Garagedeur.dll
WorkingDirectory=/home/pi/dotnet/garagedeur/pi/publish
Restart=always
RestartSec=10
User=pi
[Install]
WantedBy=multi-user.target
The path /usr/bin/dotnet is depending were you have installed .NET. On my raspberry pi this path is /home/pi/dotnet-arm32/dotnet. You can finde the right path with the command
dotnet --info

what is difference between cli and mono in unix

If I start the application directly
./coolappimade.exe
it get started using /usr/bin/cli. What is difference between this and /usr/bin/mono if any? What is better, start is as "native" or using mono?
As Bobson suggested, it is a symlink, I forgot to check...
So:
$ which cli
/usr/bin/cli
$ which mono
/usr/bin/mono
$ ls -l /usr/bin/mono
-rwxr-xr-x 1 root root 3054984 Jul 24 2012 /usr/bin/mono
$ ls -l /usr/bin/cli
lrwxrwxrwx 1 root root 21 Apr 17 16:16 /usr/bin/cli -> /etc/alternatives/cli
$ ls -l /etc/alternatives/cli
lrwxrwxrwx 1 root root 13 Apr 17 16:16 /etc/alternatives/cli -> /usr/bin/mono
Therefore on first sight, there is no difference (this is default way how it is installed in ubuntu). After reading http://www.mono-project.com/Guide:Running_Mono_Applications I figured out that the reason why this happens is that the debian packages of mono are registering the .exe as non-native binaries, that are executed using /usr/bin/cli (which is symlink to another symlink to /usr/bin/mono - why is that instead of directly running mono - nobody knows :)). This is just another way to execute mono binaries - according to linked page it's not recommended because it's linux only

Resco MobileApp Studio - crash when adding datasource

I'm trying to get the Resco MobileApp Studio demo working. It crashes Visual Studio when I try to add a datasource (SQL CE database file). Here's the error from the event log:
Version=1
EventType=CLR20r3
EventTime=129227782741643080
ReportType=1
Consent=1
UploadTime=129227782742193080
ReportIdentifier=131751b8-87ef-11df-91fd-001c7e7f92a5
Response.BucketId=1239928215
Response.BucketTable=5
Response.type=4
Sig[0].Name=Problem Signature 01
Sig[0].Value=devenv.exe
Sig[1].Name=Problem Signature 02
Sig[1].Value=9.0.30729.1
Sig[2].Name=Problem Signature 03
Sig[2].Value=488f2b50
Sig[3].Name=Problem Signature 04
Sig[3].Value=Resco.Wizard
Sig[4].Name=Problem Signature 05
Sig[4].Value=1.0.0.0
Sig[5].Name=Problem Signature 06
Sig[5].Value=4c2b4e90
Sig[6].Name=Problem Signature 07
Sig[6].Value=17
Sig[7].Name=Problem Signature 08
Sig[7].Value=1
Sig[8].Name=Problem Signature 09
Sig[8].Value=System.IO.FileNotFoundException
DynamicSig[1].Name=OS Version
DynamicSig[1].Value=6.1.7600.2.0.0.256.48
DynamicSig[2].Name=Locale ID
DynamicSig[2].Value=3081
UI[2]=C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe
UI[3]=Microsoft Visual Studio has encountered a problem and needs to close.
UI[4]=If you had files open that contained unsaved changes, these changes might be lost.
UI[5]=Check online for a solution and restart the program
UI[6]=Check online for a solution later and close the program
UI[7]=Close the program
Sec[0].Key=LCID
Sec[0].Value=1033
State[0].Key=Transport.DoneStage1
State[0].Value=1
FriendlyEventName=Stopped working
ConsentKey=CLR20r3
AppName=Microsoft Visual Studio
AppPath=C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe
Any advice appreciated. I've tried emailing Resco yesterday but they haven't replied. I thought they had good support?
Cheers
Mark
I think the reason this wasn't working was I didn't have the controls appearing in the toolbox. I'm not sure as I've decided not to bother testing this product and just use the controls. Also Resco advised me that they found an issue running the product under Windows 7 and have updated it yesterday.

Categories