<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Steve Ellwood on Medium]]></title>
        <description><![CDATA[Stories by Steve Ellwood on Medium]]></description>
        <link>https://medium.com/@steveellwoodnlc?source=rss-91d7fad985d6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*AGicZdkhn4GN5cbY</url>
            <title>Stories by Steve Ellwood on Medium</title>
            <link>https://medium.com/@steveellwoodnlc?source=rss-91d7fad985d6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 08:41:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@steveellwoodnlc/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Azure Identity Credentials Issue]]></title>
            <link>https://steveellwoodnlc.medium.com/azure-identity-credentials-issue-b71e95d73c5f?source=rss-91d7fad985d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/b71e95d73c5f</guid>
            <dc:creator><![CDATA[Steve Ellwood]]></dc:creator>
            <pubDate>Thu, 20 Nov 2025 22:22:04 GMT</pubDate>
            <atom:updated>2025-11-20T22:22:04.585Z</atom:updated>
            <content:encoded><![CDATA[<p>This is one of those things that can crop up occasionally, the actual exception looks like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mZan5t8mhNchAL5Mo6AB3w.png" /></figure><p>What initially threw me was that it was trying to access KeyVault, which made it easy to overthink the issue.</p><p>This error means that every credential in the default credentials failed. Fortunately closed inspection of the error indicated the actual issue. The first clue was the line</p><pre>ManagedIdentityCredential authentication unavailable. No response received from the managed identity endpoint.</pre><p>Then a bit further on it explains what is needed</p><pre>unexpected error: TS003: Error, TS001: This account &#39;fred.blogs@email.com&#39; needs re-authentication. <br>Please open Visual Studio, <br>go to Tools-&gt;Options-&gt;Azure Services Authentication, <br>and re-authenticate the account you want to use..</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b71e95d73c5f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The “DiscoverPrecompressedAssets” task failed unexpectedly.]]></title>
            <link>https://steveellwoodnlc.medium.com/the-discoverprecompressedassets-task-failed-unexpectedly-2b544195e1fe?source=rss-91d7fad985d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/2b544195e1fe</guid>
            <category><![CDATA[dotnet-core]]></category>
            <dc:creator><![CDATA[Steve Ellwood]]></dc:creator>
            <pubDate>Tue, 03 Jun 2025 20:06:40 GMT</pubDate>
            <atom:updated>2025-06-03T20:06:40.104Z</atom:updated>
            <content:encoded><![CDATA[<h3>The “DiscoverPrecompressedAssets” task failed unexpectedly.<br>System.ArgumentException: An item with the same key has already been added.<br> at …</h3><p>This arbitrarily started to happen on an previously fully working .NET 8 application. There are similar errors around but with a different exception, I don’t know if this will work in those cases.</p><p>In the error pane I happened to notice that this error was in the file Microsoft.NET.Sdk.StaticWebAssets.Compression.targets which is autogenerated and the header comment advises not to touch it unless you are knowledgeable on MSBuild.</p><p>Running</p><pre>dotnet --list-sdks</pre><p>showed two dotnet 9 sdks installed, one of which is the latest (currently 9.0.300), which I hadn’t knowingly installed, though as it’s a work machine that’s not too suprising.</p><p>With this information the first thing to check was if the app still builds and works when using .NET 8, so I added the following global.json file to the solution</p><pre>{<br>  &quot;sdk&quot;: {<br>    &quot;version&quot;: &quot;8.0.100&quot;,<br>    &quot;rollForward&quot;: &quot;latestFeature&quot;<br>  }<br>}</pre><p>This will force the use of the latest version of .NET 8 on any given machine and in my case resolved the error.</p><p>For further details of global.json see <a href="https://learn.microsoft.com/en-us/dotnet/core/tools/global-json">https://learn.microsoft.com/en-us/dotnet/core/tools/global-json</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b544195e1fe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Shared files in OneNote]]></title>
            <link>https://steveellwoodnlc.medium.com/shared-files-in-onenote-106188b0753c?source=rss-91d7fad985d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/106188b0753c</guid>
            <category><![CDATA[onenote]]></category>
            <dc:creator><![CDATA[Steve Ellwood]]></dc:creator>
            <pubDate>Wed, 23 Oct 2024 18:22:12 GMT</pubDate>
            <atom:updated>2024-10-23T18:22:12.147Z</atom:updated>
            <content:encoded><![CDATA[<p>This is not the sort of thing I usually write about but it’s something that frustrated me for a little while and isn’t as obvious as it could be, at least not to me until I knew the trick.</p><p>I use OneNote quite a lot for keeping notes and documentation. I have an extension in Outlook which means that I can copy an email into OneNote and I use that a lot. In this case I had a spreadsheet that had been shared with me, unfortunately I had deleted the email that send the share link. Opening the spreadsheet was easy as I can just look in the Shared with Me section on the File menu. What I was struggling to do was to add this spreadsheet into OneNote. I didn’t want a copy or any kind of static version as it’s a working document. I also didn’t have access to the folder the file is stored in, so the insert spreadsheet option would not work.</p><p>Normally I just use the Excel application installed on my machine, but in this case that wasn’t helping. The solution to my issue was blindingly simple — just open the spreadsheet in Office365 and copy the URL into OneNote!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=106188b0753c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Web.Config is too large]]></title>
            <link>https://steveellwoodnlc.medium.com/web-config-is-too-large-bf4384cf60a4?source=rss-91d7fad985d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/bf4384cf60a4</guid>
            <category><![CDATA[dot-net-framework]]></category>
            <category><![CDATA[web]]></category>
            <dc:creator><![CDATA[Steve Ellwood]]></dc:creator>
            <pubDate>Wed, 14 Aug 2024 21:51:34 GMT</pubDate>
            <atom:updated>2024-08-15T14:35:28.225Z</atom:updated>
            <content:encoded><![CDATA[<p>I recently came across this issue, which is one I had never heard of before and neither had anyone I asked about it. When you search for this, the most common solution offered seems to be to alter the registry to allow the file to be larger. I’m not comfortable with this as an option as, if nothing else, it means all the servers that use this will need changing.</p><p>Fortunately there is another solution that works pretty well, this is just a case of including a separate config file. In my case, looking at the web.config file it was clear that there was one section that was large and constantly growing, which made it a good candidate. If you don’t have anything like that you just need to make a judgement call, commonly IIS rewrite rules are a good candidate. Basically all you do is create a separate config file with just the contents you need.</p><p>For the purpose of demonstration I am going to use the following web.config file.</p><pre> &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br>&lt;!--<br>  For more information on how to configure your ASP.NET application, please visit<br>  http://go.microsoft.com/fwlink/?LinkId=152368<br>  --&gt;<br>&lt;configuration&gt;<br>  &lt;configSections&gt;<br>    &lt;section name=&quot;entityFramework&quot; type=&quot;System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&quot; requirePermission=&quot;false&quot; /&gt;<br>    <br>  &lt;!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --&gt;&lt;/configSections&gt;<br>  &lt;appSettings&gt;<br>    &lt;add key=&quot;webpages:Version&quot; value=&quot;1.0.0.0&quot; /&gt;<br>    &lt;add key=&quot;ClientValidationEnabled&quot; value=&quot;true&quot; /&gt;<br>    &lt;add key=&quot;UnobtrusiveJavaScriptEnabled&quot; value=&quot;true&quot; /&gt;<br>  &lt;/appSettings&gt;<br>  &lt;system.web&gt;<br>    &lt;compilation debug=&quot;true&quot; targetFramework=&quot;4.5&quot;&gt;<br>      &lt;assemblies&gt;<br>        &lt;add assembly=&quot;System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&quot; /&gt;<br>      &lt;/assemblies&gt;<br>    &lt;/compilation&gt;<br>    &lt;authentication mode=&quot;Forms&quot;&gt;<br>      &lt;forms loginUrl=&quot;~/Account/LogOn&quot; timeout=&quot;2880&quot; /&gt;<br>    &lt;/authentication&gt;<br>    &lt;pages&gt;<br>      &lt;namespaces&gt;<br>        &lt;add namespace=&quot;System.Web.Helpers&quot; /&gt;<br>        &lt;add namespace=&quot;System.Web.Mvc&quot; /&gt;<br>        &lt;add namespace=&quot;System.Web.Mvc.Ajax&quot; /&gt;<br>        &lt;add namespace=&quot;System.Web.Mvc.Html&quot; /&gt;<br>        &lt;add namespace=&quot;System.Web.Routing&quot; /&gt;<br>        &lt;add namespace=&quot;System.Web.WebPages&quot; /&gt;<br>      &lt;/namespaces&gt;<br>    &lt;/pages&gt;<br>    &lt;httpRuntime targetFramework=&quot;4.5&quot; /&gt;<br>    &lt;profile defaultProvider=&quot;DefaultProfileProvider&quot;&gt;<br>      &lt;providers&gt;<br>        &lt;add name=&quot;DefaultProfileProvider&quot; type=&quot;System.Web.Providers.DefaultProfileProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&quot; connectionStringName=&quot;DefaultConnection&quot; applicationName=&quot;/&quot; /&gt;<br>      &lt;/providers&gt;<br>    &lt;/profile&gt;<br>    &lt;membership defaultProvider=&quot;CustomMembershipProvider&quot;&gt;<br>      &lt;providers&gt;<br>        &lt;!--&lt;add name=&quot;DefaultMembershipProvider&quot; type=&quot;System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&quot; connectionStringName=&quot;DefaultConnection&quot; enablePasswordRetrieval=&quot;false&quot; enablePasswordReset=&quot;true&quot; requiresQuestionAndAnswer=&quot;false&quot; requiresUniqueEmail=&quot;false&quot; maxInvalidPasswordAttempts=&quot;5&quot; minRequiredPasswordLength=&quot;6&quot; minRequiredNonalphanumericCharacters=&quot;0&quot; passwordAttemptWindow=&quot;10&quot; applicationName=&quot;/&quot; /&gt;--&gt;<br>        &lt;clear /&gt;<br>        &lt;add name=&quot;CustomMembershipProvider&quot; type=&quot;CustomMembershipSample.Provider.CustomProvider&quot; /&gt;<br>      &lt;/providers&gt;<br>    &lt;/membership&gt;<br>    &lt;roleManager defaultProvider=&quot;DefaultRoleProvider&quot;&gt;<br>      &lt;providers&gt;<br>        &lt;add name=&quot;DefaultRoleProvider&quot; type=&quot;System.Web.Providers.DefaultRoleProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&quot; connectionStringName=&quot;DefaultConnection&quot; applicationName=&quot;/&quot; /&gt;<br>      &lt;/providers&gt;<br>    &lt;/roleManager&gt;<br>    &lt;!--<br>            If you are deploying to a cloud environment that has multiple web server instances,<br>            you should change session state mode from &quot;InProc&quot; to &quot;Custom&quot;. In addition,<br>            change the connection string named &quot;DefaultConnection&quot; to connect to an instance<br>            of SQL Server (including SQL Azure and SQL  Compact) instead of to SQL Server Express.<br>      --&gt;<br>    &lt;sessionState mode=&quot;InProc&quot; customProvider=&quot;DefaultSessionProvider&quot;&gt;<br>      &lt;providers&gt;<br>        &lt;add name=&quot;DefaultSessionProvider&quot; type=&quot;System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&quot; connectionStringName=&quot;DefaultConnection&quot; /&gt;<br>      &lt;/providers&gt;<br>    &lt;/sessionState&gt;<br>  &lt;/system.web&gt;<br>  &lt;system.webServer&gt;<br>    &lt;validation validateIntegratedModeConfiguration=&quot;false&quot; /&gt;<br>  &lt;/system.webServer&gt;<br>  &lt;runtime&gt;<br>    &lt;assemblyBinding xmlns=&quot;urn:schemas-microsoft-com:asm.v1&quot;&gt;<br>      &lt;dependentAssembly&gt;<br>        &lt;assemblyIdentity name=&quot;System.Web.Mvc&quot; publicKeyToken=&quot;31bf3856ad364e35&quot; /&gt;<br>        &lt;bindingRedirect oldVersion=&quot;1.0.0.0-2.0.0.0&quot; newVersion=&quot;3.0.0.0&quot; /&gt;<br>      &lt;/dependentAssembly&gt;<br>      &lt;dependentAssembly&gt;<br>        &lt;assemblyIdentity name=&quot;Microsoft.Owin&quot; publicKeyToken=&quot;31bf3856ad364e35&quot; culture=&quot;neutral&quot; /&gt;<br>        &lt;bindingRedirect oldVersion=&quot;0.0.0.0-2.1.0.0&quot; newVersion=&quot;2.1.0.0&quot; /&gt;<br>      &lt;/dependentAssembly&gt;<br>      &lt;dependentAssembly&gt;<br>        &lt;assemblyIdentity name=&quot;Microsoft.AspNet.Identity.Core&quot; publicKeyToken=&quot;31bf3856ad364e35&quot; culture=&quot;neutral&quot; /&gt;<br>        &lt;bindingRedirect oldVersion=&quot;0.0.0.0-2.0.0.0&quot; newVersion=&quot;2.0.0.0&quot; /&gt;<br>      &lt;/dependentAssembly&gt;<br>    &lt;/assemblyBinding&gt;<br>  &lt;/runtime&gt;<br>  &lt;entityFramework&gt;<br>    &lt;defaultConnectionFactory type=&quot;System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework&quot; /&gt;<br>    &lt;providers&gt;<br>      &lt;provider invariantName=&quot;System.Data.SqlClient&quot; type=&quot;System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer&quot; /&gt;<br>    &lt;/providers&gt;<br>  &lt;/entityFramework&gt;<br>  &lt;connectionStrings&gt;<br>    &lt;add name=&quot;DefaultConnection&quot; providerName=&quot;System.Data.SqlClient&quot; connectionString=&quot;Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-CustomMembershipSample-20140310164621;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-CustomMembershipSample-20140310164621.mdf&quot; /&gt;<br>    &lt;add name=&quot;AppDbEntities&quot; connectionString=&quot;metadata=res://*/Models.AppDbModel.csdl|res://*/Models.AppDbModel.ssdl|res://*/Models.AppDbModel.msl;provider=System.Data.SqlClient;provider connection string=&amp;quot;data source=(LocalDB)\v11.0;attachdbfilename=|DataDirectory|\AppDb.mdf;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&amp;quot;&quot; providerName=&quot;System.Data.EntityClient&quot; /&gt;<br>    &lt;add name=&quot;AppDbConnection&quot; connectionString=&quot;Data Source=(LocalDb)\v11.0;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\AppDb.mdf&quot; providerName=&quot;System.Data.SqlClient&quot; /&gt;<br>  &lt;/connectionStrings&gt;<br>&lt;/configuration&gt;</pre><p>I’m going to demonstrate how to setup an include file for the runtime section — this is probably not the best element to use and is only for demonstration.</p><p>First simply setup the config file, in my case I’ll call it runtime.config. If you’re using VS there is a template for web.config that you could use but don’t need to. I just need to cut the element from web.config and paste it into my new file as shown below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZSrm4YRrf_Nov2EkEWJ_9A.png" /></figure><p>Now I just need to return the outer element to web.config and specify the include file as below</p><pre> &lt;runtime configSource=&quot;runtime.config&quot;/&gt;</pre><p>The include file can be any elements you wish and it can include transformations. You may also need to remember that the elements are case sensitive.</p><h3>Finally</h3><p>Remember to set the properties for the include files as follows. Build Option should be Content and Copy to Output Directory should be either Copy Always or Copy if Newer.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bf4384cf60a4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Visual Studio Item Templates with Parameters]]></title>
            <link>https://steveellwoodnlc.medium.com/visual-studio-item-templates-with-parameters-6eb6ab0c0588?source=rss-91d7fad985d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/6eb6ab0c0588</guid>
            <category><![CDATA[visual-studio]]></category>
            <dc:creator><![CDATA[Steve Ellwood]]></dc:creator>
            <pubDate>Wed, 07 Aug 2024 20:06:30 GMT</pubDate>
            <atom:updated>2024-08-08T09:23:44.214Z</atom:updated>
            <content:encoded><![CDATA[<p>If you know you are going to have to repeatedly write similar code this is quite a useful feature as it adds to the Add New Item menu in Visual Studio. This particular article is entirely based on <a href="https://medium.com/@deepakha1993/creating-custom-item-templates-in-visual-studio-30b567ae2c74">https://medium.com/@deepakha1993/creating-custom-item-templates-in-visual-studio-30b567ae2c74</a> and as such I won’t copy that but will give an overview and make a few notes on areas that helped me.</p><p>As a very brief overview you first create the file you want to become a template and then use the Export Template option on the Project menu. Ultimately this will export to <em>%USERPROFILE%\Documents\Visual Studio 2022\My Exported Templates.” </em>where it creates a Zip file with all of the template included. At this point, if you want to add parameters you don’t need to automatically Import the Template into Visual Studio.</p><p>To add custom parameters (and provide a default value for them). You need to edit the .vstemplate.xml file in the Zip file. Adding a parameter is a simple case of adding a CustomParameter element to the TemplateContent tag e.g.</p><pre>  &lt;TemplateContent&gt;<br>    &lt;CustomParameters&gt;<br>      &lt;CustomParameter Name=&quot;$CaseId$&quot; Value=&quot;ProvideCaseIdHere&quot;/&gt;<br>    &lt;/CustomParameters&gt;<br>  &lt;/TemplateContent&gt;</pre><p>You can do this for as many parameters as you like. Then you will need to add the following within the TemplateData element</p><pre>&lt;ProjectType&gt;CSharp&lt;/ProjectType&gt;<br>&lt;TemplateGroupID&gt;AspNetCore&lt;/TemplateGroupID&gt;</pre><p>When you have your finished files, they need to be in a Zip file which you need to put into the following location</p><pre>%USERPROFILE%\Documents\Visual Studio 2022\Templates\ItemTemplates</pre><p>In theory you can now update your files at will as long as you return them to the Zip file but I haven’t had much luck doing that yet.</p><p>One final note, if you’re using Visual Studio to create your template, remember to set the Build action property for the template file to None in Properties. This will prevent all those compiler issues being highlighted</p><h4>Things to check include —</h4><p>Confirm that the .vstemplate file contains something like</p><pre>&lt;TemplateGroupID&gt;AspNetCore&lt;/TemplateGroupID&gt;</pre><p>otherwise your template may only show for certain project types. This element is also affected by the ShowByDefault element. If ShowByDefault is false then the template only shows for the project type specified. If ShowByDefault is true then the item template is available for all project types.</p><p>Check the visual studio template location isn’t on OneDrive or similar Tools | Options | Projects and Solutions | Location</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6eb6ab0c0588" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Expando Objects — elements]]></title>
            <link>https://steveellwoodnlc.medium.com/expando-objects-elements-09af31492437?source=rss-91d7fad985d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/09af31492437</guid>
            <dc:creator><![CDATA[Steve Ellwood]]></dc:creator>
            <pubDate>Fri, 21 Jun 2024 18:32:34 GMT</pubDate>
            <atom:updated>2024-06-21T18:32:34.968Z</atom:updated>
            <content:encoded><![CDATA[<h3>Expando Objects — elements</h3><p>I’ll be honest I had never heard of these before but they have been in .NET for some considerable time. I think their primary use is in GUI’s which is why I’d not heard of them.</p><p>So basically an Expando object is a dynamic key value type array and it has a <a href="https://stackoverflow.com/questions/1653046/what-are-the-true-benefits-of-expandoobject">few features</a> that a other similar data structures don’t. I came across this in some legacy code that I needed to update.</p><p>The issue I had was reading the entries, I tried using some of the usual techniques such as MyArray[SomeKey] and MyArray[4] but they didn’t work. In my case I knew the elements were ordered and so I could pick, for example, the 5th object. What worked for me was</p><pre>MyArray.ElementAt(5)</pre><p>The issue with this is that it’s a Linq function and by it’s nature is less efficient than some possible alternatives</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=09af31492437" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[File Scoped Namespace Issues]]></title>
            <link>https://steveellwoodnlc.medium.com/file-scoped-namespace-issues-f1f4c9686bf9?source=rss-91d7fad985d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/f1f4c9686bf9</guid>
            <category><![CDATA[namespaces]]></category>
            <dc:creator><![CDATA[Steve Ellwood]]></dc:creator>
            <pubDate>Fri, 24 May 2024 19:36:45 GMT</pubDate>
            <atom:updated>2024-05-24T19:36:45.439Z</atom:updated>
            <content:encoded><![CDATA[<p>I’ve not really used more recent versions of .NET and I needed to update a legacy class library so that it could be used from .NET 8 or from .NET Framework. Rather than upgrading the existing solution I decided to create a new one from scratch. Creating the actual class library itself was as straightforward as I remember.</p><p>The issue came when I copy/pasted a single class from the legacy application into the new one. I started getting issues related to <a href="https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-10.0/file-scoped-namespaces">File Scoped Namespaces</a>. I’d not really paid much attention to these although they are probably a good idea. The error I kept getting was —</p><pre>error CS8370: Feature &#39;file-scoped namespace&#39; is not available in C# 7.3. Please use language version 10.0 or greater.</pre><p>Googling for how to turn off File Scoped Namespaces turned up very little, the only thing I could find was a part of the editorconfig spec</p><pre># IDE0160: Convert to block-scoped namespace<br>csharp_style_namespace_declarations = block_scoped:warning</pre><p>but this didn’t seem to work for me.</p><p>What eventually worked for me was Intellisense in VS Code, I later found out there may be something similar in Visual Studio. When I hover over the namespace, I get the lightbulb —</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/260/1*Att8GcvA8UYMjaj-XZsnkw.png" /></figure><p>Clicking that gave me the option to convert all files to block scoped or to file scoped namespaces which solved my problem. What had happened was that as I created a new project the default was to use file scoped namespaces but the legacy file I copy/pasted in used the old block scoped namespaces format.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f1f4c9686bf9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The mystery of the disappearing Publish Profiles]]></title>
            <link>https://steveellwoodnlc.medium.com/the-mystery-of-the-disappearing-publish-profiles-bcac2644630e?source=rss-91d7fad985d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/bcac2644630e</guid>
            <dc:creator><![CDATA[Steve Ellwood]]></dc:creator>
            <pubDate>Fri, 26 Jan 2024 21:26:54 GMT</pubDate>
            <atom:updated>2024-01-26T21:26:54.169Z</atom:updated>
            <content:encoded><![CDATA[<p>For some reason my Visual Studio wasn’t showing an existing profile that someone else had created on the Project | Publish menu. This was despite the file showing in Solution Explorer as being part of the project.</p><p>As I was using dotnet I could have used the command line and that would likely have worked e.g.</p><pre>dotnet publish -p:PublishProfile=MyProfile</pre><p>However what actually worked for me was to simply delete the bin and obj folders for the project concerned.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bcac2644630e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NU5039 The readme file ‘README.md’ does not exist in the package]]></title>
            <link>https://steveellwoodnlc.medium.com/nu5039-the-readme-file-readme-md-does-not-exist-in-the-package-a7cc1ca90d3d?source=rss-91d7fad985d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7cc1ca90d3d</guid>
            <category><![CDATA[nuget-package]]></category>
            <category><![CDATA[dotnet-core]]></category>
            <dc:creator><![CDATA[Steve Ellwood]]></dc:creator>
            <pubDate>Mon, 08 Jan 2024 21:42:12 GMT</pubDate>
            <atom:updated>2024-01-12T10:20:57.313Z</atom:updated>
            <content:encoded><![CDATA[<p>This appears to be quite a common issue and it happened to me unexpectedly when trying to pack a legacy library. The library concerned was written in net core 3.1 and has recently been upgraded to .net 8.0</p><p>The first thing I tried was adding</p><pre>   &lt;IsPackable&gt;true&lt;/IsPackable&gt;</pre><p>to the csproj file but this made no difference. I also checked the CopyToOutputDirectory setting.</p><p>Finally I noticed that I had</p><pre>    &lt;PackageReadmeFile&gt;README.md&lt;/PackageReadmeFile&gt;</pre><p>and ALSO had</p><pre>  &lt;ItemGroup&gt;<br>    &lt;None Update=&quot;README.md&quot;&gt;<br>      &lt;Pack&gt;True&lt;/Pack&gt;<br>      &lt;PackagePath&gt;\&lt;/PackagePath&gt;<br>    &lt;/None&gt;<br>  &lt;/ItemGroup&gt;</pre><p>Removing the PackageReadmeFile entry resolved the issue for me</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7cc1ca90d3d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Postman Variables]]></title>
            <link>https://steveellwoodnlc.medium.com/postman-variables-c0c36221d9a4?source=rss-91d7fad985d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/c0c36221d9a4</guid>
            <category><![CDATA[postman]]></category>
            <dc:creator><![CDATA[Steve Ellwood]]></dc:creator>
            <pubDate>Thu, 02 Nov 2023 20:42:54 GMT</pubDate>
            <atom:updated>2023-11-02T20:42:54.062Z</atom:updated>
            <content:encoded><![CDATA[<p>I’m a huge fan of <a href="https://www.postman.com/">Postman </a>and have been using it for some time now. They have added some great features but now has so many features that if you don’t use it regularly, it can sometimes take a while to find what you’re looking for.</p><p>I was recently trying to call a Rest api that needed authentication, nothing unusual here. Clearly putting credentials directly in to the system is a bit of a no-no these days, if you try, Postman will spot it and suggest you use variables instead, which is a nice touch. The issue for me was that I couldn’t remember how to create variables and the help referred to an icon that I couldn’t find.</p><p>Fortunately, and this is why I am a fan of Postman, there are other ways to achieve this. The first way is to actually type the value in, then highlight it and right click. You get the option to set a variable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jv1EmEUyZqKSfrIotZzDqA.png" /></figure><p>The other way I found to do this is rather than entering a value, enter a variable name surrounded by double curly brackets, Postman will recognise that the variable has no value and allow you to set it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bYzObI6Tj9xMxdSgbslhVQ.png" /></figure><p>You can set variables at a variety of levels global, collection etc. and then use them as desired.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c0c36221d9a4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>