Message 1 of 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I am attempting to connect to a smartsheet using their API in a C# program for autocad / autocadMap3d.
i am getting the error : "could not load file or assembly 'smartsheet-csharp-sdk' or one of its dependencies.
System.IO.FileNotFoundException: Could not load file or assembly 'smartsheet-csharp-sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
File name: 'smartsheet-csharp-sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null'
I have installed the smartsheet sdk via NuGet, not sure what i am missing?
public static void InitializeSmartsheetClient()
{
Document doc = Application.DocumentManager.MdiActiveDocument;
Database db = doc.Database;
Editor ed = doc.Editor;
string smartsheetAccessToken = ""; // token
long specificSheetId = ; // Smartsheet Tracker
try
{
// Initialize Smartsheet client with the API access token using SmartsheetBuilder
var smartsheetClient = new SmartsheetBuilder()
.SetAccessToken(smartsheetAccessToken)
.Build(); // This initializes the SmartsheetClient
// Retrieve the sheet by its ID from Smartsheet
var sheet = smartsheetClient.SheetResources.GetSheet(specificSheetId, null, null); // Retrieve the sheet by ID
// If the sheet is retrieved successfully, display the sheet name
ed.WriteMessage($"\nConnected to Smartsheet! Sheet Name: {sheet.Name}\n");
}
catch (System.Exception ex)
{
// If there’s an error connecting to Smartsheet, display the error message
ed.WriteMessage($"\nError connecting to Smartsheet: {ex.Message}\n");
}
}
Solved! Go to Solution.