The Fakes Framework in Visual Studio\u00a02012 is the next generation of Moles & Stubs.<\/b> (opens in new tab)<\/span><\/a> Fakes is different from Moles, however, so moving from Moles to Fakes will require some modifications to your code. The Moles framework\u00a0will\u00a0not be supported in Visual Studio 2012.<\/p>\n Replace any .NET method with your own delegate! Watch the video (5min)! (opens in new tab)<\/span><\/a><\/b><\/p>\n Moles <\/b>is a lightweight framework for test stubs and detours in .NET<\/b> that is based on delegates. Moles may be used to detour any .NET method, including non-virtual\/static methods in sealed types. Moles is freely available on Visual Studio Gallery<\/strong> or bundled with Pex (opens in new tab)<\/span><\/a>.<\/p>\n Troubleshooting in .NET 4.5<\/strong><\/p>\n If you install the .NET Framework 4.5 on a machine, Moles will encounter issues when trying to compile.<\/p>\n The main issue happens when Moles tries to generate stubs or moles for types that exist only in .NET 4.5. Currently, the only workaround is to use filters in the .moles file to avoid loading those types (and dependent types if needed).<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":" Moles allows to replace any .NET method with a delegate. Moles supports static or non-virtual methods. Moles works well with Pex. The Fakes Framework in Visual Studio\u00a02012 is the next generation of Moles & Stubs. Fakes is different from Moles, however, so moving from Moles to Fakes will require some modifications to your code. The […]<\/p>\n","protected":false},"featured_media":0,"template":"","meta":{"msr-url-field":"","msr-podcast-episode":"","msrModifiedDate":"","msrModifiedDateEnabled":false,"ep_exclude_from_search":false,"_classifai_error":"","footnotes":""},"research-area":[13560],"msr-locale":[268875],"msr-impact-theme":[],"msr-pillar":[],"class_list":["post-170392","msr-project","type-msr-project","status-publish","hentry","msr-research-area-programming-languages-software-engineering","msr-locale-en_us","msr-archive-status-active"],"msr_project_start":"2010-01-25","related-publications":[159552],"related-downloads":[],"related-videos":[],"related-groups":[],"related-events":[],"related-opportunities":[],"related-posts":[],"related-articles":[],"tab-content":[],"slides":[],"related-researchers":[{"type":"user_nicename","value":"jhalleux","display_name":"Peli de Halleux","author_link":"Peli de Halleux<\/a>","is_active":false,"user_id":32253,"last_first":"de Halleux, Peli","people_section":0,"alias":"jhalleux"}],"msr_research_lab":[199565],"msr_impact_theme":[],"_links":{"self":[{"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-project\/170392","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-project"}],"about":[{"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/types\/msr-project"}],"version-history":[{"count":2,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-project\/170392\/revisions"}],"predecessor-version":[{"id":387923,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-project\/170392\/revisions\/387923"}],"wp:attachment":[{"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/media?parent=170392"}],"wp:term":[{"taxonomy":"msr-research-area","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/research-area?post=170392"},{"taxonomy":"msr-locale","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-locale?post=170392"},{"taxonomy":"msr-impact-theme","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-impact-theme?post=170392"},{"taxonomy":"msr-pillar","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-pillar?post=170392"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}\n
<\/span><\/span><\/p>\n
<\/span>
\nDownload Moles<\/strong> (opens in new tab)<\/span><\/a>! (free)\u00a0<\/strong>Read more documentation (opens in new tab)<\/span><\/a>\u00a0or\u00a0Follow us\u00a0on Facebook (opens in new tab)<\/span><\/a>.<\/p>\n
\n