Problem to build snap for net6.0

Hello everyone! I’m designing the cross platform app using Avalonia (c# and net6.0). I want to use snap to distribute the app on Linux but I’m beginner in Snap.

So I’ve googled and found the most of what I need, but I can’t solve one problem still.

There are two projects in my solution: project A and project B (library) for example. The project A uses some methods of the project B (I mean that Project B is included to Project A as dependency) and when I try to create Snap I’ll get next error:

/root/parts/mysnap/build/Program.cs(3,19): error CS0103: The name ‘ProjectB’ does not exist in the current context [/root/parts/mysnap/build/ProjectA.csproj]

This is my .yaml

name: snaptest

base: core18

version: ‘0.1’

summary: Single-line elevator pitch for your amazing snap # 79 char long summary

description: | This is my-snap’s description. You have a paragraph or two to tell the most important story about your snap. Keep it under 100 words though, we live in tweetspace and your description wants to look good in the snap store.

grade: devel # must be ‘stable’ to release into candidate/stable channels

confinement: devmode # use ‘strict’ once you have the right plugs and slots

apps:

snaptest: command: ./ProjectA

parts:

mysnap: plugin: dotnet dotnet-version: 6.0 dotnet-runtime-version: ‘6.0.0’ after: [testlibrary] source: ./ProjectA source-type: local override-build: | dotnet build -c Release dotnet publish -r linux-x64 -c Release -p:PublishSingleFile=true -p:PublishTrimmed=true -p:PublishReadyToRun=true --self-contained true -o $SNAPCRAFT_PART_INSTALL chmod 0755 $SNAPCRAFT_PART_INSTALL/ProjectA

testlibrary: plugin: dotnet dotnet-version: 6.0 dotnet-runtime-version: ‘6.0.0’ source: ./ProjectB source-type: local

I’ve solved my issue:

1) I’ve changed my .yaml to

name: snaptest
base: core18
version: ‘0.1’
summary: Single-line elevator pitch for your amazing snap # 79 char long summary
description: | This is my-snap’s description. You have a paragraph or two to tell the most important story about your snap. Keep it under 100 words though, we live in tweetspace and your description wants to look good in the snap store.

grade: devel # must be ‘stable’ to release into candidate/stable channels
confinement: devmode # use ‘strict’ once you have the right plugs and slots

apps:
snaptest:
command: ./ProjectA

parts:
mysnap:
plugin: dotnet
dotnet-version: 6.0
dotnet-runtime-version: ‘6.0.0’
source: .
source-type: local
override-build: |
dotnet build -c Release
dotnet publish -r linux-x64 -c Release -p:EnableCompressionInSingleFile=true -p:PublishTrimmed=true -p:PublishReadyToRun=true -p:IncludeNativeLibrariesForSelfExtract=true --self-contained true -o $SNAPCRAFT_PART_INSTALL
chmod 0755 $SNAPCRAFT_PART_INSTALL/ProjectA

2) I’ve used ‘snapcraft --use-lxd’ instead of 'snapcraft snap’