spring-projects / spring-net

Spring Framework for .NET
http://www.springframework.net
Apache License 2.0
847 stars 375 forks source link

I wish to join this project to help get it going again #144

Open jeffreyschultz opened 6 years ago

jeffreyschultz commented 6 years ago

Like the title says, I would like to join the project and help get development started again. There is still a need for Spring.NET in the .NET ecosystem, and it's a shame to see this wonderful code base collect dust.

I have already forked the repo in GitHub, and am wondering what is the state of things that need to be worked? I have used both Spring.NET and Spring, so I have a bit of familiarity with them, which is good, but I have only recently started to poke around the source code.

Also, who is available to provide guidance on implementation decisions and deal with pull requests? Anyone?

gergroen commented 6 years ago

I am available to contribute. I have used Spring.NET for a while and like it a lot. Maybe we can focus us on the ".NET Core support" #133 And create some documentation on the github wiki. For example a getting started guide with the config in code. Because i think a lot of users create there configuration in xml files instead of in code.

jeffreyschultz commented 6 years ago

At the moment I have included Core, AOP, Web, and Mvc5 into my solution and am attempting to work through a couple minor issues that I have encountered. I am maintaining the existing Spring.NET solution structure by storing it under a folder in my project tree, and am selectively referencing projects into the solution. I think this will go a long way with regards to testing integration with my application, while being able to debug issues that I encounter.

I will also be sure to push changes I make to my fork on GitHub.

Until I can get further direction on things to do this will have to do for now. I think there is a JIRA for this project over at Spring Source, so I will have to take a look at that, too.

sbohlen commented 6 years ago

I can assist in code review, accepting PRs related to the project, etc.

-Steve B.

On Oct 27, 2017 4:40 PM, "Jeffrey Schultz" notifications@github.com wrote:

Reopened #144 https://github.com/spring-projects/spring-net/issues/144.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/spring-projects/spring-net/issues/144#event-1314656777, or mute the thread https://github.com/notifications/unsubscribe-auth/AALX4I-IJZHfZPL_umiHdAUCh4vGOafSks5swj-sgaJpZM4QJfhy .

cptully commented 6 years ago

I am starting a new job at the moment using C#, ASP.Net and IIS. The current website I am responsible for is 8-10 years old and the new version of it will be in Wordpress.

I need to look into whether Spring and Wordpress will work together. If they do or can then it will be in my best interests to help out on this project.

Chris Tully, M.S., Java and .Net Developer and Image Analysis Expert t 240.475.9753 f 419.831.0527 | cptully@gmail.com

Sent from my iPhone please excuse typos.

On Oct 27, 2017, at 4:46 PM, Steve Bohlen notifications@github.com wrote:

I can assist in code review, accepting PRs related to the project, etc.

-Steve B.

On Oct 27, 2017 4:40 PM, "Jeffrey Schultz" notifications@github.com wrote:

Reopened #144 https://github.com/spring-projects/spring-net/issues/144.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/spring-projects/spring-net/issues/144#event-1314656777, or mute the thread https://github.com/notifications/unsubscribe-auth/AALX4I-IJZHfZPL_umiHdAUCh4vGOafSks5swj-sgaJpZM4QJfhy .

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

lahma commented 6 years ago

Maybe I'll try to invest some time too. As I've said earlier I have some branches collecting dust that should be completed in the way forward. At least converting from Rhino.Mocks to FakeItEasy will allow as cleaner road towards .NET Core.

guryanovev commented 6 years ago

Hey this sounds really exciting, "Spring.NET" was a synonym of "best practice" for me for about 10 years and it was a really hard decision to move to another IoC container. But we had to do it as Spring.NET really outdated. It would be great if you guys get project back to life. But if to talk about actual project tasks, Core support is cool, but honestly, there are a lot of other things that should be done to get Spring.NET back to track. For example, XML looks just ridiculous our days, no one would use it. Modern applications register dozens of dependencies and a preferred way is to do it in code (using lambdas) and to do it automatically everywhere, where it's possible. Also, I think supporting of ancient .NET versions is a road to nowhere as even MS abandoned them. I'm saying that because Spring tried to support .NET 1 and 2 for so long blocking usages of 3.5 features in core modules.

jeffreyschultz commented 6 years ago

