dotnet-starter-kit icon indicating copy to clipboard operation
dotnet-starter-kit copied to clipboard

Getting started

Open wimdevriendt opened this issue 5 months ago • 11 comments

Hi, i cloned the main branch and installed the prerequisites. when starting it's already given me an exception. Is there a more detailed document how to get started? Regards

wimdevriendt avatar Jun 08 '26 16:06 wimdevriendt

Can I know what the exception is? Ideally, if you set the startup project as AppHost, it should start seamlessly.

iammukeshm avatar Jun 09 '26 05:06 iammukeshm

Hi, will try it tomorrow again. Thanks

wimdevriendt avatar Jun 09 '26 19:06 wimdevriendt

I got the error as well.

Unable to find project information for 'C:\Repos\dotnet-starter-kit\src\BuildingBlocks\Quota\Quota.csproj'. If you are using Visual Studio, this may be because the project is unloaded or not part of the current solution so run a restore from the command-line. Otherwise, the project file may be invalid or missing targets required for restore.

Image

Found the root cause. The Quota.csproj file exists at src\BuildingBlocks\Quota\Quota.csproj and is referenced by several projects (Storage, Web, Framework.Tests, Modules.Billing), but it's not registered in the solution file src\FSH.Starter.slnx. NuGet's restore (driven from the solution) can't find it, hence NU1105 for every project that references it.

Image

sabinshrestha avatar Jun 09 '26 20:06 sabinshrestha

Submitted the PR for this fix: #1296

sabinshrestha avatar Jun 09 '26 21:06 sabinshrestha

@sabinshrestha merged.

iammukeshm avatar Jun 10 '26 13:06 iammukeshm

I don't this problem has been resolved yet. I.e., the PR doesn't fix the restore problem.

  Storage net10.0 failed with 4 error(s) (0.8s)
    C:\dotnet-starter-kit\src\BuildingBlocks\Storage\Extensions.cs(5,21): error CS0234: The type or namespace name 'Quota' does not exist in the namespace 'FSH.Framework' (are you missing an assembly reference?)
    C:\dotnet-starter-kit\src\BuildingBlocks\Storage\QuotaMeteredStorageService.cs(4,21): error CS0234: The type or namespace name 'Quota' does not exist in the namespace 'FSH.Framework' (are you missing an assembly reference?)
    C:\dotnet-starter-kit\src\BuildingBlocks\Storage\QuotaMeteredStorageService.cs(24,22): error CS0246: The type or namespace name 'IQuotaService' could not be found (are you missing a using directive or an assembly reference?)
    C:\dotnet-starter-kit\src\BuildingBlocks\Storage\QuotaMeteredStorageService.cs(30,9): error CS0246: The type or namespace name 'IQuotaService' could not be found (are you missing a using directive or an assembly reference?)
  Web net10.0 failed with 1 error(s) (0.6s)
    C:\dotnet-starter-kit\src\BuildingBlocks\Web\Extensions.cs(5,21): error CS0234: The type or namespace name 'Quota' does not exist in the namespace 'FSH.Framework' (are you missing an assembly reference?)

Build failed with 5 error(s) in 4.7s

bahrep avatar Jun 10 '26 18:06 bahrep

I don't this problem has been resolved yet. I.e., the PR doesn't fix the restore problem.

  Storage net10.0 failed with 4 error(s) (0.8s)
    C:\dotnet-starter-kit\src\BuildingBlocks\Storage\Extensions.cs(5,21): error CS0234: The type or namespace name 'Quota' does not exist in the namespace 'FSH.Framework' (are you missing an assembly reference?)
    C:\dotnet-starter-kit\src\BuildingBlocks\Storage\QuotaMeteredStorageService.cs(4,21): error CS0234: The type or namespace name 'Quota' does not exist in the namespace 'FSH.Framework' (are you missing an assembly reference?)
    C:\dotnet-starter-kit\src\BuildingBlocks\Storage\QuotaMeteredStorageService.cs(24,22): error CS0246: The type or namespace name 'IQuotaService' could not be found (are you missing a using directive or an assembly reference?)
    C:\dotnet-starter-kit\src\BuildingBlocks\Storage\QuotaMeteredStorageService.cs(30,9): error CS0246: The type or namespace name 'IQuotaService' could not be found (are you missing a using directive or an assembly reference?)
  Web net10.0 failed with 1 error(s) (0.6s)
    C:\dotnet-starter-kit\src\BuildingBlocks\Web\Extensions.cs(5,21): error CS0234: The type or namespace name 'Quota' does not exist in the namespace 'FSH.Framework' (are you missing an assembly reference?)

Build failed with 5 error(s) in 4.7s

I will check it and let you know in few hours.

sabinshrestha avatar Jun 10 '26 21:06 sabinshrestha

