Sunday 15 June 2014

asp.net mvc - Windows Update MS14059 Broke MVC 3 Reference in Class Library Project -



asp.net mvc - Windows Update MS14059 Broke MVC 3 Reference in Class Library Project -

i have open source class library targets mvc 2, 3, 4, , 5. utilize same project file every version , utilize compilation constant switch between project references, follows.

<itemgroup condition=" $(defineconstants.contains('mvc3')) "> <!--<reference include="system.web.mvc, version=3.0.0.1, culture=neutral, publickeytoken=31bf3856ad364e35, processorarchitecture=msil" />--> <reference include="system.web.mvc, version=3.0.0.1, culture=neutral, publickeytoken=31bf3856ad364e35, processorarchitecture=msil"> <private>true</private> <hintpath>..\packages\microsoft.aspnet.mvc.3.0.20105.1\lib\net40\system.web.mvc.dll</hintpath> </reference> <reference include="system.web.razor, version=1.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35, processorarchitecture=msil"> <private>true</private> <hintpath>..\packages\microsoft.aspnet.razor.1.0.20105.408\lib\net40\system.web.razor.dll</hintpath> </reference> <reference include="system.web.webpages.razor, version=1.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35, processorarchitecture=msil"> <private>true</private> <hintpath>..\packages\microsoft.aspnet.webpages.1.0.20105.408\lib\net40\system.web.webpages.razor.dll</hintpath> </reference> </itemgroup> <itemgroup condition=" $(defineconstants.contains('mvc4')) "> <reference include="system.web.mvc, version=4.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35, processorarchitecture=msil"> <private>true</private> <hintpath>..\packages\microsoft.aspnet.mvc.4.0.20710.0\lib\net40\system.web.mvc.dll</hintpath> </reference> <reference include="system.web.razor, version=2.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35, processorarchitecture=msil"> <private>true</private> <hintpath>..\packages\microsoft.aspnet.razor.4.0.20715.0\lib\net40\system.web.razor.dll</hintpath> </reference> <reference include="system.web.webpages.razor, version=2.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35, processorarchitecture=msil"> <private>true</private> <hintpath>..\packages\microsoft.aspnet.webpages.4.0.20710.0\lib\net40\system.web.webpages.razor.dll</hintpath> </reference> </itemgroup>

the mvc 4 references working fine, unable find mvc 3 configuration build on machines without windows update build on machines windows update. since open source project has dozens of developers building it, need provide solution work whether or not update installed.

i have gone through of info on next posts:

windows update caused mvc3 , mvc4 stop working system.web.mvc not functioning expected after windows update asp.net mvc security patch version 3.0.0.1 breaks build http://blogs.msdn.com/b/webdev/archive/2014/10/16/microsoft-asp-net-mvc-security-update-broke-my-build.aspx

as per configuration above, have tried changing gac reference using nuget package. however, doesn't work if seek build on machine doesn't have update installed (including build server, isn't under direct control). using original configuration no longer builds on machine windows update installed. using new gac reference works on machine update installed, not on 1 doesn't have installed.

i tried setting re-create local property, doesn't work right since referencing 4 different versions of mvc - setting true on 1 reference toggles other references off again.

also, general consensus can prepare issue using assembly binding redirects. since project class library no configuration file of own, how accomplish that? searched see if there way redirect bindings via .net attributes, can't seem find useful. dll won't build, , fails similar errors other issues linked above, no set binding redirects web.config file physically located in project. tried adding app.config file project binding redirects mvc 3, didn't work.

<?xml version="1.0" encoding="utf-8" ?> <configuration> <runtime> <assemblybinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentassembly> <assemblyidentity name="system.web.mvc" publickeytoken="31bf3856ad364e35" culture="neutral" /> <bindingredirect oldversion="3.0.0.0-3.0.0.1" newversion="3.0.0.1"/> </dependentassembly> </assemblybinding> </runtime> </configuration>

are there other options not in of above referenced documents can used create class library references mvc 3 compile on machines have windows update ms14059 installed machines don't have installed?

so far, have come solution conditionally include right mvc assembly depending on whether mvc 3.0.0.0 assembly exists in gac.

<!-- due windows update ms14-059, need hack ensure can build mvc3 both on machines have update , don't --> <reference condition=" exists('$(windir)\microsoft.net\assembly\gac_msil\system.web.mvc\v4.0_3.0.0.0__31bf3856ad364e35\system.web.mvc.dll') " include="system.web.mvc, version=3.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35, processorarchitecture=msil" /> <reference condition=" !exists('$(windir)\microsoft.net\assembly\gac_msil\system.web.mvc\v4.0_3.0.0.0__31bf3856ad364e35\system.web.mvc.dll') " include="system.web.mvc, version=3.0.0.1, culture=neutral, publickeytoken=31bf3856ad364e35, processorarchitecture=msil"> <private>true</private> <hintpath>..\packages\microsoft.aspnet.mvc.3.0.20105.1\lib\net40\system.web.mvc.dll</hintpath> </reference>

asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 visual-studio-2012 windows-update

No comments:

Post a Comment