I am one of those people that’s loves XML. Sorry, but I think XML really has a place in Spring.NET, and I would really like to see more support for generalized XML authoring and consumption.

That being said, any way of configuring a container should be nothing more than a source of configuration definitions. The XML config factory, or fluent configuration, shouldn’t be an intrinsic component of the container. Use what you need and leave the rest behind. As for me, not supporting XML is a no-go.

I think the reason that XML isn’t bigger in the .NET community is because suppor for it is kind of crappy, which means that you end up with crappy implementations that add more of a burden to developers and end consumers. I would like to see this change.

lahma commented 6 years ago

I've used both XML and code configuration and they both have their merits. My Msc work was about product lines and XML played key role when defining readable variation points. Now using CodeConfig mostly to wire things up. XML is not going away and I wonder how the current CodeConfig would not meet requirements. A fee more lines to write compared to some fluent interfaces or auto scanning, I prefer the explicit wiring via CodeConfig, no guesses what is being used.

jeffreyschultz commented 6 years ago

I have used both as well, but I feel that configuration stops being "configuration" once you write it in code. That's kind of the point of external declarative configuration schemes, there is already a lot of code to deal with, so the goal is to have a separate representation of it that is focused on the task at hand, configuration. I feel that Spring.NET provides a pretty good mechanism for accomplishing this, but it still leaves a lot of room for developers to muddle it, hence what everyone has experienced before when dealing with large amounts of declarative configuration. With that said, I do believe that you should have the option to use either, and that they should be able to be used together. There are some parts of applications configuration that I want left internal, which could accomplished by embedded the XML in the assembly, or using code config, but when thinking about it from an end-users perspective, there is some that I want to expose. I think a lot of these mechanisms are for the people that consume our products, rather than the ones that develop using them, even though the developers do benefit from them.

Now, besides the obvious steps that need to be taken to get this project back on track, such as ensuring unit tests correctly represent expected behavior and are passing, and establishing platforms that will be supported in the way forward (and how to better structure the project to support that), I think a little life needs to be injected into some of the public facing parts of this project, such as updating the website to announce a call for contributors, etc. Whatever we can do to wake people up needs to be done.

I also have some ideas for other Spring.NET initiatives. The way that I look at the Java version of Spring is that it provides a foundational framework for structuring your applications, while attempting to smooth over differences that are encountered when using the various application servers that are used, and then providing a lot of integrations using those same concepts that become available to your application out of the box. With Microsoft's divergence from a couple of frameworks for .NET that are pretty much the same in general, to now with several frameworks to choose from, each having their own caveats and restrictions on usage of accepted .NET features, there needs to be some middle ground project that provides a solid base to build off while minimizing effort required by developers to support as many targets as possible. That can be the new niche that Spring.NET aims to fill.

There have been so many new developments in the .NET ecosystem over the past few years that it can make your head spin. Now with the shift in efforts to self-host services within your own process, there could be an initiative to provide guidance and frameworks to support these developers. Spring.NET could become that set of abstractions and default implementations to ensure best practices are present from the beginning. I personally love OSGi and Apache Karaf, and would like to see something like those available for .NET. Yes, I know there are some aspects of .NET that make OSGi for .NET not completely feasible, but you could capitalize on the benefits while accounting for limitations in the platform.

Also, I think a few of things are extremely critical for the longevity of the project (those will be described later), and one of them is Project Alliances. Spring.NET should position itself as an integration platform where developers can opt-out of default implementations to integrate another project's implementation. Spring.NET should be more than just an IoC/DI framework. Yes, I know there are other projects, but the focal point has always been the container for me.

I think we should also evaluate where the Java Spring project has gone in relation to where Spring.NET currently is, and see if there is anything else that could be taken from that set of projects.

I am serious about this, and I hope that anyone interested in being a part of this would join me.

jeffreyschultz commented 6 years ago

I would also like to help move the .NET community towards an old idea, but what I think could be a new paradigm for .NET.

Composition is Configuration

Pretty self explanatory, but it shifts the perspective of how application configuration is handled. It should not be an after thought where classes grab needed values from AppSettings (ick!). An objects configuration should be a definition of that class for a particular instance, and that is addressed with composition.

jeffreyschultz commented 6 years ago

