-
Notifications
You must be signed in to change notification settings - Fork 228
Compilation options 'CryptoPublicKey' and 'CryptoKeyFile' can't both be specified at the same time. #2452
Comments
I tracked this down to keyFile and strongName being used at the same time with help from http://www.paraesthesia.com/archive/2015/08/06/sign-dnx-assemblies-with-your-key-and-test-in-dnxcore/ This is confusing because the sample here - http://blogs.msdn.com/b/webdev/archive/2015/07/27/announcing-availability-of-asp-net-5-beta-6.aspx - used both of them at once. Whatever the cause, the error message sucks and is completely unhelpful to anyone who doesn't have deep knowledge of Roslyn. |
@JamesNK the sample in the announcement blog is worng. I already asked @danroth27 to fix it. You can't have both |
Closing, since it is an error in the post. I'll see about getting someone to update the blog post today, otherwise @danroth27 is back tomorrow. |
Why are you closing this? The error message given to the user should say you can't use keyFile and strongName at the same time. The current one doesn't help them. |
Oh whoops, we must've misunderstood the issue then. So the error message is simply wrong? |
The message is technically correct but it comes directly from the compiler so does not relate to settings in the project.json and therefore may not be useful.
|
Blog post should be updated now. |
If project json contains the `keyFile` property the assembly should be signed using the provided snk. However real signing is not supported on Mono. Currently we just error out in this case, after this change we will fall back to using OSS signing. (Fixes #2558) Also adding a warning for a case where if both `strongName` and `keyFile` settings are provided we would just display errors from Roslyn which might be hard to understand/troubleshoot because the names used in the errors are different from the names we use in project.json (Fixes #2452)
…eClr If the project.json file contains the `keyFile` on CoreClr and Mono we will extract the public key from the snk file and will OSS sign the assembly with the extracted key. (Fixes #2558). We will do the same on desktop CLR if the `keyFile` option is accompanied by `"useOssSigning": true` As a result of this change the `keyFile` and the `useOssSigning` are no longer mutually exclusive and we will no show cyptic Roslyn compilation errors we would have shown before. (Fixes #2452).
…eClr If the project.json file contains the `keyFile` on CoreClr and Mono we will extract the public key from the snk file and will OSS sign the assembly with the extracted key. (Fixes #2558). We will do the same on desktop CLR if the `keyFile` option is accompanied by `"useOssSigning": true` As a result of this change the `keyFile` and the `useOssSigning` are no longer mutually exclusive and we will no show cyptic Roslyn compilation errors we would have shown before. (Fixes #2452).
We will now extract the public key from the snk and will sign the assembly with this key. We won't get the error anymore since now using both options is valid. (only |
I'm attempting to dnu build a project.json that has a strong name. If I have a "keyFile" value then I get this error:
If I don't have a keyFile value then the build successfully creates a DLL that is strong named using a key that I didn't specify. I have no idea where it came from.
The text was updated successfully, but these errors were encountered: