<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Programmieren &#8211; Stefan Meyer</title>
	<atom:link href="https://blog.meyer-luenen.de/category/programmieren/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.meyer-luenen.de</link>
	<description>Lose-Blatt-Sammlung</description>
	<lastBuildDate>Sun, 23 Jun 2024 12:46:11 +0000</lastBuildDate>
	<language>de</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>

<image>
	<url>https://i0.wp.com/blog.meyer-luenen.de/wp-content/uploads/2018/12/cropped-StM-Portrait-Raesfeld-600x600-removebg-2.png?fit=32%2C32&#038;ssl=1</url>
	<title>Programmieren &#8211; Stefan Meyer</title>
	<link>https://blog.meyer-luenen.de</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">148105417</site>	<item>
		<title>GitHub Short Story</title>
		<link>https://blog.meyer-luenen.de/2024/06/23/github-short-story/</link>
		
		<dc:creator><![CDATA[Stefan]]></dc:creator>
		<pubDate>Sun, 23 Jun 2024 12:46:11 +0000</pubDate>
				<category><![CDATA[Programmieren]]></category>
		<guid isPermaLink="false">https://blog.meyer-luenen.de/?p=752</guid>

					<description><![CDATA[https://chatgpt.com/share/f3b0068a-a07f-49d5-a920-889ce7777391]]></description>
										<content:encoded><![CDATA[
<p><a href="https://chatgpt.com/share/f3b0068a-a07f-49d5-a920-889ce7777391">https://chatgpt.com/share/f3b0068a-a07f-49d5-a920-889ce7777391</a></p>



<p></p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">752</post-id>	</item>
		<item>
		<title>.NET 6 &#038; .NET 8 auf einem Ubuntu-Server installieren und ansprechen</title>
		<link>https://blog.meyer-luenen.de/2024/03/23/net-6-net-8-auf-einem-ubuntu-server-installieren-und-ansprechen/</link>
		
		<dc:creator><![CDATA[Stefan]]></dc:creator>
		<pubDate>Sat, 23 Mar 2024 10:56:58 +0000</pubDate>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Linux / Unix]]></category>
		<guid isPermaLink="false">https://blog.meyer-luenen.de/?p=739</guid>

					<description><![CDATA[To install .NET 6 and .NET 8 in parallel on Ubuntu Server and access these versions, follow these steps: For .NET 8: Alternatively, you can use the dotnet --list-sdks command to list all installed SDKs and dotnet --version to see the default SDK version. Use the dotnet new globaljson --sdk-version &#60;version&#62; command to generate a [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>To install .NET 6 and .NET 8 in parallel on Ubuntu Server and access these versions, follow these steps:</p>



<ol class="wp-block-list">
<li><strong>Add Microsoft Package Signing Key to your list of trusted keys and add the package repository:</strong> First, update the package index and install the required dependencies:</li>
</ol>



<pre class="wp-block-code"><code>   sudo apt-get update; \
   sudo apt-get install -y apt-transport-https &amp;&amp; \
   sudo apt-get update &amp;&amp; \
   sudo apt-get install -y dotnet-sdk-6.0 dotnet-sdk-8.0</code></pre>



<ol class="wp-block-list" start="2">
<li><strong>Install .NET SDKs:</strong> You can install both .NET 6 and .NET 8 SDKs using the following commands:</li>
</ol>



<pre class="wp-block-code"><code>   sudo apt-get install -y dotnet-sdk-6.0
   sudo apt-get install -y dotnet-sdk-8.0</code></pre>



<ol class="wp-block-list" start="3">
<li><strong>Accessing the Specific .NET Versions:</strong> After installation, you can specify which version of the .NET SDK to use for a specific project by using a global.json file in the project directory. To specify the SDK version, create a <code>global.json</code> file with the following content: For .NET 6:</li>
</ol>



<pre class="wp-block-code"><code>   {
     "sdk": {
       "version": "6.0.0"
     }
   }</code></pre>



<p>For .NET 8:</p>



<pre class="wp-block-code"><code>   {
     "sdk": {
       "version": "8.0.0"
     }
   }</code></pre>



<p>Alternatively, you can use the <code>dotnet --list-sdks</code> command to list all installed SDKs and <code>dotnet --version</code> to see the default SDK version. Use the <code>dotnet new globaljson --sdk-version &lt;version&gt;</code> command to generate a <code>global.json</code> for a specific version.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">739</post-id>	</item>
		<item>
		<title>Visual Studio Code Remote Development</title>
		<link>https://blog.meyer-luenen.de/2024/03/07/visual-studio-code-remote-development/</link>
		
		<dc:creator><![CDATA[Stefan]]></dc:creator>
		<pubDate>Thu, 07 Mar 2024 12:36:01 +0000</pubDate>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Linux / Unix]]></category>
		<guid isPermaLink="false">https://blog.meyer-luenen.de/?p=736</guid>

					<description><![CDATA[Um auf einem Ubuntu-Server das Remote Dedugging zu installieren (Achtung: sollte man nicht auf einen Produktionsserver tun!):]]></description>
										<content:encoded><![CDATA[
<p>Um auf einem Ubuntu-Server das Remote Dedugging zu installieren (Achtung: sollte man nicht auf einen Produktionsserver tun!):</p>



<pre class="wp-block-code"><code>curl -sSL https://aka.ms/getvsdbgsh | bash /dev/stdin -v latest -l ~/.vs-debugger</code></pre>



<p></p>



<p></p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">736</post-id>	</item>
		<item>
		<title>Login-Seiten für MS-Identity</title>
		<link>https://blog.meyer-luenen.de/2023/12/16/login-seiten-fuer-ms-identity/</link>
		
		<dc:creator><![CDATA[Stefan]]></dc:creator>
		<pubDate>Sat, 16 Dec 2023 15:01:22 +0000</pubDate>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Entity Framework]]></category>
		<guid isPermaLink="false">https://blog.meyer-luenen.de/?p=708</guid>

					<description><![CDATA[aspnet-codegenerator installieren:]]></description>
										<content:encoded><![CDATA[
<p>aspnet-codegenerator installieren:</p>



<pre class="wp-block-code"><code>dotnet tool install -g dotnet-aspnet-codegenerator --version 6.0.0</code></pre>



<p></p>



<pre class="wp-block-code"><code>dotnet aspnet-codegenerator identity -dc ApplicationDbContext<br>oder wenn vorhanden:<br>dotnet aspnet-codegenerator identity -dc ApplicationDbContext --force</code></pre>



<pre class="wp-block-code"><code>dotnet add package Microsoft.VisualStudio.Web.CodeGeneration.Design<br>dotnet add package Microsoft.VisualStudio.Web.CodeGeneration.Design --version 6.0.0</code></pre>



<pre class="wp-block-code"><code>dotnet aspnet-codegenerator identity -dc MyBlazorApp.Data.ApplicationDbContext --files "Account.Register;Account.Login;Account.Logout"


Quelle:
<a href="https://learn.microsoft.com/de-de/aspnet/core/fundamentals/tools/dotnet-aspnet-codegenerator?view=aspnetcore-8.0" target="_blank" rel="noreferrer noopener">https://learn.microsoft.com/de-de/aspnet/core/fundamentals/tools/dotnet-aspnet-codegenerator?view=aspnetcore-8.0
</a>



</code></pre>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">708</post-id>	</item>
		<item>
		<title>EntityFramework.Core in eine .net Core Blazor WebApp integrieren</title>
		<link>https://blog.meyer-luenen.de/2023/09/02/entityframework-core-in-eine-net-core-blazor-webapp-integrieren/</link>
		
		<dc:creator><![CDATA[Stefan]]></dc:creator>
		<pubDate>Sat, 02 Sep 2023 12:20:13 +0000</pubDate>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Entity Framework]]></category>
		<guid isPermaLink="false">https://blog.meyer-luenen.de/?p=685</guid>

					<description><![CDATA[1. Install necessary packages: For a Blazor Server App, you&#8217;d typically manage the EF Core functionality in the Server project. So, make sure you are working in the Server project directory or set the Server project as the default project in the Package Manager Console (PMC) in Visual Studio. Using the NuGet Package Manager or [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading">1. Install necessary packages:</h3>



<p>For a Blazor Server App, you&#8217;d typically manage the EF Core functionality in the Server project. So, make sure you are working in the Server project directory or set the Server project as the default project in the Package Manager Console (PMC) in Visual Studio.</p>



<p>Using the NuGet Package Manager or the PMC, install the following packages:</p>



<ul class="wp-block-list">
<li><code>Microsoft.EntityFrameworkCore</code></li>



<li><code>Microsoft.EntityFrameworkCore.SqlServer</code></li>



<li><code>Microsoft.EntityFrameworkCore.Tools</code> (for migration tools)</li>
</ul>



<h3 class="wp-block-heading">2. Define your Model:</h3>



<p>Create classes that will define the structure of your database tables. Place these in the Shared or Server project, depending on your design decisions.</p>



<p>Example:</p>



<pre class="wp-block-preformatted"><code>public class Product
{
    public int ProductId { get; set; }
    public string Name { get; set; }
    public decimal Price { get; set; }
}
</code></pre>



<h3 class="wp-block-heading">3. Create a DbContext:</h3>



<p>In the Server project, create a class that derives from <code>DbContext</code>:</p>



<pre class="wp-block-preformatted"><code>public class AppDbContext : DbContext
{
    public AppDbContext(DbContextOptions&lt;AppDbContext&gt; options) : base(options) { }

    public DbSet&lt;Product&gt; Products { get; set; }
}
</code></pre>



<h3 class="wp-block-heading">4. Configure the Connection String:</h3>



<p>In the <code>appsettings.json</code> file in the Server project, add your connection string:</p>



<pre class="wp-block-preformatted"><code>{
  "ConnectionStrings": {
    "DefaultConnection": "</code>Server=Servername;Database=DatabaseName;user=UserId;password=secret;MultipleActiveResultSets=true;TrustServerCertificate=True;MultiSubnetFailover=True<code>"
  }
}
</code></pre>



<p>Replace <code>YourConnectionStringHere</code> with your MS SQL Server 2022 connection string.</p>



<h3 class="wp-block-heading">5. Register DbContext:</h3>



<p>In the <code>Startup.cs</code> (or <code>Program.cs</code> for newer versions) of your Server project, register the <code>DbContext</code> in the <code>ConfigureServices</code> method:</p>



<pre class="wp-block-code"><code>builder.<code>Services.AddDbContext&lt;AppDbContext>(options =><br>    options.UseSqlServer(builder.Configuration.GetConnectionString("DefaultConnection")));</code></code></pre>



<p>(Do not forget to import EF Core)</p>



<h3 class="wp-block-heading">6. Create Initial Migration:</h3>



<p>In the PMC or terminal, navigate to the Server project directory and run:</p>



<pre class="wp-block-preformatted"><code>Add-Migration InitialCreate
</code></pre>



<p>This will scaffold a migration to create the initial set of tables for your model.</p>



<h3 class="wp-block-heading">7. Update the Database:</h3>



<p>Apply the migration to create the database schema:</p>



<pre class="wp-block-preformatted"><code>Update-Database
</code></pre>



<pre class="wp-block-preformatted"><code>
</code></pre>



<h3 class="wp-block-heading">8. Use the DbContext in your app:</h3>



<p>Now you can inject and use your <code>DbContext</code> in your pages, components, or services:</p>



<pre class="wp-block-preformatted">csharpCopy code<code>@inject AppDbContext _context

// ...

var products = await _context.Products.ToListAsync();
</code></pre>



<p>That&#8217;s the basic setup! As your app grows, you might add more entities, relationships, migrations, and other advanced EF Core features. Ensure you understand concepts like the lifecycle of a DbContext and how it tracks changes to entities to avoid issues when manipulating data.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">685</post-id>	</item>
		<item>
		<title>How to host asp.net core 6 applications under Ubuntu</title>
		<link>https://blog.meyer-luenen.de/2023/06/28/how-to-host-asp-net-core-6-applications-under-ubuntu/</link>
		
		<dc:creator><![CDATA[Stefan]]></dc:creator>
		<pubDate>Wed, 28 Jun 2023 16:59:00 +0000</pubDate>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[Linux / Unix]]></category>
		<guid isPermaLink="false">https://blog.meyer-luenen.de/?p=625</guid>

					<description><![CDATA[Schritt-für-Schritt-Anleitung zur Installation von ASP.NET Core 6 unter Ubuntu 1. Zuerst musst du sicherstellen, dass dein System auf dem neuesten Stand ist. Öffne ein Terminal und führe folgenden Befehl aus: `sudo apt-get update`. 2. Installiere die .NET Core SDK-Pakete, indem du folgenden Befehl ausführst: `sudo apt-get install dotnet-sdk-6.0`. 3. Um sicherzustellen, dass die Installation erfolgreich [&#8230;]]]></description>
										<content:encoded><![CDATA[<h1 id="schritt-fuer-schritt-anleitung-zur-installation-von-asp-net-core-6-unter-ubuntu-ntRkSZLaXW">Schritt-für-Schritt-Anleitung zur Installation von ASP.NET Core 6 unter Ubuntu</h1>
<p>1. Zuerst musst du sicherstellen, dass dein System auf dem neuesten Stand ist. Öffne ein Terminal und führe folgenden Befehl aus: `sudo apt-get update`.</p>
<p>2. Installiere die .NET Core SDK-Pakete, indem du folgenden Befehl ausführst: `sudo apt-get install dotnet-sdk-6.0`.</p>
<p>3. Um sicherzustellen, dass die Installation erfolgreich war, führe den folgenden Befehl aus: `dotnet &#8211;version`. Wenn die Version 6.0 angezeigt wird, ist die Installation erfolgreich.</p>
<p>4. Um ein neues ASP.NET Core-Projekt zu erstellen, führe den folgenden Befehl aus: `dotnet new webapp -o `. Dies erstellt ein neues ASP.NET Core-Projekt mit dem angegebenen Namen.</p>
<p>5. Um das Projekt zu starten, navigiere in das Projektverzeichnis und führe den folgenden Befehl aus: `dotnet run`.</p>
<p>6. Um das Projekt zu testen, öffne einen Webbrowser und gehe zu `http://localhost:5000`. Wenn alles richtig eingerichtet ist, solltest du die Standardseite sehen.</p>
<p>7. Fertig! Du hast ASP.NET Core 6 unter Ubuntu installiert.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">625</post-id>	</item>
		<item>
		<title>appsettings.json erstellen</title>
		<link>https://blog.meyer-luenen.de/2023/04/28/appsettings-json-erstellen/</link>
		
		<dc:creator><![CDATA[Stefan]]></dc:creator>
		<pubDate>Fri, 28 Apr 2023 12:09:14 +0000</pubDate>
				<category><![CDATA[C#]]></category>
		<guid isPermaLink="false">https://blog.meyer-luenen.de/?p=591</guid>

					<description><![CDATA[Installation nuget Packages in V 7.0.0 Neue Datei appsettings.json im root-Verzeichnis erstellen In z.B. Program.cs: Connection String auslesen: Setting auslesen: Verschachtelte Settings auslesen:]]></description>
										<content:encoded><![CDATA[
<p>Installation nuget Packages in V 7.0.0</p>



<pre class="wp-block-code"><code>Microsoft.Extensions.Configuration
Microsoft.Extensions.Configuration.Json</code></pre>



<p>Neue Datei appsettings.json im root-Verzeichnis erstellen</p>



<p>In z.B. Program.cs:</p>



<pre class="wp-block-code"><code>public static IConfiguration _conf;
var configuration = new ConfigurationBuilder()
  .AddJsonFile($"appsettings.json");
_conf = configuration.Build();</code></pre>



<p>Connection String auslesen:</p>



<pre class="wp-block-code"><code>string connectionString = _conf.GetConnectionString("DefaultConnection")!;
</code></pre>



<p>Setting auslesen:</p>



<pre class="wp-block-code"><code>string s = _conf.GetSection("section").Value!;</code></pre>



<p>Verschachtelte Settings auslesen:</p>



<pre class="wp-block-code"><code>"MainSection": {
  "SubSection": {
    "SubSubSection": "value"
}
string s2 = _conf.GetSection("section:SubSection:SubSubSection").Value!;</code></pre>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">591</post-id>	</item>
		<item>
		<title>Sortieren einer Liste</title>
		<link>https://blog.meyer-luenen.de/2022/02/22/sortieren-einer-liste/</link>
		
		<dc:creator><![CDATA[Stefan]]></dc:creator>
		<pubDate>Tue, 22 Feb 2022 14:12:10 +0000</pubDate>
				<category><![CDATA[C#]]></category>
		<guid isPermaLink="false">https://blog.meyer-luenen.de/?p=504</guid>

					<description><![CDATA[]]></description>
										<content:encoded><![CDATA[
<pre class="wp-block-code"><code>ListName = ListName.OrderBy(q => q).ToList();</code></pre>



<p></p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">504</post-id>	</item>
		<item>
		<title>Developer-Zertifikat für .net (Core) in VS2020 erstellen</title>
		<link>https://blog.meyer-luenen.de/2021/12/21/developer-zertifikat-fuer-net-core-in-vs2020-erstellen/</link>
		
		<dc:creator><![CDATA[Stefan]]></dc:creator>
		<pubDate>Tue, 21 Dec 2021 12:49:04 +0000</pubDate>
				<category><![CDATA[.NET]]></category>
		<guid isPermaLink="false">https://blog.meyer-luenen.de/?p=492</guid>

					<description><![CDATA[Falls es Probleme beim Verwenden des selbst erstellten Zertifikats gibt: Unable to configure HTTPS endpoint. No server certificate was specified, and the default developer certificate could not be found or is out of date.To generate a developer certificate run &#8218;dotnet dev-certs https&#8216;. To trust the certificate (Windows and macOS only) Am besten die Entwicklerzertifikate einmal [&#8230;]]]></description>
										<content:encoded><![CDATA[
<span id="more-492"></span>



<p>Falls es Probleme beim Verwenden des selbst erstellten Zertifikats gibt:</p>



<p><em>Unable to configure HTTPS endpoint. No server certificate was specified, and the default developer certificate could not be found or is out of date.<br>To generate a developer certificate run &#8218;dotnet dev-certs https&#8216;. To trust the certificate (Windows and macOS only)</em></p>



<p>Am besten die Entwicklerzertifikate einmal alle löschen und ein neues anlegen:</p>



<ol class="wp-block-list"><li>dotnet dev-certs https &#8211;clean</li><li>dotnet dev-certs https -t</li><li>Restart VisualStudio</li></ol>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">492</post-id>	</item>
		<item>
		<title>Alle Dateien in einem Verzeichnis auflisten</title>
		<link>https://blog.meyer-luenen.de/2021/11/16/alle-dateien-in-einem-verzeichnis-auflisten/</link>
		
		<dc:creator><![CDATA[Stefan]]></dc:creator>
		<pubDate>Tue, 16 Nov 2021 14:52:26 +0000</pubDate>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[vb.net]]></category>
		<guid isPermaLink="false">https://blog.meyer-luenen.de/?p=488</guid>

					<description><![CDATA[]]></description>
										<content:encoded><![CDATA[
<pre class="wp-block-code"><code>Dim files() As String = IO.Directory.GetFiles("c:\")

For Each file As String In files
   ' file = Dateiname
Next</code></pre>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">488</post-id>	</item>
	</channel>
</rss>