It looks like there is a lot of good stuff in JIRA, along with some Futures tasks. Are these still valid?

https://jira.spring.io/browse/SPRNET/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel

Is JIRA available for us to use? Or have ties been severed? I am not really sure how the current Spring.NET projects tie in with the original project that used to be available from the Spring Source site.

jeffreyschultz commented 6 years ago

As for porting to other platforms, would it be a better bet to aim for the .NET Standard targets, rather than .NET Core itself?

As an update, I have found a few issues while developing my prototypes for a new project we are working on at work, and will be creating corresponding issues to be worked. I have also updated my GitHub profile to show my email address, so that anybody interested can contact me directly and assist.

I think there is another effort to port to the .NET Standard 2.0 platform, called Summer, so I will also be reaching out to that developer in an attempt to combine our efforts if they are still interested.

luizcarlosfaria commented 6 years ago

Hi guys,

i've working with spring.net since ~2007/2008 and a really appreciate this project. It's help-me do to more, and about that i have some special feelings about this projetct.

What i did

At september 26 i've started a independently and unpretentious port of Spring.Core and Spring.AOP to .NET Standard. This port is a success, i'm working with this port on production, using misc of code and xml configuration, AOP and some daily features as well.

The port that i did is based on 4 solid steps:

1 - New Projects

Create a new projects based on .NET Standard 2.0, copying all code files to new project mantaining the assembly name, namespaces.

2 - Switch and Adapt

Addind nuget packages for known dependencies and creating a fake classes to replace some behavior that not portable, like Common.Logging and System.Runtime.Remoting and System.Runtime.Remoting.Messaging. These fake classes was created to garantee that i don't add a new issues or mistakes during remove your utilization, instead that, i create a fake implementations to maintain codebase intact. The only not ported thing is registry32, that was removed.

3 - Tests

The third step is make tests working. About first and second step, i'm talking exclusively about the Spring.Core and Spring.AOP projects, without your test projects. At third step and this is a most dificult on this port, is make tests working fine and Rhino.Mocks has maked it mor dificult. I really had some dificults to mantain same contract, wrapping other framework to do that using NSubstitute. But, on my work plan, i'm still here.

4 - Growing up

The last continuous step is make this project live! But, it's depend of have or not this talk. I'm waiting for that. I really don't planed create any fork, the mindset behind this work is prove that can be done. And if i'm done, and was done, that i can use on my projects, until the official version was released. If this talk was not exists, i'will think about the for in a few months or never, it's depends.

what i will do

If anybody ask me about work on this project. My answer is yes! i Will be glad to contribute! I'm in!

jeffreyschultz commented 6 years ago

@luizcarlosfaria Wonderful!

I got excited when I saw that I had a new GitHub notification.

I would certainly appreciate your help in getting this going. Perhaps, we can start taking a look at the changes you made to get the core projects onto .NET Standard 2.0, and then create a new branch for this work that only contains the source code for those projects that are being migrated to .NET Standard 2.0. This way we can selectively bring over projects as their dependencies become available, leading to an eventual merge back into master. I prefer the Git Flow methodology, but the current repo isn't setup for it. I don't know what I was thinking, but the repo is already structured for it.

Did you work out of your GitHub repo so that all commits are available, instead of one dump to GitHub? It would be great if we had diffs against the individual files to be able to see each and every change.

jeffreyschultz commented 6 years ago

I wasn't sure doubted that we would be given committer access to this repository, so I went ahead and created a new organization with a fork of spring-net:master. I have already invited several people from this thread, but if you didn't get an invite and are interested in contributing be sure to let me know. You can either reply to this thread or drop me a line.

Eventually, once we have a stable team structure, we can move to the pull-request model of contributing. I just wanted to make sure that a number of people were included from the start. If things change or issues pop up, we can adjust to address it.

The organization is spring-net-futures.

luizcarlosfaria commented 6 years ago

Great @jeffreyschultz !

Sorry, i've talk so much but "where's the code?"

https://github.com/luizcarlosfaria/summer-net

This name is a joke! Ok?! don't judge me about that!

jeffreyschultz commented 6 years ago

Summer makes sense, since Summer is after Spring, but I intend to stick with the Spring name for historical purposes, since this isn't a true fork of the project and just a continuation that hopefully will be merged back into this repository.

