Skip to content

Conversation

@SvenAelterman
Copy link

I've mainly updated the references to the latest stable versions of everything.
I've also done a few things with Code Analysis to address or suppress rules.

I am open to your feedback and modifications to my PR.

If you're still maintaining this project, I'd appreciate the merge and a release of an updated NuGet package? Thanks!

Updating from fork's origin
Add exclusion for .vs/ folder
Add stylecop.json and remove exclusion from .gitignore
Add GlobalSuppression file to suppress documentation rule
<Reference Include="System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll</HintPath>
<Private>True</Private>
<Reference Include="System.Web.Mvc, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to not reference an explicit version here? So it'll work regardless of what version is actually installed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking into it. I am not familiar enough with the possible reference styles to answer that question. The other consideration is that even if Visual Studio will be able to locate the reference, when it builds, it's might still bind to the specific version located at compile time.

This SO answer seems to support my thinking: https://stackoverflow.com/questions/24022134/how-exactly-does-the-specific-version-property-of-an-assembly-reference-work-i, but I have not tested it myself.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually it's best for a library to use the lowest possible version of it's dependencies and mark the dependency with <SpecificVersion>False</SpecificVersion> (as described in the SO answer @SvenAelterman refers to). So maybe it's better to downgrade to 5.0.0 (basically what @ivaylokenov did in this commit f56c657#diff-64f0574f3b8754e57f68807d79fc91a8). About the green squiggly that's mentioned in issue #21: targeting 5.0.0 MVC and 3.0.0 Razor + WebPages packages doesn't generate it - tested it locally. The detailed build log shows that the 5.2.7 version of MVC is used:

1>  Unified primary reference "System.Web.Mvc, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35".
1>      Using this version instead of original version "5.0.0.0" in "<BASE-PATH>\My-ASP.NET-MVC-Lambda-Expression-Helpers\System.Web.Mvc.Expressions\bin\Release\System.Web.Mvc.Expressions.dll" because of a binding redirect entry in the file "Web.config".

{
private const string ControllerSuffix = "Controller";

#pragma warning disable SA1306
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to make these static readonly instead of suppressing the rule.

}
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We would prefer having a blank line at the end of the file.

// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.

[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:Elements should be documented", Justification = "<Pending>", Scope = "type", Target = "~T:System.Web.Mvc.Expressions.Internals.MvcExtensions")] No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be more consistent and better to just add the suppressed rule here: https://github.com/ivaylokenov/ASP.NET-MVC-Lambda-Expression-Helpers/blob/master/System.Web.Mvc.Expressions/System.Web.Mvc.Expressions.ruleset. This way we won't have a new file that needs to be compiled on each project build.

<Reference Include="System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll</HintPath>
<Private>True</Private>
<Reference Include="System.Web.Mvc, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually it's best for a library to use the lowest possible version of it's dependencies and mark the dependency with <SpecificVersion>False</SpecificVersion> (as described in the SO answer @SvenAelterman refers to). So maybe it's better to downgrade to 5.0.0 (basically what @ivaylokenov did in this commit f56c657#diff-64f0574f3b8754e57f68807d79fc91a8). About the green squiggly that's mentioned in issue #21: targeting 5.0.0 MVC and 3.0.0 Razor + WebPages packages doesn't generate it - tested it locally. The detailed build log shows that the 5.2.7 version of MVC is used:

1>  Unified primary reference "System.Web.Mvc, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35".
1>      Using this version instead of original version "5.0.0.0" in "<BASE-PATH>\My-ASP.NET-MVC-Lambda-Expression-Helpers\System.Web.Mvc.Expressions\bin\Release\System.Web.Mvc.Expressions.dll" because of a binding redirect entry in the file "Web.config".

@xantari
Copy link

xantari commented Jul 8, 2020

Why hasn't this been merged in yet?

@SvenAelterman
Copy link
Author

I haven't had a chance to update the PR yet as requested by the maintainers. I know it needs to be done though.

@vladislav-karamfilov
Copy link
Contributor

I haven't had a chance to update the PR yet as requested by the maintainers. I know it needs to be done though.

Hey, @SvenAelterman . If you are OK, I can make some time during the weekend to address all PR comments so we can close this PR and release a new version.

@SvenAelterman
Copy link
Author

@vladislav-karamfilov Yes, please make the modifications as you see fit.

@vladislav-karamfilov
Copy link
Contributor

@vladislav-karamfilov Yes, please make the modifications as you see fit.

Hey, @SvenAelterman! I finally had the time to address the CR comments. I opened a PR (Sorrell-Solutions#2) to your fork's master and when you merge it, we'll be finally able to merge this PR and release a new NuGet package version. Thank you! :)

Addressed code review comments of PR "Updating references to NuGet packages"
@CLAassistant
Copy link

CLAassistant commented Sep 27, 2020

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
0 out of 2 committers have signed the CLA.

❌ SvenAelterman
❌ vladislav-karamfilov
You have signed the CLA already but the status is still pending? Let us recheck it.

@SvenAelterman
Copy link
Author

@vladislav-karamfilov I've just approved your PR into my forked repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants