IT Nota

  • Home
  • How To
  • .NET
  • WordPress
  • Contact

Trying .NET 6 Preview on macOS Silicon M1

.NET 6 Banner

Installed on /usr/local/share/dotnet.

Trying to create a new F# project in Terminal.

dotnet new console --language F# -o MyFSharpApp
Welcome to .NET 6.0!
---------------------
SDK Version: 6.0.100-preview.7.21379.14

Telemetry
---------
The .NET tools collect usage data in order to help us improve your experience. It is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell.

Read more about .NET CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry

----------------
Installed an ASP.NET Core HTTPS development certificate.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
Learn about HTTPS: https://aka.ms/dotnet-https
----------------
Write your first app: https://aka.ms/dotnet-hello-world
Find out what's new: https://aka.ms/dotnet-whats-new
Explore documentation: https://aka.ms/dotnet-docs
Report issues and find source on GitHub: https://github.com/dotnet/core
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
--------------------------------------------------------------------------------------
The template "Console Application" was created successfully.

Processing post-creation actions...
Running 'dotnet restore' on /Users/ITNota/Documents/Git/fsharp/MyFSharpApp/MyFSharpApp.fsproj...
  Determining projects to restore...
  Restored /Users/ITNota/Documents/Git/fsharp/MyFSharpApp/MyFSharpApp.fsproj (in 1.76 sec).
Restore succeeded.

Further Reading

If you need to uninstall the SDK when the release is out:

How to Remove .NET Runtime and SDK on Mac
Remove / Uninstall .NET SDK on macOS

August 23, 2021 Filed Under: .NET Tagged With: .NET, FSharp, macOS

How to Setup Visual Studio 2017 or 2019 for F#

If you want to try F# programming in Visual Studio 2017 (or 2019 for that matter), here’s what you might want to do to optimize Visual Studio to run optimally on your machine.

  1. From the menu, go to Tools and select Options.
  2. Under Debugging, set the Enable script debugging to True.
  3. Under Misc, set 64-bit F# Interactive to True (if you use 64-bit Windows OS).
  4. Set F# Interactive options to the following:
        --optimize- --readline+ --debug+ -d:TRACE
        
  5. Set Shadow copy assemblies to True and click OK.

    Visual Studio 2017 F# Tools initial settings

This “once and forget it” setup serves the following purposes:

  1. Enable you to debug F# in Visual Studio and run it as a 64-bit process (better).
  2. Set Visual Studio to output trace messages within F# scripts. You can also check the F# Interactive Options and the compiler options for more details.
  3. Set the referenced assemblies not to be locked by the F# Interactive process.
  4. Next, scroll up to Text Editor and expand on the F#.
  5. Under General, check the Line numbers and click OK.

    Visual Studio 2017 F# Options for Line numbers

One more tip with F# project, when creating a new F# project you can choose between .NET Core or .NET Standard. But you can also use the .NET Framework for F# Console Application. Just make sure you select Visual F# on the left-pane of the new project window, then you can select the .NET Framework you want to use for your project.

Start a new F# Console Application project with .NET Framework 4.6

Further Reading

Get Programming with F: A guide for .NET developers
F# Interactive Options
F# Compiler Options
Seq, List, Array, Map, Set. Which One to Use?

March 28, 2018 Filed Under: .NET, How To Tagged With: FSharp, Microsoft

How to Fix Obsolete ConfigurationSettings.GetConfig API

When you’re upgrading code from .NET Framework 1.1 to 2.0, you will get a few warnings if you use an obsolete API such as ConfigurationSettings.GetConfig, you may see something similar to this:

This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.GetSection

To which you have to replace it with ConfigurationManager.GetSection(). Or the same way with ConfigurationSettings.AppSettings.Get() to ConfigurationManager.AppSettings.Get(). The problem is after you made the change, you will encounter another error during compilation such as this:

'ConfigurationManager' is not a member of 'Configuration'.

The solution, while it’s not intuitive is actually very simple. You need to add a reference to System.Configuration.dll to the assembly.

  1. If you’re using a default view, on the right pane of your Visual Studio under your project you can right click on the References and select Add Reference….

    Add reference in Visual Studio's solution explorer

  2. Under Assemblies, look for System.Configuration and make sure it’s checked, then click OK.

    Add System.Configuration.dll reference in Visual Studio