https://github.com/spring-net-futures/spring-net

jeffreyschultz commented 6 years ago

Also, just so that everyone knows, we will be using the Git Flow methodology. That means that you do not directly work in master or develop, but that you create feature branches that will be merged into develop, and eventually develop into master.

This important as we should be establishing a baseline to work against.

luizcarlosfaria commented 6 years ago

GitFlow is a standard, it's ok for me. I'm really care about maintain a unique and large repository with core and subprojects. I really think that can be splitted in (git) submodules.

jeffreyschultz commented 6 years ago

Yeah, I like using git modules, too. I was contemplating doing this as well at some point, but wanted to talk it over with the team first. It has my vote.

ynauls commented 6 years ago

@jeffreyschultz , I can assist too. My current need is upgrading the current 2.0 release to NHibernate 5. After that, I can continue supporting this effort.

Salgat commented 6 years ago

Would love to see this support .NET Standard. It's one of the only dependencies left holding us back.

luizcarlosfaria commented 6 years ago

@Salgat, In my tests, only default configuration model (using app.config or web.config) stay broken. XML and Code configurations still working fine, side-by-side, nested contexts are working fine too. The port of core and aop projects are very simple, but port of test projects still need a lot workhours.

jeffreyschultz commented 6 years ago

I have been playing around with Spring.NET under Mono and majority of the tests throw a fault when executing. I am still looking into the issue, and am considering just doing this work on Windows. It might be too much to try and develop from another platform while trying to port it to .NET Standard 2.0.

jeffreyschultz commented 6 years ago

I have migrated the Core project to netstandard 2.0 as a test and have been looking through your project, @luizcarlosfaria. I am exploring the possibility of creating a Spring.Logging namespace that defines an container-level ILogger interface to be used and managed by the container. It would be available to Spring.NET consumers as well, and would provide an abstraction to develop against, while allowing for developers to configure logging implementations. I would like to eliminate as many external dependencies as possible.

jeffreyschultz commented 6 years ago

I had to revert some changes because I had ran a Resharper Clean Code against the entire solution, and it really made it hard to tell what had changed in the diffs because it moved things around. Too many file changes for this task to properly track what is going on, so I reverted my initial commit in hopes to make the future pull request more easily accepted. So I backed out those changes, and made the changes to Spring.Core again to get it to compile on .NET Standard 2.0.

https://github.com/spring-net-futures/spring-net/commits/feature/netstandard-2.0

jeffreyschultz commented 6 years ago

I just committed changes to Spring.Aop to get it to compile with .NET Standard 2.0.

At this point, I really don't know if the code works, just that it compiles. I have also broken the build configuration where it used to copy files to certain folders, and now only produces the artifacts under the project folder, so this will need to be revisited when looking to merge changes back into original repository. There is also the potential for us to handle builds differently... really don't know at this point.

What is a good build system to use for .NET these days? I would really like a maven or gradle alternative for .NET with good dependency management where a local repo is maintained with build artifacts from recent builds so that these projects could easily be split up and developed separately instead of being tied to a single solution. Does anything like that exist for .NET yet? Nuget doesn't really hit the mark, and I don't see it as a viable dependency management tool, and is more like an "app store" for released libraries--what about a nightly build that was just ran and not yet uploaded to Nuget? I have some ideas for a new build system that would accomplish this for .NET that I have dubbed "mason", but haven't begun any work on it other than the name.

luizcarlosfaria commented 6 years ago

1) @jeffreyschultz , i think that create a Spring.Logging is a good idea, maybe Spring.Logging.Internal to explain that is not for external implementations is about infrastructure of project.

2) These changes made using Resharper will be helpfull, but until a full port of a test projects it can put unknow bugs. When i decide split the work in 4 big steps, the mindset behind these steps is, doesn't change anything that i not need change now. It's a garantee about mantainence and rastreability.

3) About build system, the old fashion msbuild is incorporated on dotnet cli, and nuget still the big project about dependencies on .net. In regards, we have some others support tools. Nightly builds repo is addressed by myget, proget (inedo) and others. One of most interesting features on this case, that can just point to night build endpoint and work side-by-side.

I think that we have decisions to make, and my first tradoff is solved looking around asp.net core, .net core and some open source projects designed for the community today. They have myget, still using nuget, runnig under jenkins... some big annd simple deals.

