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

BlazorLib - PackageReference 0.2.0-preview1-10195 #16179

Closed
dotnetnoobie opened this issue Apr 18, 2018 · 3 comments
Closed

BlazorLib - PackageReference 0.2.0-preview1-10195 #16179

dotnetnoobie opened this issue Apr 18, 2018 · 3 comments
Labels
area-blazor Includes: Blazor, Razor Components

Comments

@dotnetnoobie
Copy link

Using Blazor Language Services 15.7.10222 (0.2.0 preview version)

When I make a Blazor Reusable Component I get old package references in the .csproj file

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
    <OutputType>library</OutputType>
    <IsPackable>true</IsPackable>
    <BlazorLinkOnBuild>false</BlazorLinkOnBuild>

    <!-- This custom package feed is required only when using nightly builds of Blazor -->
    <RestoreSources>https://dotnet.myget.org/F/blazor-dev/api/v3/index.json;$(RestoreSources)</RestoreSources>
  </PropertyGroup>

  <ItemGroup>
    <!-- .js/.css files will be referenced via <script>/<link> tags; other content files will just be included in the app's 'dist' directory without any tags referencing them -->
    <EmbeddedResource Include="content\**\*.js" LogicalName="blazor:js:%(RecursiveDir)%(Filename)%(Extension)" />
    <EmbeddedResource Include="content\**\*.css" LogicalName="blazor:css:%(RecursiveDir)%(Filename)%(Extension)" />
    <EmbeddedResource Include="content\**" Exclude="**\*.js;**\*.css" LogicalName="blazor:file:%(RecursiveDir)%(Filename)%(Extension)" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.1.0-preview2-final" PrivateAssets="all" />
    <PackageReference Include="Microsoft.AspNetCore.Blazor.Browser" Version="0.2.0-preview1-10195" />
    <PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="0.2.0-preview1-10195" />
  </ItemGroup>

</Project>

The other thing I noticed is that the OutputType is set to Library
but if I look at the properties dialog in VS 2017 preview 3.0
It tells me I have an output type of Windows Application

untitled

@dotnetnoobie
Copy link
Author

dotnetnoobie commented Apr 19, 2018

In the BlazorLib template in the .csproj file

the showing as a Windows Application seems to be due to this line in the .csproj

<OutputType>library</OutputType>

if I change it to use a capital L

<OutputType>Library</OutputType>

Then in the Properties dialog it shows correctly as a Class Library

@borakasmer
Copy link

Hi!
I install .NET Core SDK 2.1.300-preview2-008533 on my Mac (Os x- macOS High Sierra). And Blazor Template. But when I create new blazer project always comes to old version "0.1.0"!

@danroth27
Copy link
Member

Typically you end up with old templates if you have some issue with the configuration of your nuget package sources. Make sure you're getting Microsoft.AspNetCore.Blazor.Templates from nuget.org and not from myget or any other package source.

To ensure you're getting the templates from the right place try this:

dotnet new -u Microsoft.AspNetCore.Blazor.Templates
dotnet new -i Microsoft.AspNetCore.Blazor.Templates --nuget-source https://api.nuget.org/v3/index.json

I think this will resolve your issue, so closing, but please reopen if you still run into problems.

@mkArtakMSFT mkArtakMSFT transferred this issue from dotnet/blazor Oct 27, 2019
@mkArtakMSFT mkArtakMSFT added the area-blazor Includes: Blazor, Razor Components label Oct 27, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Dec 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components
Projects
None yet
Development

No branches or pull requests

4 participants