---
title: .NET SDK changes in 3.0
summary: Every change an application built on the 2.x .NET SDK meets in 3.0 — uploads with a Bearer header, scoped tokens, API tokens with an expiry, errors, parsing, client identification, IDS checks — and what the 3.0 instance answers differently through it, with what to do for each.
order: 60
languages: [csharp]
terms: [api-token, scope, versions-token]
see-also: [changelog/v3-0, changelog/v3-0/from-2-to-3, reference/dotnet, how-to/install/dotnet]
---

# .NET SDK changes in 3.0

The package is `BIM.works_SDK` on nuget.org, as before. Upgrade it to the 3.0 package of your instance ([[page:how-to/install/dotnet]]). The pre-release packages up to 3.0.0-b.118 still contain the 2.x SDK; use a later one. The package still targets .NET Standard 2.0 and needs `System.Text.Json` 8.0.5 or later. The request envelope, the WebSocket protocol and the [[dotnet:BIM.works_SDK.Bim#Query2|`Query2`]] envelope are unchanged.

This page lists what changes for an application built on the 2.x .NET SDK, and then what the 3.0 instance answers differently through it. The new features are on [[page:changelog/v3-0]]; [[page:changelog/v3-0/from-2-to-3#dotnet]] has the short version.

Every change has a class:

- **Breaking**: 2.x code no longer compiles, fails, or gives a wrong result.
- **Behaviour**: the same code runs, but the result differs.
- **Deprecated**: still works; use the replacement.
- **Requirement**: what the application has to bring or set up.

## The SDK {#sdk}

| Change | Class |
|---|---|
| Uploads send `Authorization: Bearer <base64 auth>` and the connection's endpoint, which the 3.0 instance requires; without them every upload of new bytes gets HTTP 401, and a large file a reset connection | Requirement: the reason to upgrade |
| The [[dotnet:BIM.works_SDK.Scope|`Scope`]] enum, with [[dotnet:BIM.works_SDK.Scopes#ToWire|`Scopes.ToWire`]] and [[dotnet:BIM.works_SDK.Scopes#FromWire|`FromWire`]]; [[dotnet:BIM.works_SDK.CreateVersionsTokenRequest|`CreateVersionsTokenRequest`]], [[dotnet:BIM.works_SDK.CreateNodesTokenRequest|`CreateNodesTokenRequest`]] and [[dotnet:BIM.works_SDK.CreateRecursiveNodeTokenRequest|`CreateRecursiveNodeTokenRequest`]] have constructors that take an [[dotnet:BIM.works_SDK.Scope|`ISet<Scope>`]], and the task-list constructors are `[Obsolete]` | Deprecated |
| [[dotnet:BIM.works_SDK.Admin.CreateApiToken(System.Guid,System.String,System.Collections.Generic.ISet{BIM.works_SDK.Scope},System.Nullable{System.DateTime})|`Admin.CreateApiToken(nodeUuid, name, ISet<Scope>, DateTime? expiresOn)`]]; the [[dotnet:BIM.works_SDK.ApiTokenCredential|`ApiTokenCredential`]] form remains and gets the instance's default expiry of one month | Behaviour |
| [[dotnet:BIM.works_SDK.TreeNodeStatus#INDEXING|`TreeNodeStatus.INDEXING`]]; [[dotnet:BIM.works_SDK.TreeNodeStatus#INDEXEDING|`INDEXEDING`]] is an obsolete alias of the same value | Deprecated |
| Every error value of the instance is in the SDK's enumerations, and BQL errors have their own, [[dotnet:BIM.works_SDK.BimWorksQueryError|`BimWorksQueryError`]]. A value or domain the SDK does not know is a [[dotnet:BIM.works_SDK.BimWorksException|`BimWorksException`]] with [[dotnet:BIM.works_SDK.BimWorksException#GetEnum|`GetEnum() == null`]], where 2.x threw `ArgumentException`. [[dotnet:BIM.works_SDK.BimWorksException#GetDomain|`GetDomain()`]] and [[dotnet:BIM.works_SDK.BimWorksException#GetErrorType|`GetErrorType()`]] give the instance's names, [[dotnet:BIM.works_SDK.BimWorksException#GetReference|`GetReference()`]] the reference of the failed request (also in [[dotnet:BIM.works_SDK.BimWorksException#ToString|`ToString()`]]) | Behaviour |
| [[dotnet:BIM.works_SDK.BimWorksClient#Execute|`BimWorksClient.Execute`]] throws a [[dotnet:BIM.works_SDK.BimWorksException|`BimWorksException`]] for an HTTP error status, with the instance's error when the answer has one, else `HTTP <status>`; 2.x returned `null`, so the caller got a `NullReferenceException` | Behaviour |
| [[dotnet:BIM.works_SDK.AsyncTask#Get|`AsyncTask.Get()`]] returns also when the request itself fails; the failure is in [[dotnet:BIM.works_SDK.AsyncTask#IsError|`IsError()`]] and [[dotnet:BIM.works_SDK.AsyncTask#GetException|`GetException()`]], and faults [[dotnet:BIM.works_SDK.AsyncTask#GetTask|`GetTask()`]]. 2.x waited for ever when anything in the request threw | Behaviour (a fix) |
| Parsing falls back instead of throwing on a value the SDK does not know: a node type reads as [[dotnet:BIM.works_SDK.NodeType#FOLDER|`FOLDER`]] or [[dotnet:BIM.works_SDK.NodeType#MODEL|`MODEL`]], [[dotnet:BIM.works_SDK.TreeNodeStatus|`TreeNodeStatus`]] and [[dotnet:BIM.works_SDK.Discipline|`Discipline`]] as `UNKNOWN`, a version status as [[dotnet:BIM.works_SDK.TreeNodeVersionStatus#ERROR|`ERROR`]], a deleted status as [[dotnet:BIM.works_SDK.NodeVersionDeletedStatus#ACTIVE|`ACTIVE`]]. Action rows without a query (viewpoints) or without a parent parse, with [[dotnet:BIM.works_SDK.Action#Query|`Query`]] `null` | Behaviour |
| [[dotnet:BIM.works_SDK.TreeNodeVersion#Disciplines|`TreeNodeVersion.Disciplines`]], [[dotnet:BIM.works_SDK.TreeNodeVersion#Filename|`Filename`]] and [[dotnet:BIM.works_SDK.TreeNodeVersion#InputFileType|`InputFileType`]]; [[dotnet:BIM.works_SDK.NodeType#WORKSPACE_ROOT|`NodeType.WORKSPACE_ROOT`]]; the [[dotnet:BIM.works_SDK.Discipline|`Discipline`]] and [[dotnet:BIM.works_SDK.InputFileType|`InputFileType`]] values of 3.0 | New |
| [[dotnet:BIM.works_SDK.Actions#AddFolder|`Actions.AddFolder`]], [[dotnet:BIM.works_SDK.Actions#AddQuery|`AddQuery`]] and [[dotnet:BIM.works_SDK.Actions#DeleteAction|`DeleteAction`]]; [[dotnet:BIM.works_SDK.Info#GetClientInfo|`Info.GetClientInfo()`]]. [[dotnet:BIM.works_SDK.Fs#UndeleteNode|`Fs.UndeleteNode`]] and [[dotnet:BIM.works_SDK.Tokens#CreateRecursiveNodeToken|`Tokens.CreateRecursiveNodeToken`]] call the right task; both failed before | New, and a fix |
| IDS validation and IDS checks: [[dotnet:BIM.works_SDK.Checks|`client.Checks`]] with [[dotnet:BIM.works_SDK.Checks#ValidateIds|`ValidateIds`]], [[dotnet:BIM.works_SDK.Checks#RunIdsCheck|`RunIdsCheck`]] (the result tree with every checked object), [[dotnet:BIM.works_SDK.Checks#RunIdsCheckSummary|`RunIdsCheckSummary`]] (the status per specification) and [[dotnet:BIM.works_SDK.Checks#ReadTooLargeSummary|`ReadTooLargeSummary`]] ([[page:reference/dotnet#checks]], [[page:how-to/checks/run-an-ids-check-via-the-api]]). [[dotnet:BIM.works_SDK.BimWorksException#GetUserSafeMessage|`BimWorksException.GetUserSafeMessage()`]] and [[dotnet:BIM.works_SDK.BimWorksException#GetPayload|`GetPayload()`]] | New |
| Every request carries `X-BIMworks-Client` and a `bimworks-dotnet/<version> (…)` User-Agent, and the WebSocket starts with a hello. [[dotnet:BIM.works_SDK.BimWorksClientFactory#SetApplication|`BimWorksClientFactory.SetApplication(name, version)`]] adds your application; [[dotnet:BIM.works_SDK.BimWorksClientFactory#ExcludePlatformInfo|`ExcludePlatformInfo()`]] leaves out the runtime and the operating system | Behaviour |

What to do:

- **Upgrade the package.** An older package cannot upload new files to a 3.0 instance.
- **Tokens:** pass an [[dotnet:BIM.works_SDK.Scope|`ISet<Scope>`]] ([[page:reference/dotnet#scopes]], [[page:changelog/v3-0/from-2-to-3#scoped-token]]); give [[dotnet:BIM.works_SDK.Admin.CreateApiToken(System.Guid,System.String,System.Collections.Generic.ISet{BIM.works_SDK.Scope},System.Nullable{System.DateTime})|`Admin.CreateApiToken`]] its scopes and the expiry day ([[page:how-to/auth/create-an-api-token]]).
- **Rename** [[dotnet:BIM.works_SDK.TreeNodeStatus#INDEXEDING|`TreeNodeStatus.INDEXEDING`]] to [[dotnet:BIM.works_SDK.TreeNodeStatus#INDEXING|`INDEXING`]].
- **Errors** ([[page:reference/dotnet#errors]]): test [[dotnet:BIM.works_SDK.BimWorksException#GetErrorType|`GetErrorType()`]] where [[dotnet:BIM.works_SDK.BimWorksException#GetEnum|`GetEnum()`]] can be `null`; catch [[dotnet:BIM.works_SDK.BimWorksException|`BimWorksException`]] from [[dotnet:BIM.works_SDK.BimWorksClient#Execute|`Execute`]] instead of testing for `null`; after an asynchronous call, await [[dotnet:BIM.works_SDK.AsyncTask#GetTask|`GetTask()`]] and check [[dotnet:BIM.works_SDK.AsyncTask#IsError|`IsError()`]]; quote [[dotnet:BIM.works_SDK.BimWorksException#GetReference|`GetReference()`]] to support.
- **Parsing:** expect [[dotnet:BIM.works_SDK.Discipline#UNKNOWN|`Discipline.UNKNOWN`]] and [[dotnet:BIM.works_SDK.TreeNodeStatus#UNKNOWN|`TreeNodeStatus.UNKNOWN`]], and a `null` [[dotnet:BIM.works_SDK.Action#Query|`Query`]] for a viewpoint in an action listing.

Still as in 2.x:

- [[dotnet:BIM.works_SDK.GenerateUploadToken|`GenerateUploadToken`]] signs fewer fields than the 3.0 instance checks, so its tokens are refused: the instance binds an upload token to the exact request it signs.
- [[dotnet:BIM.works_SDK.BimWorksClient#QueryDelegated|`QueryDelegated`]] and [[dotnet:BIM.works_SDK.BimWorksClient#QueryWithToken|`QueryWithToken`]] set up a table export with a 2.x query object and return no results ([[page:reference/dotnet#apis]]).
- An upload by URL without [[dotnet:BIM.works_SDK.UploadBuilder#filename|`filename`]] names the node `null`: set [[dotnet:BIM.works_SDK.UploadBuilder#filename|`filename`]].
- The SDK writes every partial upload hash and each "New WebSocket Message" to the console.
- After `NODE_GONE` on a fleet the SDK does not reconnect by itself.

## What the 3.0 instance answers differently {#instance}

Through the 3.0 package, the instance answers these calls differently. They apply to every client; [[page:changelog/v3-0/from-2-to-3]] has them per subject.

| Behaviour | Class |
|---|---|
| Uploads of new bytes, a second version onto a model node, and uploads the instance recognises by their hash all work | — |
| [[dotnet:BIM.works_SDK.Fs#DeleteNodeVersion|`Fs.DeleteNodeVersion`]] deletes only the newest version (`CAN_ONLY_DELETE_LAST_VERSION`). [[dotnet:BIM.works_SDK.Fs#DeleteNode|`Fs.DeleteNode`]] on a missing node answers `NODE_NOT_FOUND` where 2.x returned `true`. [[dotnet:BIM.works_SDK.Fs#RenameNode|`Fs.RenameNode`]] checks write rights | Breaking (conditional), Behaviour |
| An upload by URL of a private, loopback or link-local address is refused (`UPLOAD_URL_REFUSED`). Like any failed upload (a corrupt IFC gives `StepParserErrorCode.END_OF_FILE`), it leaves the node in [[dotnet:BIM.works_SDK.TreeNodeStatus#ERROR|`ERROR`]] with an error row; 2.x left a node without a version | Breaking (conditional), Behaviour |
| A token with a task list, issued after an API-token login, also carries the issuer's scopes, and reaches calls outside its list that those scopes and its resource rights allow: a `[Query2]` versions token can call [[dotnet:BIM.works_SDK.Fs#GetNodeVersion|`GetNodeVersion`]], while calls on nodes still need node rights. A task name the instance does not have is refused (`INVALID_TASK_NAME`, naming the likely intended task). A token with scopes reaches exactly its scopes ([[page:changelog/v3-0/from-2-to-3#tokens]]) | Behaviour (security relevant) |
| API tokens expire, after one month by default. Logged in with an API token, only an organization owner can create an API token | Requirement |
| [[dotnet:BIM.works_SDK.Fs#ListNodes|`Fs.ListNodes`]] is refused for nodes and versions tokens. [[dotnet:BIM.works_SDK.Bim#Query2|`Bim.Query2`]] with a stored query needs read rights on it. [[dotnet:BIM.works_SDK.UploadOption#NEW_MODEL|`UploadOption.NEW_MODEL`]] takes effect. During a graceful shutdown the instance answers `SERVICE_UNAVAILABLE`. `X-Forwarded-For` is believed only from proxies the instance is configured to trust | Behaviour |
| BQL in the 2.x form fails with `BimWorksQueryError.SYNTAX_ERROR` (`IN m3`: "missing EOF at 'IN'"); results and counts change as described in [[page:changelog/v3-0/from-2-to-3#query-languages]] | Breaking |
| A call without a login answers `NO_AUTHORIZATION`; an unknown API token `INVALID_API_TOKEN` | Behaviour |