jeffreyschultz commented 6 years ago

I just committed changes to Spring.Data to migrate the project to .NET Standard 2.0.

I had to comment out the Enterpise Service related code to get it to compile. I assume we will be creating new projects that target .NET Framework to allow use of these features that aren't available in .NET Standard.

jeffreyschultz commented 6 years ago

I just committed changes to Spring.Core.Tests to get it to compile against the changes made to Spring.Core, Spring.Data, and Spring.Aop. Of course, I had to comment out some tests that used features no longer in Spring.Core, such as Registry Key, Enterprise Service, and RGB related code.

The tests are reporting as inconclusive at this time, but I am fairly confident that I should have them up and running shortly.

Here are some other notable changes to the Spring.Core.Tests project.

Salgat commented 6 years ago

@jeffreyschultz I would go ahead and update it to .NET Framework 4.7.1 since that can target .NET Standard 2.0. Visual Studio 2017 version 15.5 will support it out of the box but for now you can install it through https://www.microsoft.com/en-us/download/details.aspx?id=56119

jeffreyschultz commented 6 years ago

I have been working in a world where I go back and forth between Java, C#, and C++ and am not up on all of the latest .NET technologies, but if what you say is true then it does sound like .NET Framework 4.7.1 would be a better target.

I will go ahead and update to .NET Framework 4.7.1. I upgraded to 4.7 because I wasn't able to reference a .NET Standard 2.0 assembly with anything less than 4.6 (IIRC).

I am having issues with the unit tests. None of them will run regardless of what they touch. I am not sure what is wrong. They all report as "Inconclusive: Test Not Run". The unit tests I have been playing around with have no base class, and even an empty Test I created wont' run. Any ideas?

jeffreyschultz commented 6 years ago

I hate how Resharper's unit test UI tends to hide errors that were thrown during attempted executions of unit tests.

Here is my issue.

