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

assembly Wangkanai.Detection, Version=3.0.0.0 does not have a strong name #364

Closed
naji-makhoul opened this issue Mar 27, 2020 · 11 comments
Closed

Comments

@naji-makhoul
Copy link

naji-makhoul commented Mar 27, 2020

after upgrade to version 3.0.0.0, visual studio 2019 show me warning "Referenced assembly 'Wangkanai.Detection, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null' does not have a strong name."

image

@wangkanai
Copy link
Owner

Strong Name? I will investigate this later.

What is your Visual Studio 2019 update? 15.5?

@naji-makhoul
Copy link
Author

Strong Name? I will investigate this later.

What is your Visual Studio 2019 update? 15.5?

Visual Studio 2019 Enterprise 16.5.1

@wangkanai
Copy link
Owner

What is your csproj structure?

<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <Version>3.0</Version>
  </PropertyGroup>
</Project>

Because I'm not getting this kind of errors.
image

I'm not sure if your issue is similar to CommunityToolkit/WindowsCommunityToolkit#1927 or not.

@naji-makhoul
Copy link
Author

here is my csproj structure:

<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
    <AssemblyName>*******</AssemblyName>
    <RootNamespace>*******</RootNamespace>
    <SignAssembly>true</SignAssembly>
    <AssemblyOriginatorKeyFile>*******.pfx</AssemblyOriginatorKeyFile>
  </PropertyGroup>
</Project>

References:

<ItemGroup>
    <PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="7.0.0" />
    <PackageReference Include="Microsoft.AspNet.SignalR.Core" Version="2.4.1" />
    <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.3" />
    <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="3.1.3" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.3" />
    <PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.3" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.3" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.3">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
    <PackageReference Include="Microsoft.IdentityModel.Logging" Version="6.5.0" />
    <PackageReference Include="Microsoft.IdentityModel.Tokens" Version="6.5.0" />
    <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.2" />
    <PackageReference Include="Serilog.AspNetCore" Version="3.2.0" />
    <PackageReference Include="Swashbuckle.AspNetCore" Version="5.3.1" />
    <PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.5.0" />
    <PackageReference Include="Wangkanai.Detection" Version="3.0.0-alpha09" />
    <PackageReference Include="Z.EntityFramework.Extensions.EFCore" Version="3.0.61" />
    <PackageReference Include="Z.EntityFramework.Plus.EFCore" Version="3.0.45" />
  </ItemGroup>

@wangkanai
Copy link
Owner

I tried to reproduce you project structure in the following branch https://github.com/wangkanai/Detection/tree/naji and still can't get the same issue.

image

  • Code Signing
  • Assemby Name
  • Root Namespace
  • Hosting model InProcess

I'm really not sure that is causing your issue.

@naji-makhoul
Copy link
Author

naji-makhoul commented Apr 29, 2020

@wangkanai , i found it..
its happens when inject IDetectionService

try to inject it in chtml file and rebuild

@inject Wangkanai.Detection.Services.IDetectionService DetectionService

<p>
     Type: @DetectionService.Device.Type 
     Platform Name: @DetectionService.Platform.Name
     Browser Name: @DetectionService.Browser.Name 
     Browser Version: @DetectionService.Browser.Version
</p>

it also happens when add it to constructor:

    private readonly IDetectionService _detectionService;

    public MessagingHandler(IDetectionService detectionService)
    {
        _detectionService = detectionService;
    }

@wangkanai
Copy link
Owner

Interesting! I can now reproduce this issue too. Its look like I would need to code sign my library before publishing it to nuget too. Would anybody like to sponsor me in code of code signing certificate? https://en.sklep.certum.pl/data-safety/code-signing-certificates/open-source-code-signing-1022.html

image

wangkanai added a commit that referenced this issue May 4, 2020
wangkanai added a commit that referenced this issue May 4, 2020
@wangkanai
Copy link
Owner

I have publish 3.0 alpha10 with code signing. See does this solve your issue.
https://www.nuget.org/packages/Wangkanai.Detection/3.0.0-alpha10

@naji-makhoul
Copy link
Author

No , the warning still exists

2>CSC : warning CS8002: Referenced assembly 'Wangkanai.Detection, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null' does not have a strong name.


<ItemGroup>
    <PackageReference Include="Wangkanai.Detection" Version="3.0.0-alpha10" />
  </ItemGroup>

@wangkanai
Copy link
Owner

:( Back to the drawing board.

Thank you

@wangkanai
Copy link
Owner

I think this issue should have been resolved a while back already. I have a code signing in place and string naming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants