The following types exist in Desktop and could be stubbed out in CoreFX just as we've done with more popular CAS attributes. Just no-ops to make existing code work.
TypesMustExist : Type 'System.Data.Common.DBDataPermission' does not exist in the implementation but it does exist in the contract.
TypesMustExist : Type 'System.Data.Common.DBDataPermissionAttribute' does not exist in the implementation but it does exist in the contract.
TypesMustExist : Type 'System.Data.Odbc.OdbcPermission' does not exist in the implementation but it does exist in the contract.
TypesMustExist : Type 'System.Data.Odbc.OdbcPermissionAttribute' does not exist in the implementation but it does exist in the contract.
TypesMustExist : Type 'System.Data.OleDb.OleDbPermission' does not exist in the implementation but it does exist in the contract.
TypesMustExist : Type 'System.Data.OleDb.OleDbPermissionAttribute' does not exist in the implementation but it does exist in the contract.
TypesMustExist : Type 'System.Data.SqlClient.SqlClientPermission' does not exist in the implementation but it does exist in the contract.
TypesMustExist : Type 'System.Data.SqlClient.SqlClientPermissionAttribute' does not exist in the implementation but it does exist in the contract.
TypesMustExist : Type 'System.Diagnostics.EventLogPermission' does not exist in the implementation but it does exist in the contract.
TypesMustExist : Type 'System.Diagnostics.EventLogPermissionAttribute' does not exist in the implementation but it does exist in the contract.
TypesMustExist : Type 'System.Diagnostics.PerformanceCounterPermission' does not exist in the implementation but it does exist in the contract.
TypesMustExist : Type 'System.Diagnostics.PerformanceCounterPermissionAttribute' does not exist in the implementation but it does exist in the contract.
TypesMustExist : Type 'System.Drawing.Printing.PrintingPermission' does not exist in the implementation but it does exist in the contract.
TypesMustExist : Type 'System.Drawing.Printing.PrintingPermissionAttribute' does not exist in the implementation but it does exist in the contract.
TypesMustExist : Type 'System.Net.DnsPermission' does not exist in the implementation but it does exist in the contract.
TypesMustExist : Type 'System.Net.DnsPermissionAttribute' does not exist in the implementation but it does exist in the contract.
TypesMustExist : Type 'System.Net.EndpointPermission' does not exist in the implementation but it does exist in the contract.
TypesMustExist : Type 'System.Net.Mail.SmtpPermission' does not exist in the implementation but it does exist in the contract.
TypesMustExist : Type 'System.Net.Mail.SmtpPermissionAttribute' does not exist in the implementation but it does exist in the contract.
TypesMustExist : Type 'System.Net.SocketPermission' does not exist in the implementation but it does exist in the contract.
TypesMustExist : Type 'System.Net.SocketPermissionAttribute' does not exist in the implementation but it does exist in the contract.
TypesMustExist : Type 'System.Net.WebPermission' does not exist in the implementation but it does exist in the contract.
TypesMustExist : Type 'System.Net.WebPermissionAttribute' does not exist in the implementation but it does exist in the contract.
TypesMustExist : Type 'System.Transactions.DistributedTransactionPermission' does not exist in the implementation but it does exist in the contract.
TypesMustExist : Type 'System.Transactions.DistributedTransactionPermissionAttribute' does not exist in the implementation but it does exist in the contract.
below is some crude usage data from Nuget and app analyses. Note that zero does not mean exactly zero necessarily -- there's a huge number of apps and packages.
Type usage
DBDataPermission 0.20%
DBDataPermissionAttribute 0.20%
SqlClientPermissionAttribute 0.11%
OraclePermissionAttribute 0.04%
OleDbPermission 0.02%
SqlClientPermission 0.02%
OdbcPermission 0.01%
OraclePermission 0.01%
Type usage
PerformanceCounterPermissionAttribute 0.11%
EventLogPermissionAttribute 0.05%
PerformanceCounterPermission 0.03%
EventLogPermission 0.02%
EventLogPermissionEntry 0.01%
EventLogPermissionEntryCollection 0.00%
PerformanceCounterPermissionEntry 0.00%
PerformanceCounterPermissionEntryCollection 0.00%
Type usage
PrintingPermission 0.02%
PrintingPermissionAttribute 0.00%
Type usage
DnsPermission 0.21%
WebPermission 0.14%
SocketPermission 0.11%
DnsPermissionAttribute 0.05%
SocketPermissionAttribute 0.04%
WebPermissionAttribute 0.02%
SmtpPermissionAttribute 0.02%
NetworkInformationPermission 0.01%
EndpointPermission 0.00%
SmtpPermission 0.00%
NetworkInformationPermissionAttribute 0.00%
PnrpPermission 0.00%
PnrpPermissionAttribute 0.00%
PeerCollaborationPermission 0.00%
PeerCollaborationPermissionAttribute 0.00%
Type usage
DistributedTransactionPermission 0.00%
DistributedTransactionPermissionAttribute 0.00%
This is just a nice to have for 2.0.
These would be nice for 2.0 as they're highest
Type usage
DBDataPermission 0.20%
DBDataPermissionAttribute 0.20%
PerformanceCounterPermissionAttribute 0.11%
SqlClientPermissionAttribute 0.11%
DnsPermission 0.21%
WebPermission 0.14%
As it is marked as "up-for-grabs" I'm referencing this PR, which shows how I did it for other types: https://github.com/dotnet/corefx/pull/17677
This is an easy task for someone new to the codebase.
I'll take a look at this. Is there any background info I should read up on for this? Thanks!
From the description it sounds pretty straightforward, no background needed. Give it a try and let us know if you get stuck.
BTW: Check out main page for contribution guideline (which is in GitHub wiki, editable by anyone, so feel free to update it)
@jguady Nothing really special.
ApiCompatBaseline.netcoreapp.netfx461.txt (src/shims/) changes. The file gets updated when you do a full build or by manual kicking it with msbuild src/shims/ApiCompat.proj /t:Rebuild from the project root.Thanks for your help! 馃憤 It would be absolutely great if you could make it before 2.0 milestone.
@jguady here's an example of an existing one
https://github.com/dotnet/corefx/search?utf8=%E2%9C%93&q=FileIOPermissionAttribute&type=
Thanks! @danmosemsft. Quick question, Do they all live under SS.Permissions or do they live in each area listed above?
@jguady they are in various namespaces of course but they can all go into the S.S.Permissions library. Just as S.Net.NetworkInformation.NetworkInformationPermission is already there.
Basically we're segregating all these stubs in that place.
If all this looks correct I'll keep doing the same thing.
https://github.com/jguady/corefx/commit/373631f4efa65f1ba881d1aa3a43a70b4ad253b5
@danmosemsft @ViktorHofer
@jguady yes it looks good!
BTW, you do'nt need to type the stubs out. You can use genapis. Eg., in my local repo this:
C:\git\corefx>C:\git\corefx\Tools\dotnetcli\shared\Microsoft.NETCore.App\1.1.1\dotnet.exe Tools\GenAPI.exe -assembly:c:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll -writer:CSDecl -out:foo.cs
emits into foo.cs the stubs for all api in System.Drawing.dll (as an example). You can copy and paste stubs out of that. No typing, no errors!
As another check, when you are done, you can remove any of the types and members you added from this file src\shims\ApiCompatBaseline.netcoreapp.netfx461.ignore.txt. Then go run msbuild on src\ships\apicompat.proj. You should see the diffs go away from ApiCompatBaseline.netcoreapp.netfx461.txt and you can include that updated reduced baseline with your commit.
As those types are already in ApiCompatBaseline.netcoreapp.netfx461.ignore.txt, they won't show up in the ApiCompatBaseline.netcoreapp.netfx461.txt. We put all TypesMustExist lines into ApiCompatBaseline.netcoreapp.netfx461.ignore.txt as they are not a target for 2.0.
What you could/should do, is to remove these TypesMustExist lines from ApiCompatBaseline.netcoreapp.netfx461.ignore.txt and make sure that they are not coming back into ApiCompatBaseline.netcoreapp.netfx461.txt after you run msbuild src/shims/ApiCompat.proj /t:Rebuild. So basically what @danmosemsft said but instead of checking for a diff you check that no diff will appear.
Thank you @ViktorHofer for the correction :)
Hey @danmosemsft E:\dev\corefx\Tools\dotnetcli\shared\Microsoft.NETCore.App\1.1.1\dotnet.exe says "This app can't run on your PC dialog" and displays Access is denied in the VS command prompt (puzzled). Can I use another version? I have 1.0.3 installed and there appear to be a few others in the source.
@jguady what about Tools\dotnetcli\dotnet.exe Tools\GenAPI.exe ? No idea why one would work for me and not for you.
@jguady If the tools don't work for you I would suggest copying it manually as that shouldn't take longer than 5min...
Adding a reference in VS, newing up the type, then go to definition also displays a stub...
Looks like that dotnet.exe worked. I generated System.Drawing for S.D.Printing PrintingPermission. When I run the build I'm getting
E:\dev\corefx\pkg\frameworkPackage.targets(103,5): error : Assembly 'System.Drawing' is missing dependency 'System.Security.Permissions' [E:\dev\corefx\pkg\Microsoft.Private.CoreFx.NETCoreApp\Microsoft.Private.CoreFx.NETCoreApp.pkgproj]
I looked at the package-projects doc but was unsure if I was in the right place. I was unsure why I didn't see this for the System.Data.Common classes. I'll have another commit you can look at in a moment.
The idea is you paste the stubs in the S.S.Permissions library (not S.Drawing, etc). Maybe throw up a work-in-progress PR so we can see where you're at and help along?