What's New in ASP.NET Core?

Sign in to queue

The Discussion

  • User profile image
    Sonny

    Great Presentations. However, too many nuget packages to download. Seems to forget to keep track of things that need to be downloaded for ASP.NET core 2.2 running.

  • User profile image
    Anthony

    Went to MyGet to grab the preview feed and I'm getting unauthorized everytime I try to install the Http Repl. I see the tool has 0 downloads listed as well. Is this not live right now to try out?

  • User profile image
    Desert​Rambler

    I am following along with this video, building the Pets app as he goes. I am at the point where I added the PetsApp project as a Blazor project, and we are ready to build and run. When I build the PetsApp project, I get an error. Any idea what I might be missing? I have included my csproj file below the build error.

    EXEC : error : Object reference not set to an instance of an object.
    2>   at Microsoft.AspNetCore.Blazor.Build.RuntimeDependenciesResolver.AssemblyResolutionContext.<ResolveAssemblies>g__GetAssemblyReferences|13_1(AssemblyEntry current) in /_/src/Microsoft.AspNetCore.Blazor.Build/Core/RuntimeDependenciesResolver.cs:line 103
    2>   at Microsoft.AspNetCore.Blazor.Build.RuntimeDependenciesResolver.AssemblyResolutionContext.<ResolveAssemblies>g__ResolveAssembliesCore|13_0(<>c__DisplayClass13_0& ) in /_/src/Microsoft.AspNetCore.Blazor.Build/Core/RuntimeDependenciesResolver.cs:line 91
    2>   at Microsoft.AspNetCore.Blazor.Build.RuntimeDependenciesResolver.AssemblyResolutionContext.ResolveAssemblies() in /_/src/Microsoft.AspNetCore.Blazor.Build/Core/RuntimeDependenciesResolver.cs:line 82
    2>   at Microsoft.AspNetCore.Blazor.Build.RuntimeDependenciesResolver.ResolveRuntimeDependenciesCore(String entryPoint, String[] applicationDependencies, String[] monoBclDirectories) in /_/src/Microsoft.AspNetCore.Blazor.Build/Core/RuntimeDependenciesResolver.cs:line 46
    2>   at Microsoft.AspNetCore.Blazor.Build.Cli.Commands.ResolveRuntimeDependenciesCommand.<>c__DisplayClass0_0.<Command>b__0() in /_/src/Microsoft.AspNetCore.Blazor.Build/Cli/Commands/ResolveRuntimeDependenciesCommand.cs:line 44
    2>C:\Users\Cindy\.nuget\packages\microsoft.aspnetcore.blazor.build\0.5.1\targets\Blazor.MonoRuntime.targets(533,5): error MSB3073: The command "dotnet "C:\Users\Cindy\.nuget\packages\microsoft.aspnetcore.blazor.build\0.5.1\targets\../tools/Microsoft.AspNetCore.Blazor.Build.dll" resolve-dependencies "C:\Users\Cindy\source\repos\dotnetConf\PetsApi\PetsApp\obj\Debug\netstandard2.0\PetsApp.dll" --references "C:\Users\Cindy\source\repos\dotnetConf\PetsApi\PetsApp\obj\Debug\netstandard2.0\blazor/resolve-dependencies.txt" --base-class-library "C:\Users\Cindy\.nuget\packages\microsoft.aspnetcore.blazor.build\0.5.1\targets\../tools/mono/bcl/" --base-class-library "C:\Users\Cindy\.nuget\packages\microsoft.aspnetcore.blazor.build\0.5.1\targets\../tools/mono/bcl/Facades/" --output "C:\Users\Cindy\source\repos\dotnetConf\PetsApi\PetsApp\obj\Debug\netstandard2.0\blazor/resolved.assemblies.txt"" exited with code 1.
    2>Done building project "PetsApp.csproj" -- FAILED.

     

    <Project Sdk="Microsoft.NET.Sdk.Web">
    
      <PropertyGroup>
        <TargetFramework>netstandard2.0</TargetFramework>
        <RunCommand>dotnet</RunCommand>
        <RunArguments>blazor serve</RunArguments>
        <LangVersion>7.3</LangVersion>
        <BlazorLinkOnBuild>false</BlazorLinkOnBuild>
      </PropertyGroup>
    
      <ItemGroup>
        <PackageReference Include="Microsoft.AspNetCore.Blazor.Browser" Version="0.5.1" />
        <PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="0.5.1" />
        <DotNetCliToolReference Include="Microsoft.AspNetCore.Blazor.Cli" Version="0.5.1" />
      </ItemGroup>
    
      <ItemGroup>
        <ProjectReference Include="..\PetsClient\PetsClient.csproj" />
      </ItemGroup>
    
    </Project>
    

  • User profile image
    danroth27

    @Anthony: I think this is the one you want: https://dotnet.myget.org/feed/dotnet-core/package/nuget/dotnet-httprepl. Are you not able to access it?

  • User profile image
    danroth27

    @DesertRambler: What happens when you try to do a `dotnet restore` on the Blazor project?

  • User profile image
    Desert​Rambler

    @danroth27:Thanks, Dan. I went to the solution folder and ran `dotnet restore` and it appeared to restore everything for all projects. However, when I went down to the Blazor project folder and ran it, it complained that I didn't have a compatible version of the .NET Core SDK. The Blazor project template created a `global.json` file that pinned the version of the SDK to 2.1.300, and I had 2.1.202 and 2.1.402 installed, but no version from 2.1.300. So I installed 2.1.302, ran `dotnet restore` from the Blazor project folder, restarted VS, did a Clean and Rebuild on the solution, and it all came up properly. Yay!

    It's interesting that installing the VS Extension for Blazor did not insure I had the correct SDK version installed if the template was going to create a `global.json` for the project to have a specific version. I have not tried removing the `global.json` to see if it will use the 2.1.402 or 2.1.500 versions that I have installed.

     

     

  • User profile image
    Yaron

    Can you upload the PetsApi in GitHub?

    I can't use the scaffolder, I followed your steps and I am getting the error "Sequence contains no elements" :(

  • User profile image
    vinhngochi

    When i run the blazor application. It raises the error. How can i fix it? Thank you.

    ArgumentException: An item with the same key has already been added. Key: .wasm
    System.Collections.Generic.Dictionary<TKey, TValue>.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
    
    app.UseSwaggerUI(c => {
         c.SwaggerEndpoint("/swagger/v1/swagger.json", 
          "Pet API V1");
    });
    
    app.UseBlazor<PetsApp.Program>();

Add Your 2 Cents