Skip to content
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

Add dependency on System.Xml.Linq #79

Closed
abatishchev opened this issue Mar 12, 2014 · 14 comments
Closed

Add dependency on System.Xml.Linq #79

abatishchev opened this issue Mar 12, 2014 · 14 comments
Assignees
Labels
bug

Comments

@abatishchev
Copy link
Contributor

@abatishchev abatishchev commented Mar 12, 2014

Currently FluentAssertions.dll is tightly dependent on System.Xml.Linq.dll. Its unreferencing causes a compiler error:

The type 'XDocument' is required here and is unavailable. You must add a reference to assembly 'System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

Please consider re-designing to remove such necessity..

@dennisdoomen

This comment has been minimized.

Copy link
Member

@dennisdoomen dennisdoomen commented Mar 12, 2014

That's because it offers specific assertions for XML types. But what's your problem with its dependency?

@abatishchev

This comment has been minimized.

Copy link
Contributor Author

@abatishchev abatishchev commented Mar 12, 2014

I understand the reason.
But my point this is not a usual library design approach. Usually libraries have no such dependency,
I don't have real problem with this but I don't like reference what I don't need because don't use it. Here I don't use XElement assertions but have to reference both System.Xml.dll and System.Xml.Linq.dll still.

@dennisdoomen

This comment has been minimized.

Copy link
Member

@dennisdoomen dennisdoomen commented Mar 12, 2014

But that would mean splitting off the XML stuff into a dedicated assembly. However, I still don't see why this is such a big deal for you. Isn't it just a unit test project? It's not like you're going to ship that project, aren't you?

@comecme

This comment has been minimized.

Copy link

@comecme comecme commented Dec 13, 2019

If FluentAssertions has this dependency, why doesn't the NuGet-package show this as a dependency?

@dennisdoomen

This comment has been minimized.

Copy link
Member

@dennisdoomen dennisdoomen commented Dec 13, 2019

It's something from the past.

@comecme

This comment has been minimized.

Copy link

@comecme comecme commented Dec 13, 2019

What do you mean?

  1. It the need for System.Xml.Linq something from the past?
  2. It the fact that the dependencies is not present in the NuGet package from the past?

I created a new Unit Test Project (.NET Framework) in VS2019, added FluentAssertions, and tried to use it, but I had to manually add System.Xml.Linq using NuGet Package Manager.

Ah, but if I create a new MSTest Test Project (.NET Core) I do not have to ad System.Xml.Linq. I suppose that is what you mean by "something from the past" then.

I think the NuGet package should have a dependency on System.Xml.Linq for its .NETFramework v4.7 and v4.5 targets.

@dennisdoomen

This comment has been minimized.

Copy link
Member

@dennisdoomen dennisdoomen commented Dec 15, 2019

Yeah, you're right. Somehow we lost that dependency.

@dennisdoomen dennisdoomen reopened this Dec 15, 2019
@dennisdoomen dennisdoomen added bug and removed won't fix labels Dec 15, 2019
@comecme

This comment has been minimized.

Copy link

@comecme comecme commented Dec 15, 2019

Thanks for reopening the issue, but technically, the issue I mentioned is not the same as this issue. You still won't remove the dependency on System.Xml.Linq, but you will (re)add it to the package.

@dennisdoomen dennisdoomen changed the title Remove dependency on System.Xml.Linq Add dependency on System.Xml.Linq Dec 17, 2019
@dennisdoomen

This comment has been minimized.

Copy link
Member

@dennisdoomen dennisdoomen commented Dec 17, 2019

You're right @comecme.

@FlavioGoncalves-Cayas

This comment has been minimized.

Copy link

@FlavioGoncalves-Cayas FlavioGoncalves-Cayas commented Dec 20, 2019

Version 5.6.0 seems to be the most recent version, which includes the dependency on System.Xml.Linq. So downgrading is a temporary solution.

@comecme

This comment has been minimized.

Copy link

@comecme comecme commented Dec 20, 2019

I don't understand what you mean. Version 5.6.0 is not the most recent version (5.9.0 is the most recent). Also, version 5.6.0 only has no dependencies for .NETFramework,Version=v4.7.

@jnyrup

This comment has been minimized.

Copy link
Collaborator

@jnyrup jnyrup commented Dec 20, 2019

I'm the offender #1009 .

@julealgon

This comment has been minimized.

Copy link

@julealgon julealgon commented Dec 31, 2019

Noticed this problem while creating a few brand new projects on the full framework. We have this habit of sending a commit for the project creation, and then adding the tests later. Immediately when trying to add the tests, we'd be hit with the requirement to then add System.Xml and System.Xml.Linq.

What's the status on this one?

I tend to agree with @abatishchev and would prefer a separate FluentAssertions.Xml package here, and then remove the dependency on the main one. These libraries should be as clean as possible in regards to their dependencies.

@dennisdoomen dennisdoomen self-assigned this Jan 1, 2020
@dennisdoomen

This comment has been minimized.

Copy link
Member

@dennisdoomen dennisdoomen commented Jan 1, 2020

This has been fixed on master just a minute ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.