This project has moved. For the latest updates, please go here.

.NET 4.0

Apr 13, 2010 at 5:59 PM
Edited Apr 13, 2010 at 8:26 PM

Changes required to WebUtils.cs in order to get this to work under .NET 4.0

 return  (string) _getWebResourceUrlMethod.Invoke(null,
                                                                   new object[]
                                                                       {
                                                                           Assembly.GetAssembly(typeof (T)), resourceName,
                                                                           false, false, null
                                                                       });

Removed the root VirtualPath resolver and 2 extra params added to the method invocation. Wish there was a better way to send emebedded resources down to the client, this internal reflection stuff just smells to me.

Coordinator
May 6, 2010 at 10:34 PM

Thanks for pointing this out, I actually hadn't used this with ASP.NET 4.0 yet.

I fixed the issue and posted a newer version of the MvcMaps Preview 1 release for download.

Also, I know the reflection code using an Internal method within System.Web.dll looks/smells bad, but its the only way to access the resources without rewriting all the internal code that Microsoft wrote to do it. This is one of MANY things within the .NET Framework that I wish were not marked as Internal so we could use them more easily/safely.

Jul 3, 2010 at 3:07 PM
Edited Jul 4, 2010 at 5:06 AM

nevermind...working now.