Unable to run sample C# read-write-sheet in Visual Studio Code [New SS user]

Options
disblue7
disblue7
edited 11/26/22 in API & Developers

As the title suggests, I am testing out the smartsheet sample API code in Visual Studio Code. I have cloned the repository from GitHub and run the Program.cs script with hopes that the code would run successfully. I had installed Git and the .NET 7.0 as required before running the code.

https://github.com/smartsheet-samples/csharp-read-write-sheet (sample sheet)

https://github.com/smartsheet-platform/smartsheet-csharp-sdk (SDK)

However, as I tried running the script, it returns me with this exact message.

C:\Program Files\dotnet\sdk\7.0.100\Microsoft.Common.CurrentVersion.targets(1229,5): error MSB3644: The reference assemblies for .NETFramework,Version=v4.5.2 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application.

I had raised a similar question on Stack Overflow for further clarification. A user had shared an older post suggested that the current C# SDK requires the .NET 4.5.2 (or above) framework, the post was dated back in 2018.

https://stackoverflow.com/questions/74571891/visual-studio-code-requires-an-older-version-of-net-framework-to-be-installed (similar question raised by me).

https://github.com/smartsheet-samples/csharp-read-write-sheet/issues/1 (post shared by another Stack Overflow user).


Above all, I would like to know if there any further steps I should consider before running the code. I am also open to other options to run the sample code from GitHub. Thanks!

Answers