Now it's compiling but when i start the apphost i am getting System.IO.InvalidDataException HResult=0x80131501 Message=Failed to load configuration from file 'C:\Users\WimDeVriendt\AppData\Roaming\Microsoft\UserSecrets\9fe5df9a-b9b2-4202-bdb4-d30b01b71d1a\secrets.json'. Source=Microsoft.Extensions.Configuration.FileExtensions StackTrace: at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load(Boolean reload) at Microsoft.Extensions.Configuration.ConfigurationManager.AddSource(IConfigurationSource source) at Microsoft.Extensions.Configuration.ConfigurationManager.Microsoft.Extensions.Configuration.IConfigurationBuilder.Add(IConfigurationSource source) at Microsoft.Extensions.Configuration.UserSecretsConfigurationExtensions.AddSecretsFile(IConfigurationBuilder configuration, String secretPath, Boolean optional, Boolean reloadOnChange) at Microsoft.Extensions.Hosting.HostingHostBuilderExtensions.ApplyDefaultAppConfiguration(HostBuilderContext hostingContext, IConfigurationBuilder appConfigBuilder, String[] args) at Microsoft.Extensions.Hosting.HostApplicationBuilder..ctor(HostApplicationBuilderSettings settings) at Aspire.Hosting.DistributedApplicationBuilder..ctor(DistributedApplicationOptions options) at Aspire.Hosting.DistributedApplication.CreateBuilder(String[] args) at Program.<

$>d__0.MoveNext() in D:\repos\6_PureAutomationPersonal\fullstackhero\PA.PTAS\src\Host\FSH.Starter.AppHost\AppHost.cs:line 3

This exception was originally thrown at this call stack: [External Code]

Inner Exception 1: FormatException: Could not parse the JSON file.

Inner Exception 2: JsonReaderException: '0x00' is an invalid start of a value. LineNumber: 0 | BytePositionInLine: 0.

wimdevriendt avatar Jun 11 '26 05:06 wimdevriendt

Also i have this o: Aspire.Hosting.DistributedApplication[0] Login to the dashboard at https://localhost:17273/login?t=1344c24816cb7e62c03045e0f5b7b3ca info: Aspire.Hosting.DistributedApplication[0] Aspire Dashboard

  - Dashboard:  https://localhost:17273
  - Login URL:  https://localhost:17273/login?t=1344c24816cb7e62c03045e0f5b7b3ca
  - OTLP/gRPC:  https://localhost:4317

fail: Aspire.Hosting.Dashboard.Microsoft.Extensions.Hosting.Internal.Host[11] Hosting failed to start System.Security.Cryptography.CryptographicException: Cannot find the requested object. at System.Security.Cryptography.X509Certificates.CertificatePal.FromBlobOrFile(ReadOnlySpan`1 rawData, String fileName, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags) at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(String fileName, String password, X509KeyStorageFlags keyStorageFlags) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Certificates.CertificateConfigLoader.LoadCertificate(CertificateConfig certInfo, String endpointName) at Microsoft.AspNetCore.Server.Kestrel.Core.TlsConfigurationLoader.LoadDefaultCertificate(ConfigurationReader configurationReader) at Microsoft.AspNetCore.Server.Kestrel.KestrelConfigurationLoader.Reload() at Microsoft.AspNetCore.Server.Kestrel.KestrelConfigurationLoader.LoadInternal()

wimdevriendt avatar Jun 11 '26 05:06 wimdevriendt

@bahrep Thanks for the detailed error output — you were right, and it helped track down the real cause.

#1296 added the Quota project to the solution, but the entry accidentally carried a <Build Solution="Debug|*" Project="false" /> flag, which excludes Quota from Debug solution builds. When a project is disabled in the active solution configuration, MSBuild also drops the project references pointing at it — so Storage and Web compiled without the FSH.Framework.Quota reference and failed with exactly the CS0234/CS0246 errors you posted. Our CI builds Release, where the exclusion didn't apply, which is why it slipped through.

Fix is up in #1297 and will be merged shortly. Once it lands, a plain git pull + dotnet build src/FSH.Starter.slnx should work. If you want to keep moving in the meantime, building with -c Release works around it.

iammukeshm avatar Jun 11 '26 06:06 iammukeshm

@wimdevriendt Glad it's compiling now! The two errors you're hitting are both local-machine issues rather than bugs in the kit, and both have quick fixes:

1. InvalidDataException / '0x00' is an invalid start of a value loading secrets.json

Your .NET user-secrets file for the AppHost got corrupted (it's full of null bytes — usually the result of a crash or unclean shutdown while it was being written). Just delete it and it will be regenerated:

del %APPDATA%\Microsoft\UserSecrets\9fe5df9a-b9b2-4202-bdb4-d30b01b71d1a\secrets.json

(or delete the whole 9fe5df9a-... folder — it's safe.)

2. CryptographicException: Cannot find the requested object when the Aspire dashboard starts

That's a broken ASP.NET Core HTTPS development certificate. Regenerate it:

dotnet dev-certs https --clean
dotnet dev-certs https --trust

After those two steps, run the AppHost again and the dashboard should come up cleanly. Let me know how it goes — and we're adding a troubleshooting section to the docs covering both of these, since you're not the first to hit them.

iammukeshm avatar Jun 11 '26 06:06 iammukeshm