ravibpatel / ILRepack.Lib.MSBuild.Task

MSBuild task for ILRepack which is an open-source alternative to ILMerge.
Other
107 stars 30 forks source link

Where do we put the reference to the key #35

Closed TomT15 closed 8 months ago

TomT15 commented 1 year ago

Im trying to understand the following: image The documentation does not specifically say where i should put this reference so i tried following directions from this documentation but have been unable to get the key to work properly https://learn.microsoft.com/en-us/dotnet/standard/assembly/sign-strong-name

ravibpatel commented 1 year ago

If you are using the same config, then the key file should be present in your project directory where your .csproj and ILRepack.Config.props file resides.

TomT15 commented 1 year ago

I did try adding a ILRepack.Config.props to the project file and noticed no different when building and deploying as it still says that there is not a key assigned to it. I will try more Monday

Thomas Tramp

On Fri, Sep 23, 2022, 11:24 AM Ravi Patel @.***> wrote:

If you are using the same config, then the key file should be present in your project directory where your .csproj and ILRepack.Config.props file resides.

— Reply to this email directly, view it on GitHub https://github.com/ravibpatel/ILRepack.Lib.MSBuild.Task/issues/35#issuecomment-1256416334, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALLG2AJKATUDQ6HGB2GLFMLV7XKSFANCNFSM6AAAAAAQTNBF7M . You are receiving this because you authored the thread.Message ID: @.***>

mamift commented 1 year ago

I did try adding a ILRepack.Config.props to the project file and noticed no different when building and deploying as it still says that there is not a key assigned to it. I will try more Monday Thomas Tramp

@TomT15 , I was able to get it to work by putting a KeyFile attribute on the <ILRepack> element in the ILRepack.targets file (see my other issue):

    <ILRepack Parallel="true" Internalize="true" InternalizeExclude="@(DoNotInternalizeAssemblies)" InputAssemblies="@(InputAssemblies)" TargetKind="Dll" OutputFile="$(OutputPath)\$(AssemblyName).dll" 
    KeyFile="$(ProjectDir)key.snk" />

The README.md file seems to give incorrect instructions.

ravibpatel commented 8 months ago

As mentioned in the doc, "This configuration option only applies if you are using the default targets file provided in NuGet package." So if you are using custom targets file then it won't work.