<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/unhandled-exception---an-error-occurred-trying-to-start-process-when-using-net-cli-in-vs-code-snap--joskrwx9u" -->

---
title: Unhandled exception - An error occurred trying to start...
description: Running .NET CLI applications (e.g., `dotnet run app.cs`) inside VS Code installed via snap on Ubuntu can fail with an &#x27;An error occurred trying to start...
canonical: https://daily.dev/posts/unhandled-exception---an-error-occurred-trying-to-start-process-when-using-net-cli-in-vs-code-snap--joskrwx9u
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Unhandled exception - An error occurred trying to start process when using .NET CLI in VS Code snap on Ubuntu | daily.dev
og:description: Running .NET CLI applications (e.g., `dotnet run app.cs`) inside VS Code installed via snap on Ubuntu can fail with an &#x27;An error occurred trying to start...
og:url: https://daily.dev/posts/unhandled-exception---an-error-occurred-trying-to-start-process-when-using-net-cli-in-vs-code-snap--joskrwx9u
og:image: https://api.daily.dev/og/posts/JOSkRWx9U.png
og:image:alt: Unhandled exception - An error occurred trying to start process when using .NET CLI in VS Code snap on Ubuntu
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Unhandled exception - An error occurred trying to start process when using .NET CLI in VS Code snap on Ubuntu

**[No Dogma Blog \(Bryan Hogan\)](https://daily.dev/sources/bryanhogan)** · 3 min read · 0 upvotes · 0 comments

## Summary

Running .NET CLI applications (e.g., `dotnet run app.cs`) inside VS Code installed via snap on Ubuntu can fail with an 'An error occurred trying to start process' error. The root cause is that snap isolates each VS Code version in its own directory, and when VS Code updates, cached .NET build artifacts are copied to the new version folder but the `build-success.cache` file still references the old version's path. Since the old snap version directory is removed after an update, the binary path no longer exists. The fix is a bash script that finds and prints `rm -rf` commands to delete all stale cached build directories for a given application name under `~/snap/code/*/.local/share/dotnet/runfile/`.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://nodogmablog.bryanhogan.net/2026/06/unhandled-exception-an-error-occurred-trying-to-start-process-when-using-net-cli-in-vs-code-snap-on-ubuntu>

---

Tags: [#.net](https://daily.dev/tags/.net), [#vscode](https://daily.dev/tags/vscode), [#ubuntu](https://daily.dev/tags/ubuntu), [#snap](https://daily.dev/tags/snap)

[View this post on daily.dev](https://daily.dev/posts/unhandled-exception---an-error-occurred-trying-to-start-process-when-using-net-cli-in-vs-code-snap--joskrwx9u)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Unhandled exception - An error occurred trying to start process when using .NET CLI in VS Code snap on Ubuntu","url":"https://daily.dev/posts/unhandled-exception---an-error-occurred-trying-to-start-process-when-using-net-cli-in-vs-code-snap--joskrwx9u","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/unhandled-exception---an-error-occurred-trying-to-start-process-when-using-net-cli-in-vs-code-snap--joskrwx9u"},"datePublished":"2026-06-22T20:39:52.354Z","dateModified":"2026-06-22T20:48:04.751Z","description":"Running .NET CLI applications (e.g., `dotnet run app.cs`) inside VS Code installed via snap on Ubuntu can fail with an 'An error occurred trying to start...","image":"https://media.daily.dev/image/upload/s--CxzD6vbw--/f_auto/v1722860399/public/Placeholder%2005","thumbnailUrl":"https://media.daily.dev/image/upload/s--CxzD6vbw--/f_auto/v1722860399/public/Placeholder%2005","isAccessibleForFree":true,"articleSection":"No Dogma Blog (Bryan Hogan)","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"No Dogma Blog (Bryan Hogan)","logo":"https://media.daily.dev/image/upload/s--0RnGeoPG--/f_auto,q_auto/v1780213499/logos/bryanhogan?_a=BAMAMiWQ0","url":"https://daily.dev/sources/bryanhogan"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/unhandled-exception---an-error-occurred-trying-to-start-process-when-using-net-cli-in-vs-code-snap--joskrwx9u","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":".net,vscode,ubuntu,snap","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"No Dogma Blog (Bryan Hogan)","item":"https://daily.dev/sources/bryanhogan"},{"@type":"ListItem","position":3,"name":"Unhandled exception - An error occurred trying to start process when using .NET CLI in VS Code snap on Ubuntu"}]}
```

