# GetMainAssetInstanceID(string)

> Returns an asset instance ID.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor.Search](/engine/6000.6/script-reference/unityeditor/search.md)
* **Assembly:** UnityEditor

> **Warning:**
>
> **Removed.** GetMainAssetInstanceID is obsolete, use GetMainAssetEntityId instead

```csharp
public static int GetMainAssetInstanceID(string assetPath)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Asset path.

### Returns

| Type                                                       | Description  |
| ---------------------------------------------------------- | ------------ |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | Instance ID. |

### Remarks

This function try not to load the asset if possible.
