-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Enable AllowPartiallyTrustedCaller for DiagnosticSource on netfx #17076
Enable AllowPartiallyTrustedCaller for DiagnosticSource on netfx #17076
Conversation
#else // To keep things short, we drop the operation name | ||
string ret = s_uniqPrefix + "-" + Interlocked.Increment(ref s_currentRootId).ToString("x") + '.'; | ||
#endif | ||
return ret; | ||
} | ||
|
||
[SecuritySafeCritical] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this attribute exist everywhere? (see build failure). Note that if it exists in .net Core 2.0 (which it probably does), I would not have a problem at all #ifdefing the safe code for older versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It exists everywhere, you just need to add a dependency for the older builds. Let me try it out and tell you what to add. Stay tuned
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually the project just had broken dependencies. I've fixed it up, please see: ericstj@0556f02
To test this locally you can run build -allConfigurations
.
After doing so once you can run msbuild /t:BuildAllConfigurations on any project you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! it fixed reference issues, but now I have an issue with packaging:
D:\j\workspace\AllConfigurat---c1564d53\Tools\Packaging.targets(424,5): error MSB4018: The "HarvestPackage" task failed unexpectedly. [D:\j\workspace\AllConfigurat---c1564d53\src\System.Diagnostics.DiagnosticSource\pkg\System.Diagnostics.DiagnosticSource.pkgproj] 11:25:06 D:\j\workspace\AllConfigurat---c1564d53\Tools\Packaging.targets(424,5): error MSB4018: System.ArgumentException: An item with the same key has already been added. [D:\j\workspace\AllConfigurat---c1564d53\src\System.Diagnostics.DiagnosticSource\pkg\System.Diagnostics.DiagnosticSource.pkgproj]
Could you please help with it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, let me have a look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's happening because this project was previously copying the netstandard1.3 build to the net46 folder. Now that you are building explicitly for netstandard1.3 you don't need to do that. See ericstj@85e6fab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll also fix up that error so that its a proper message: dotnet/buildtools#1388
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, it worked!
@@ -411,7 +412,9 @@ private string GenerateRootId() | |||
return ret; | |||
} | |||
|
|||
#if ALLOW_PARTIALLY_TRUSTED_CALLERS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to do this
Have you run secannotate on this? If not, you may have some broken cases. |
…te_errors Fix secannotate errors introduced by #17076 in DiagnosticSource
…lyTrustedCodeDiagSource Enable AllowPartiallyTrustedCaller for DiagnosticSource on netfx Commit migrated from dotnet/corefx@6b3ca00
Commit migrated from dotnet/corefx@0e04667
…fix_secannotate_errors Fix secannotate errors introduced by dotnet/corefx#17076 in DiagnosticSource Commit migrated from dotnet/corefx@4ac8e65
…lyTrustedCodeDiagSource Enable AllowPartiallyTrustedCaller for DiagnosticSource on netfx Commit migrated from dotnet/corefx@6b3ca00
This change marks DiagnosticSource with AllowPartiallyTrustedCaller on net46 and netfx to make it callable from partially trusted code.
E.g. System.Net.Http for .NET Framework declares AllowPartiallyTrustedCaller to be called by partially trusted code therefore can't have DiagnosticSource instrumentation.
Note that support for Activity on .NET 4.5 is dropped, so configuration is removed from the project.