Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors using the startup template #195

Open
mpnow opened this issue Jan 10, 2025 · 0 comments
Open

Errors using the startup template #195

mpnow opened this issue Jan 10, 2025 · 0 comments
Labels
Server Improvements or additions to the server code
Milestone

Comments

@mpnow
Copy link

mpnow commented Jan 10, 2025

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.

@mpnow mpnow added the Requires Triage This issue has not been checked by the project team. label Jan 10, 2025
@adrianhall adrianhall added Server Improvements or additions to the server code and removed Requires Triage This issue has not been checked by the project team. labels Jan 12, 2025
@adrianhall adrianhall added this to the 9.0.0 milestone Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Server Improvements or additions to the server code
Projects
None yet
Development

No branches or pull requests

2 participants