-
Notifications
You must be signed in to change notification settings - Fork 468
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
Port DictionaryAdapter and tests to .Net Core #119
Conversation
…TER_XML is defined.
…an get rid of the converter shim for CoreClr.
…sing in an Attribute type.
…ects. The file include [ClsCompliant(true)] which causes problem for the netcore project.
@jonorossi I need some help from you on the test failures, especially the first two types of failures. Thanks! |
…of the resource path, while the desktop uses namespace.
…instead of PropertyInfo.ReflectedType which is not available on .Net Core.
…m.Configuration which is not supported on .Net Core.
I tried a hacky way (jeremymeng@0b4687c) to add trace listeners in the code since Fixed Thanks! |
@@ -42,13 +42,19 @@ Symbol | NET35 | NET40 | | |||
----------------------------------- | ------------------ | ------------------ | ------------------ | ------------------ | |||
`FEATURE_APPDOMAIN` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :no_entry_sign: | |||
`FEATURE_ASSEMBLYBUILDER_SAVE` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :no_entry_sign: | |||
`FEATURE_BINDINGLIST` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :no_entry_sign: | |||
`FEATURE_CONFIGURATION` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :no_entry_sign: |
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.
There is already a FEATURE_SYSTEM_CONFIGURATION
symbol.
@jeremymeng could you provide some detail about the missing XML features in .NET Core that DictionaryAdapter is using. |
#if !FEATURE_NETCORE_RESOURCE | ||
new CustomUri("assembly://" + AssemblyName + "/CastleTests.Core.Tests.Resources.MoreRes.TestRes/content1") | ||
#else | ||
new CustomUri("assembly://" + AssemblyName + "/Castle.Core.Tests.Core.Tests.Resources.MoreRes.TestRes/content1") |
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 thought you could set the name of the resource in the project.json file? If not, then I'd prefer we rename the .NET Framework one rather than more conditional compilation.
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 thought you could set the name of the resource in the project.json file?
Yes, named resources are better here. Fixed.
@@ -171,7 +175,8 @@ private object InternalGetAdapter(Type type, IDictionary dictionary, PropertyDes | |||
} | |||
|
|||
#region Type Builders | |||
|
|||
|
|||
#if FEATURE_APPDOMAIN |
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.
Since .NET 4.5 has AssemblyBuilder.DefineDynamicAssembly
and AssemblyBuilder.DefineDynamicModule
this should be FEATURE_LEGACY_REFLECTION_API
instead so we can easily drop the old code once we no longer support pre-.NET4.5. Obviously the same applies to the calling code just above here.
@jonorossi Thanks for the feedback! I will look into it today or tomorrow. |
… method with #if FEATURE_ASSEMBLYBUILDER_SAVE ... #endif.
@jonorossi The change to conditionally compile on |
The major blocker here is the Xslt related stuffs ( |
@jonorossi I've pushed the IDataErrorInfo change. The Xslt dependency seems non-trivial to exclude. Please let me know what you think. |
@jeremymeng thanks for getting the feedback addressed. I've just done another review pass and this is what is left before we can merge:
|
… symbols and using a better exception message.
@jonorossi sounds great! I've pushed the suggested changes. The ClsCompliant issue might be related to the newly introduced XUnit shim. |
Port DictionaryAdapter and tests to .Net Core
Thanks, merged. I think our next step should be getting the build going: Looking at the CLS compliant errors from it seems unrelated to xUnit.net, this is the first compiler warning:
Also the change you made to change the unit tests to using |
@jonorossi Thanks!
This is a different issue than the one in the test project. I believe that both AssemblyInfo.cs files (in Castle.Core and Castle.Core.Tests projects) are generated by the non-CoreClr build so in dnx only build they don't exist yet. One possible solution is to check them in.
I will take a look tomorrow. |
@jeremymeng ah yes you are right, I remember realising that a few weeks back and started looking at how we'd run MSBuild to generate those files before running dnu. They can't be committed because they have the version number in them. |
If the files remain relatively stable (only change when version explicitly being bumped up), IMHO it is not that bad to check them in. |
The problem is they don't remain stable across build configurations, I just mentioned version because it was the easiest to explain. The assembly info changes for each build configuration because it changes description (the build configuration is in there so you know how the assembly you've got was built), and a bunch of other security attributes. If we commit the files then the files cannot ever be generated otherwise it'll show up in Git with unstaged changes pending when you are working on a different build configuration. I'm happy to look at committing it with conditional compilation (i.e. extending our CommonAssemblyInfo.cs) and we get rid of the MSBuild logic. Since this issue is merged, lets start a new issue. |
ah, I now see how the file is generated.
I believe it is only the |
DictionaryAdapter Xml feature and tests are excluded as they depend on Xml features that are not available on .Net Core.
Currently 1 test is failing. They need further investigation to either fix or disable for .Net CoreSome failed due to inaccessible membersTests for dictionary proxy with prefixed keysResource tests failed. One is getting resource strings from .resx, the other is testing an embedded .txt file.AssemblyResourceFactoryTestCase.CreateWithAbsolutePath
PEVerify
.BaseTestCaseTestCase.TearDown_FindsVerificationErrors
App.Config
.Need to find out how to do that for .Net Core.TraceLoggerTests.FallUpToDefaultSource
TraceLoggerTests.FallUpToShorterSourceName
TraceLoggerTests.TracingErrorInformation
TraceLoggerTests.WritingToLoggerByType
@jonorossi