2017.11.06 19:26:42.207   ERROR System.IO.FileNotFoundException: Could not load file or assembly 'nunit.framework' or one of its dependencies. The system cannot find the file specified.
System.IO.FileNotFoundException: Could not load file or assembly 'nunit.framework' or one of its dependencies. The system cannot find the file specified.
File name: 'nunit.framework'
   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Activator.CreateInstance(String assemblyString, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo)
   at System.AppDomain.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityAttributes)
   at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityAttributes)
   at NUnit.Engine.Drivers.NUnit3FrameworkDriver.Load(String testAssemblyPath, IDictionary`2 settings)
   at NUnit.Engine.Runners.DirectTestRunner.LoadPackage()
   at NUnit.Engine.Runners.AbstractTestRunner.Load()
   at NUnit.Engine.Runners.MasterTestRunner.LoadPackage()
   at NUnit.Engine.Runners.AbstractTestRunner.EnsurePackageIsLoaded()
   at NUnit.Engine.Runners.MasterTestRunner.NUnit.Engine.ITestRunner.Explore(TestFilter filter)
   at JetBrains.ReSharper.UnitTestRunner.nUnit30.BuiltInNUnitRunner.<>c__DisplayClass1.<RunTests>b__0()
   at JetBrains.ReSharper.UnitTestRunner.nUnit30.BuiltInNUnitRunner.WithExtensiveErrorHandling(IRemoteTaskServer server, Action action)

=== Pre-bind state information ===
LOG: DisplayName = nunit.framework
 (Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: nunit.framework | Domain ID: 2
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/Source/spring-net-futures/spring-net/build/VS.Net.2010/Spring.Core.Tests/Debug
LOG: Initial PrivatePath = NULL
Calling assembly : nunit.engine, Version=3.0.5797.27553, Culture=neutral, PublicKeyToken=2638cd05610744eb.
===
LOG: This bind starts in LoadFrom load context.
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
LOG: Using application configuration file: C:\Source\spring-net-futures\spring-net\build\VS.Net.2010\Spring.Core.Tests\Debug\Spring.Core.Tests.dll.config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Source/spring-net-futures/spring-net/build/VS.Net.2010/Spring.Core.Tests/Debug/nunit.framework.DLL.
LOG: Using application configuration file: C:\Source\spring-net-futures\spring-net\build\VS.Net.2010\Spring.Core.Tests\Debug\Spring.Core.Tests.dll.config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Redirect found in application configuration file: 3.8.1.0 redirected to 3.5.0.0.
LOG: Post-policy reference: nunit.framework, Version=3.5.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb
LOG: Attempting download of new URL file:///C:/Source/spring-net-futures/spring-net/build/VS.Net.2010/Spring.Core.Tests/Debug/nunit.framework.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Minor Version
LOG: Attempting download of new URL file:///C:/Source/spring-net-futures/spring-net/build/VS.Net.2010/Spring.Core.Tests/Debug/nunit.framework/nunit.framework.DLL.
LOG: Attempting download of new URL file:///C:/Source/spring-net-futures/spring-net/build/VS.Net.2010/Spring.Core.Tests/Debug/nunit.framework.EXE.
LOG: Attempting download of new URL file:///C:/Source/spring-net-futures/spring-net/build/VS.Net.2010/Spring.Core.Tests/Debug/nunit.framework/nunit.framework.EXE.
LOG: Attempting download of new URL file:///C:/Users/jeffrey.l.schultz/AppData/Local/JetBrains/Installations/ReSharperPlatformVs15_617f1b60/nunit3/nunit.framework.DLL.
LOG: Attempting download of new URL file:///C:/Users/jeffrey.l.schultz/AppData/Local/JetBrains/Installations/ReSharperPlatformVs15_617f1b60/nunit3/nunit.framework/nunit.framework.DLL.
LOG: Attempting download of new URL file:///C:/Users/jeffrey.l.schultz/AppData/Local/JetBrains/Installations/ReSharperPlatformVs15_617f1b60/nunit3/nunit.framework.EXE.
LOG: Attempting download of new URL file:///C:/Users/jeffrey.l.schultz/AppData/Local/JetBrains/Installations/ReSharperPlatformVs15_617f1b60/nunit3/nunit.framework/nunit.framework.EXE.
jeffreyschultz commented 6 years ago

When I upgrade to .NET Framework 4.7.1 I get the following error in the source code. It seems to want me to add a reference to netstandard 2.0.0, but it doesn't seem to be available in the Add Reference dialog. Is this referring to the .NET Standard nuget package?

CS0012 C# The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly.

Salgat commented 6 years ago

I ran the .NET Portability Analyzer against Spring.Core and am curious about some of the portability issues. For example, the use of the Microsoft.VisualBasic namespace (OpLike.cs) and System.Runtime.Remoting (ApplicationContextAwareProcessor.cs etc). Fortunately there aren't too many instances of this, but it's important to remember that the .NET Core/.NET Standard targeting libraries do not reference .NET Framework dlls. You can do this, but it defeats the point. You'll see a warning similar to this.

jeffreyschultz commented 6 years ago

The dependent code from Microsoft.VisualBasic on GitHub has been translated to C# and made part of that class that was using it, so that reference is now gone. My intention is to have as few dependencies as possible, and is the reason why I have introduced Spring.Logging, to eliminate the dependency on Common.Logging.

The other stuff that requires .NET Framework has been commented out, and will be moved to a feature specific assembly eventually.

You should check out my netstandard-2.0 branch.

jeffreyschultz commented 6 years ago

I just committed changes to upgrade Spring.Core.Tests to .NET Framework 4.7.1.

I am starting work on resolving the unit tests issue.

jeffreyschultz commented 6 years ago

I ended up creating a new Unit Testing against .NET Framework 4.7.1 with NUnit 3.8.1 and ensured that the tests would run, and they did. I then copied over the references and files from Spring.Core.Tests and got it to compile. I initially had issues matching up IConfigurationHandler types between the .NET Standard 2.0 and .NET Framework 4.7.1, but finally figured it out.

I got a new error from running the unit tests this time, and it is security related. I need to look into security critical types, so I have a bit more reading to do.

2017.11.07 10:06:52.382   ERROR Cannot run tests: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
  ----> Method 'Spring.Objects.Factory.Attributes.QualifierAttribute.Equals(System.Object)' is security transparent, but is a member of a security critical type.
  ----> Method 'Spring.Validation.BaseValidator.Validate(System.Object, Spring.Validation.IValidationErrors)' is security transparent, but is a member of a security critical type.
  ----> Method 'Spring.Validation.BaseValidator.Validate(System.Object, Spring.Validation.IValidationErrors)' is security transparent, but is a member of a security critical type.
  ----> Method 'Spring.Validation.BaseValidator.Validate(System.Object, Spring.Validation.IValidationErrors)' is security transparent, but is a member of a security critical type.
  ----> Method 'Spring.Validation.BaseValidator.Validate(System.Object, Spring.Validation.IValidationErrors)' is security transparent, but is a member of a security critical type.
  ----> Method 'Spring.Objects.Factory.Attributes.QualifierAttribute.Equals(System.Object)' is security transparent, but is a member of a security critical type.
  ----> Method 'Spring.Core.ComposedCriteria.IsSatisfied(System.Object)' is security transparent, but is a member of a security critical type.
  ----> Method 'Spring.Core.IO.ConfigurableResourceLoader.GetResource(System.String)' is security transparent, but is a member of a security critical type.
  ----> Method 'Spring.Context.Support.AbstractMessageSource.get_ParentMessageSource()' is security transparent, but is a member of a security critical type.
  ----> Method 'Spring.Objects.Factory.Xml.AbstractObjectDefinitionParser.ParseElement(System.Xml.XmlElement, Spring.Objects.Factory.Xml.ParserContext)' is security transparent, but is a member of a security critical type.
  ----> Method 'Spring.Threading.Semaphore.Release()' is security transparent, but is a member of a security critical type.
  ----> Method 'Spring.Objects.Support.AbstractSharedStateFactory.GetSharedStateFor(System.Object, System.String)' is security transparent, but is a member of a security critical type.
  ----> Method 'Spring.Objects.Factory.Support.AbstractObjectDefinitionReader.get_Registry()' is security transparent, but is a member of a security critical type.
  ----> Method 'Spring.Objects.Factory.Config.AbstractFactoryObject.get_IsSingleton()' is security transparent, but is a member of a security critical type.
  ----> Method 'Spring.Collections.Set.Union(Spring.Collections.ISet)' is security transparent, but is a member of a security critical type.
  ----> Method 'Spring.Globalization.Formatters.FilteringFormatter.Parse(System.String)' is security transparent, but is a member of a security critical type.
  ----> Method 'Spring.Expressions.Parser.antlr.BaseAST.addChild(Spring.Expressions.Parser.antlr.collections.AST)' is security transparent, but is a member of a security critical type.
  ----> Method 'Spring.Context.Support.ApplicationObjectSupport.set_ApplicationContext(Spring.Context.IApplicationContext)' is security transparent, but is a member of a security critical type.
  ----> Method 'Spring.Context.Support.ApplicationObjectSupport.set_ApplicationContext(Spring.Context.IApplicationContext)' is security transparent, but is a member of a security critical type.
  ----> Method 'Spring.Context.Attributes.AssemblyTypeScanner.AssemblyHavingType()' is security transparent, but is a member of a security critical type.
  ----> Method 'Spring.Collections.AbstractQueue.Add(System.Object)' is security transparent, but is a member of a security critical type.
  ----> Method 'Spring.Collections.AbstractQueue.Add(System.Object)' is security transparent, but is a member of a security critical type.
  ----> Method 'Spring.Caching.AbstractCache.get_Count()' is security transparent, but is a member of a security critical type.
jeffreyschultz commented 6 years ago

Taking the first issue, QualifierAttribute.Equals(), I can't seem to figure out why it thinks that function is a member of a security critical type. Looking at the definition in the Microsoft Docs, it doesn't mention anything about security regarding Equals(), or any of the other members.

        /// <summary>
        /// Checks weather the attribute is the same
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>       
        public override bool Equals(object obj)
        {
            if (obj == null || GetType() != obj.GetType())
            {
                return false;
            }

            var o1 = obj as QualifierAttribute;
            if (_value != o1._value) return false;

            return true;
        }

I have tried adding every Security attribute that I can find to this method trying to get it to work, but so far, nothing has been able to get rid of this error.

What is the issue with this code?

jeffreyschultz commented 6 years ago

I ended up taking a look around the Spring.Core project and found that it had some CAS security attributes applied to the Assembly that were causing these issues. I commented them out for the time being until I can figure out how this needs to be addressed, properly.

The unit tests are now running, but most are failing. I think this is because I commented out the build step commands to copy XML files to the output directory.

The changes have been committed to spring-net-futures/spring-net.

jeffreyschultz commented 6 years ago

Haha, I found the reason for so many failing tests was because of my Spring.Logging implementation. Every logging method throws NotImplementedException.

I think it's time to start working on Spring.Logging and get something usable. Spring.Logging is a namespace under the Spring.Core project, and is intended to be an integration layer for using other logging frameworks. The only concrete logging implementation that should be provided is a debug or console appender.

Does anybody want to contribute some ideas for a Spring.Logging facade design?

Salgat commented 6 years ago

I just wanted to say excellent progress @jeffreyschultz! While I don't have the time to contribute now, I'm following along with your updates.

jeffreyschultz commented 6 years ago

Thanks, @Salgat!

jeffreyschultz commented 6 years ago

One question I have is why a custom build step to copy over needed test data was used instead of marking the Data directory to be copied to the output.

Is there an advantage to this? This build step makes it platform dependent, too, where it uses shell specific copy commands. In this case, it uses xcopy. I would think having the build tool copy it over for you would be preferable.

jeffreyschultz commented 6 years ago

I didn't get too far today, wasn't feeling well. I have been investigating some discrepancies between the Spring.Core.Tests unit tests passing before and after migrating to .NET Standard 2.0. Some of the issues are obvious, and are related to some functionality that was removed, but other things are just weird.

There is this one test under AbstractObjectFactoryTests.cs called GetObjectIsThreadSafe() that takes a long time to complete, and even freezes Visual Studio 2017 during its run time. I changed the number of tasks that it spins off from 4 to 2, and it took about 2 minutes to complete. Otherwise, previously under .NET 4.0 it was running pretty quickly. I was originally trying it with 4 tasks, and it never seemed to return.

luizcarlosfaria commented 6 years ago

I have a advice about xcopy and windows dependencies: We need break that.

Exclusive references to .NET Framework, conditional compilations, all about that must be removed. The explain is simples. .NET has moved to make a standard, the .NET Standard, implemented by all kind of runtimes (latest versions, obviously).

The way to make this journey acceptable is looking to the future. Create new versions with compatibility with 2.0, or 4.0 is a crazy idea. We need to make compatibility with .NET Standard 2.0, 2.1 (will be released until second quarter at next year) and no more. Adopt .net standard, automatically make this project cross platform, with large compatible with:

Some decisions somebody must be taken.

Salgat commented 6 years ago

Agreed @luizcarlosfaria The best route to take is to focus on .NET Standard 2.0 (and any dependencies that fit that target). Once that is hit, we can look at lower .NET Standard versions (such as 1.3) but otherwise hitting the Standard fulfills all the goals of this move forward and gives people a migration path from .NET Framework to .NET Core (since both can use .NET Standard dependencies).

luizcarlosfaria commented 6 years ago

@Salgat About other versions of .NET Standard i have some bad news: Only 2.0 regards features required to start this journey, before that, many and all kind of replacements was necessary, is more productive restart from scratch. The api surface around .NET Core and .NET Standard 2.0 makes this work viable.

jeffreyschultz commented 6 years ago

And it seems that we want to target .NET Framework 4.7.1 for any .NET Framework-dependent class libraries. I do know that there was a difference when going from 4.7 and 4.7.1, where I suddenly had issues with resolving classes like System.Object, so something drastically changed with 4.7.1. The question I have is how does 4.7 work with the changes I made to Spring.NET for 4.7.1.

I will have to create a test project and link it against my latest Spring.NET working copy.

As an update, I have found that I was a bit too liberal in commenting out code and accidentally commented out code needed to auto-inject into IApplicationContextAware objects, which was causing some tests to fail. I am so grateful that so many unit tests have been written for Spring.NET.

jeffreyschultz commented 6 years ago

Only 10 tests not passing at this point, and they aren't really an issue at this time. A couple more could probably be ignored too, since .NET Standard 2.0, from what I have read, doesn't acknowledge CAS attribute, so Medium trust tests aren't really necessary in that part of the code base anymore.

spring core tests unit test results

I am going to move onto the Aop unit test project now.