Windows的一些安装

dotnet, Visual Studio 的下载

The latest version of Visual Studio:

  • vs2017

15.9

  • vs2019

16.9

  • vs2022

17.12

Visual Studio

my.visualstudio.com 已经不提供 非订阅用户 的下载:

format

  • target directory
--layout TARGET(directory)
  • components
--add NAME(Component)
  • language
--lang en-US

exec:

.\vs_Community.exe --layout D:\win10soft\vs202x `
...

所有的行尾 + 空格 + ` 尾行除外。

Common

  • Core
--add Microsoft.VisualStudio.Component.CoreEditor `
--add Microsoft.VisualStudio.Workload.CoreEditor `
--add Microsoft.VisualStudio.Component.Roslyn.Compiler `
--add Microsoft.VisualStudio.Component.TextTemplating `
  • Microsoft Build Tools
--add Microsoft.Component.MSBuild `
  • JIT
--add Microsoft.VisualStudio.Component.Debugger.JustInTime `
  • IntelliCode
--add Microsoft.VisualStudio.Component.IntelliCode `

VC

After vs2022 17.12, the main productivity for VC.

--add Microsoft.VisualStudio.Component.VC.CoreIde `
--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 `
--add Microsoft.VisualStudio.Component.VC.Redist.14.Latest `
  • MFC
--add Microsoft.VisualStudio.Component.VC.ATLMFC `

ATL

--add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core `
--add Microsoft.VisualStudio.Component.VC.ATL `
--add Microsoft.VisualStudio.Workload.NativeDesktop `

Windows SDK

  • Win10 sdk
Microsoft.VisualStudio.Component.Windows10SDK.XXXXX
  • Win11 sdk
Microsoft.VisualStudio.Component.Windows11SDK.XXXXX

Win10

  • 18362
  • 19041
  • 20348

Win11

  • 22000
  • 22621
  • 26100

Clang/LLVM support in Visual Studio

Visual Studio 2019 16.7 or later

  • C++ Clang tools for Windows
Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Llvm.Clang

includes:

  • C++ Clang Compiler for Windows
Microsoft.VisualStudio.Component.VC.Llvm.Clang
  • C++ Clang-cl for v143 build tools (x64/x86)
Microsoft.VisualStudio.Component.VC.Llvm.ClangToolset

Dotnet

  • deploy
  • add dotnet env

deploy

  • install .net 3.5

.NET Framework 3.5 - Windows 8

first, mount windows installation DVD(ISO)

  • DVD
D:

Then, execute PowerShell as Administrator

dism /online /enable-feature /featurename:NetFx3 /All /Source:D:\sources\sxs /LimitAccess

Deployment of SQLite in .NET 4.6

System.MissingMethodException: Method not found: '!!0[] System.Array.Empty()'.
   at System.Data.SQLite.SQLiteConvert.TypeNameToDbType(SQLiteConnection connection, String typeName, SQLiteConnectionFlags flags)
   at System.Data.SQLite.SQLiteDataReader.GetSQLiteType(SQLiteConnectionFlags flags, Int32 i)
   at System.Data.SQLite.SQLiteDataReader.GetValue(Int32 i)
   at System.Data.SQLite.SQLiteDataReader.get_Item(Int32 i)
   at System.Data.SQLite.SQLiteCommand.ExecuteScalar(CommandBehavior behavior)
   at System.Data.SQLite.SQLiteCommand.ExecuteScalar()
... ...

down v4.6.2 / v4.7.2 or above.

File Not Found Exception

System.IO.FileNotFoundException
   at System.Reflection.RuntimeAssembly._nLoad(System.Reflection.AssemblyName, System.String, System.Security.Policy.Evidence, System.Reflection.RuntimeAssembly, System.Threading.StackCrawlMark ByRef, IntPtr, Boolean, Boolean, Boolean)
   at System.Reflection.RuntimeAssembly.nLoad(System.Reflection.AssemblyName, System.String, System.Security.Policy.Evidence, System.Reflection.RuntimeAssembly, System.Threading.StackCrawlMark ByRef, IntPtr, Boolean, Boolean, Boolean)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(System.Reflection.AssemblyName, System.Security.Policy.Evidence, System.Reflection.RuntimeAssembly, System.Threading.StackCrawlMark ByRef, IntPtr, Boolean, Boolean, Boolean)
   at System.Reflection.RuntimeAssembly.InternalLoadFrom(System.String, System.Security.Policy.Evidence, Byte[], System.Configuration.Assemblies.AssemblyHashAlgorithm, Boolean, Boolean, System.Threading.StackCrawlMark ByRef)
   at System.Reflection.Assembly.LoadFrom(System.String)

应用程序使用x86的 System.Data.SQLite.dll , 而在使用中没有安装x86版的VC Redist.

File Load Exception

System.IO.FileLoadException: Could not load file or assembly 'System.Data.SQLite.dll' or one of its dependencies. 
A dynamic link library (DLL) initialization routine failed. (Exception from HRESULT: 0x8007045A)
File name: 'System.Data.SQLite.dll'
   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
   at System.Reflection.Assembly.LoadFrom(String assemblyFile)

使用了.net的低版本 System.Data.SQLite.dll :

sqlite-netFx35-binary-bundle-Win32-2008

而应用程序是: .net 4.6:

sqlite-netFx46-binary-bundle-Win32-2015

desktop env

An error occurred trying to load the page.
Could not load file or assembly 'Microsoft.VSDesigner, Version=x.x.x.x, Culture=neutral, PublicKeyToken=y' or one of its dependencies. 
The system cannot find the file specified.

Control Panel -> Add/Remove Programs
right click “Visual Studio 20xx” -> Change
Check “.NET desktop development”

  • vs2019
".NET development tools"
  • vs2022
"Development toos for .NET"

.NET Framework 4 – 4.6 development tools

This option is only available in vs2017/vs2019!

--add Microsoft.Net.Component.4.5.2.TargetingPack `
--add Microsoft.Net.Component.4.5.TargetingPack `
--add Microsoft.Net.Component.4.TargetingPack `
--add Microsoft.Net.Component.4.5.1.TargetingPack `
--add Microsoft.Net.Component.4.6.TargetingPack `
--add Microsoft.Net.ComponentGroup.TargetingPacks.Common `