That’s all there is to it.

Further Reading

ConfigurationSettings.GetConfig Method

April 27, 2015 Filed Under: .NET Tagged With: ASP.NET, Microsoft, Visual Studio

Migrating ASP.NET 1.1 to Windows Server 2012

With Microsoft cutting the support for Windows 2003 by July 2015, many legacy web applications built with .NET Framework 1.1 have to be migrated to a newer Windows Server 2012 R2. The dilemma is that .NET Framework 1.1 is no longer supported (it’s not even possible to manually install the .NET Framework 1.1 on these platforms) on Windows Server 2012 or Windows Server 2012 R2.

The proposed solution by Microsoft is to install the .NET Framework 3.5 SP1 which includes the .NET Framework 2.0. Most ASP.NET 1.1 applications should run under .NET Framework 2.0 without re-compiling or re-writing of codes so long as they don’t have any runtime breaking changes, whether it’s API or behavior.

Further Reading

Breaking Changes in .NET Framework 2.0
List of Breaking Changes
Running .NET Framework 1.1 Apps on Windows 8, Windows 8.1 or Windows 10
Microsoft .NET Framework 1.1 and 2.0 Compatibility
Runtime Breaking Changes

February 8, 2014 Filed Under: .NET Tagged With: ASP.NET, Microsoft, Windows Server

How to Setup SQL Express LocalDB in ASP.NET

Microsoft SQL Server Express LocalDB should be used in place of the SQL Server Express user instance feature which is deprecated. It is more suitable for developers as it runs on-demand (instead as a service) with your Windows credential and without the need the need of complex configurations.

In Visual Studio 2013, if you want to have it setup a default database using a SQL Server LocalDb in your Web.Config, make sure you choose Individual User Account as your authentication mode.

New ASP.NET Project - Select a template

Then you can modify the parameters and commit Update-Database later.

<configuration>
  <configSections>
    <!-- For more information on Entity Framework configuration, 
         visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <connectionStrings>
    <add name="DefaultConnection" 
         connectionString="Data Source=(LocalDb)v11.0;AttachDbFilename=|DataDirectory|aspnet-WebApplication1-20131218041336.mdf;Initial Catalog=aspnet-WebApplication1-20131218041336;Integrated Security=True"
      providerName="System.Data.SqlClient" />
  </connectionStrings>
  <appSettings>
    ...

Further Reading

SQL Server 2012 Express LocalDB
Introducing LocalDB, an improved SQL Express

December 18, 2013 Filed Under: .NET, How To Tagged With: ASP.NET, MVC

Next Page »
Buy me a coffee Support this site
Buy Me a Coffee?

Categories

  • .NET
  • Coding
  • Cybersecurity
  • Database
  • How To
  • Internet
  • Multimedia
  • Photography
  • Programming
  • Resources
  • Review
  • Tips and Tricks
  • Uncategorized
  • Use Case
  • WordPress
  • Writing

Recent Posts

  • How to View Stored Procedure Code in SQL Server
  • How to Find a String in SQL Server Stored Procedures
  • How to Remove Cached Credentials without Rebooting Windows
  • ESP Work Automation: Empowering Enterprises with Streamlined Workflows and Operational Efficiency
  • How to Search for a String in All Tables in a Database

Recent Posts

  • How to View Stored Procedure Code in SQL Server
  • How to Find a String in SQL Server Stored Procedures
  • How to Remove Cached Credentials without Rebooting Windows
  • ESP Work Automation: Empowering Enterprises with Streamlined Workflows and Operational Efficiency
  • How to Search for a String in All Tables in a Database

Tags

.NET .NET Core AdSense ASP.NET Cdonts Dll Classic ASP Code Editor ETL FSharp Genesis Framework Git Google HP Asset Manager HTML5 Hugo IIS Information Security Internet Internet Information Services iOS JAMStack Linux macOS Microsoft Microsoft SQL Server MVC PHP PowerShell Python Simple Mail Transfer Protocol Smtp Server SQL SQL Server SSIS SSMS SSRS Sublime Text Visual Studio Visual Studio Code VPN Windows Windows 8 Windows 10 Windows 2012 Windows Server

Copyright © 2011-2025 IT Nota. All rights reserved. Terms of Use | Privacy Policy | Disclosure