Skip to content

Errors using the startup template #195

@mpnow

Description

@mpnow

Describe the bug

I tried to use the steps as given in the Getting Started > Datasync server page, but the resulting csproj had these problematic lines in it:

 <PackageReference Include="CommunityToolkit.Datasync.Server" Version="{NUGET_VERSION}" />
 <PackageReference Include="CommunityToolkit.Datasync.Server.EntityFrameworkCore" Version="{NUGET_VERSION}" />

I replaced those with actual version numbers; but next, the resulting Program.cs has this error:

'IServiceCollection' does not contain a definition for 'AddDatasyncControllers' and no accessible extension method 'AddDatasyncControllers' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?)	

on this line:

builder.Services.AddDatasyncControllers();

To Reproduce

Steps to reproduce the behavior:

Follow the steps given on the Getting Started page:

  1. Install the datasync template: dotnet new -i CommunityToolkit.Datasync.Server.Template.CSharp
  2. Create a project: dotnet new datasync-server
  3. See Package Reference error in .csproj
  4. Fix that error by substituting version number 8.04
  5. Re-open project; see AddDatasyncControllers error in Program.cs

Expected behavior

That the program as documented in Getting Started will work without errors.

What platforms?

Windows 11.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ServerImprovements or additions to the server code

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions