backVisual Studio for SimHub plugin:  How-ToSimHub and its plugin SDK are in C#;W3 C# Tutorial describes C# elements well; content until C# Methods is classic C. tutorialspoint Basic Syntax page lists C# Keywords; Program Structures page introduces Visual Studio sadly employing concepts out of order or simply unexplained. Visual Studio 2019 does not update to 2022;  VS 2022 installs in parallel. (VS Community 2022 Installation) Clicking on a .csproj file launched Visual Studio     .csproj file was listed in lower right Properties window     which showed .NET framework 4.7.2     - SimHub wants at least 4.8, per Wotever 8.2.0 release 12/16/2022       Change framework setting in Visual Studio SDK-style projects enable removing unused resources. Unlike legacy Visual Studio .NET Framework projects,.NET uses SDK-style project files,but does NOT support WPF applications, only console.Migrating .NET Framework WPF to .NET involves converting projects;see porting overview and upgrading HowTo. for VS 2022
for VS 2019Converting old csproj to SDKThis succeeded only because no XAML user interface code.SDK projects are wanted for unused reference removal support. >dotnet tool install --global Project2015To2017.Migrate2019.Tool You can invoke the tool using the following command:  dotnet-migrate-2019 Tool 'project2015to2017.migrate2019.tool' (version '4.1.3') was successfully installed. >dotnet migrate-2019 wizard E:\my\Sim\SimHub\SimHub\PluginSdk\MIDIio\MIDIio.csproj (transcript) Since the dotnet migrate-2019 wizard was run on the .csproj file but not the .sln ,Clicking the .csproj file launched VS, and unused references were removed,but .sln was not updated.As a test, that .sln was disappeared by moving to another directory,and Visual Studio seemed fine with no .sln file.However, moving the .sln file back while it was runningexcited Visual Studio enough to update it. Because SDK version defaults to OutDir ..\..\net48\ ,added to .csproj file:  <OutDir>..\..\</OutDir>
A simple SimHub pluginhttps://github.com/search?q=simhub+plugin https://github.com/viper4gh/SimHub-Plugin-CalcLngWheelSlip Has (for VS): Properties/, *.cs project.class.sln,csproj, SettingsControl.xaml, xaml.cs (for git):  .gitattributes, .gitignore Also:  README.md, docs/ Cloned by GitHub Desktop to SimHub/PluginSdk/ launched with VS 2019, with Viper.PluginCalcLngWheelSlip highlighted under Solution Explorer, click wrench icon under Properties to launch main properties. Under Debug, added * Start external program:  [\path\to\SimHubWPF.exe ] .. a relative path (..\..\SimHubWPF.exe) was rejected. That provokes creation of Viper.PluginCalcLngWheelSlip.csproj.user .. which was ignored by .gitignore entry '*.user' $ git add -f Viper.PluginCalcLngWheelSlip.csproj.userBuild failed, in part complaining about .NET Target framework not 4.8 - downloaded and installed, then under Properties wrench Application, changed Target framework to .NET Framework 4.8 .. which modified Viper.PluginCalcLngWheelSlip.csproj Forked in GitHub Desktop, which pushed it to https://github.com/blekenbleu/SimHub-Plugin-CalcLngWheelSlip ... renamed on GitHub website under settings https://github.com/blekenbleu/CalcLngWheelSlip Project then built with warning:
>E:\my\Sim\SimHub\SimHub\PluginSdk\CalcLngWheelSlip\PluginCalcLngWheelSlip.cs(13,6,13,22): deleted PluginDescritionAttribute , which Wotever had deprecatedPrompted for IntelliCode;  opted in. At this point, GitHub Desktop expects push to https://github.com/blekenbleu/SimHub-Plugin-CalcLngWheelSlip ... but automagically accommodated repository name change. commented out '*.user' in .gitignore to push Viper.PluginCalcLngWheelSlip.csproj.user The Viper.PluginCalcLngWheelSlip plugin not only built,it installed and was detected by SimHub and seems to work, but not in iRacing or ACC... SimHub.Logging:  [2023-01-16 16:34:32,492] INFO - Initialising Viper.PluginCalcLngWheelSlip.ViperDataPlugin plugin Exception thrown:  'System.IO.FileNotFoundException' in mscorlib.dllUsing this for renaming DataPluginDemo to MIDI-io turned everything to crap: Optional Step:  Rename Namespaces should emphasize that requires loading a .cs file... got this warning: VS rejects MIDI-io namespace; MIDIio is OK...Some brute force Vim, then try renaming per above instructions. One gotcha:  rename the whatever before right-clicking for rename Can't find resource mahapps.styles.button.flat Fiddling with resources provoked license complaints from (Arduino) Visual Micro, so uninstalled it. Despite warning, manually changed Properties/AssemblyInfo.cs, replacing blekenbleu.PluginSdkDemo with MIDIio Hyphen in namespace is rejected;  probably also in class names. Using MIDIio for both namespace and class is evidently very bad, halting VS with a useless error message.Folder name is not problematic, e.g. using MIDIio for folder and main class names.The only place that namespace (unique from class name) is referenced without specific [Nn]amespace label are: SettingsControl.xaml:?<UserControl x:Class=""" Properties/Resources.Designer.cs:  global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("", typeof(Resources).Assembly); XAML user interface (ick) tutorialsA simple WPF XAML appGet in the habit of checking
IMO, changing via Visual Studio UI is harder than editing them in the |
maintained by blekenbleu |