Trouble Building Official Demo for SCM20260D

I did the following:

  1. Used DownGit to download the official demo for SMC20260D
  2. Unzipped the download
  3. Downloaded the v2.2.0 Preview3 Library
  4. Installed the library as a local feed
  5. Opened the project in Visual Studio
  6. Updated all the References to point to the dll’s in the V2.2.0 Preview3 Library
  7. Tried to build the project
  8. Received several of the following type errors
    |Severity|Code|Description|Project|File|Line|Suppression State|
    |—|—|—|—|—|—|—|
    |Error|CS1503|Argument 1: cannot convert from ‘short’ to ‘string’|Demos|D:\SMC20260D\Demo1\SCM20260D%20Dev\Properties\Resources.Designer.cs|30|Active|
    |Severity|Code|Description|Project|File|Line|Suppression State|
    |Error|CS0433|The type ‘DriveInfo’ exists in both ‘GHIElectronics.TinyCLR.IO, Version=2.1.0.0, Culture=neutral, PublicKeyToken=null’ and ‘mscorlib, Version=4.0.0.0, 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:

  1. In VS, run Build->Clean
  2. Exit VS
  3. 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.
  4. Reopen the project and select Build->Rebuild
  5. 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.

1 Like

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.

1 Like