I did the following:
- Used DownGit to download the official demo for SMC20260D
- Unzipped the download
- Downloaded the v2.2.0 Preview3 Library
- Installed the library as a local feed
- Opened the project in Visual Studio
- Updated all the References to point to the dll’s in the V2.2.0 Preview3 Library
- Tried to build the project
- Received several of the following type errors
|Error|CS1503|Argument 1: cannot convert from ‘short’ to ‘string’|Demos|D:\SMC20260D\Demo1\SCM20260D%20Dev\Properties\Resources.Designer.cs|30|Active|
|Error|CS0433|The type ‘DriveInfo’ exists in both ‘GHIElectronics.TinyCLR.IO, Version=220.127.116.11, Culture=neutral, PublicKeyToken=null’ and ‘mscorlib, Version=18.104.22.168, Culture=neutral, PublicKeyToken=b77a5c561934e089’|Demos|D:\SMC20260D\Demo1\SCM20260D%20Dev\Windows\Sd.cs|189|Active|
There probably is a simpler way to do all of this.
This is a sign that you picked up a bad copy of mscorlib. You’ve managed to import a .net Framework copy of mscorlib. It’s easy to do - happens to me once every week or two, especially when starting from an newly enlisted project dir…
To fix this:
- In VS, run Build->Clean
- Exit VS
- In the file explorer or command line, navigate to your .sln’s folder. There should be a ‘packages’ directory there. Delete the contents of the ‘packages’ folder.
- Reopen the project and select Build->Rebuild
- You may need to close and re-open the project one more time.
I tried your suggestion but still got the same results.
You can get more aggressive with ‘clean’ by deleting the bin and obj dirs (and the packages dir again).
What files are in your ‘packages’ directory? In your output (bin\debug or bin\release) directory? We’re picking up a bad assembly somewhere here.
the bin/debug directory is empty and there is no bin/release
Following is a screen shot of packages directory
You need to delete every thing that package folder, then clean build.
If still doesnt work, need to uninstall the GHI…TinyCLR.Core and reinstall it again.
Problem is, to uninstall Core, requires to uninstall all other nugets, meaning you have uninstall all nugets, delete… clean build…
I have a fundamental problem of some kind. I uninstalled all the packages, did a clean, exitted VS 2019. Opened VS and the project, then using the NuGet Package Manager installed version 2.0.0 of all the needed packages from nuget.org Then did a build and got 347 errors saying namespaces don’t exist etc. (CS0103, CS0246).
Are those compile errors or Intellisense errors?
If you get widespread intellisense errors, then exit VS and delete the ./.vs/ directory.
Thanks to all who commented on my issue but I found the problem. The project directory was named “SCM20260D%20Dev”. Using file explorer I renamed the directory to “SCM20260D Dev” and all my problems went away. Somehow the blank character got replaced by %20 causing all my problems.