The whole of WordPress compiled to .NET Core
The whole of WordPress compiled to .NET Core and a NuGet Package with PeachPie Why? Because it’s awesome. Sometimes a project comes along that is impossibly ambitious and it works. I’ve blogged a little about Peachpie, the open source PHP compiler that runs PHP under .NET Core. It’s a project hosted at www.peachpie.io.
But…why? Here’s why:
Performance: compiled code is fast and also optimized by the .NET Just-in-Time Compiler for your actual system. Additionally, the .NET performance profiler may be used to resolve bottlenecks. C# Extensibility: plugin functionality can be implemented in a separate C# project and/or PHP plugins may use .NET libraries.
https://www.hanselman.com/blog/TheWholeOfWordPressCompiledToNETCoreAndANuGetPackageWithPeachPie.aspx
How to easily extend your app using MediatR notifications
Probably the biggest question you face as a developer every single day is “where to put your code”? Should you use repositories or query classes? Should you have one class or two to represent your domain object? Should you write a new class or extend an existing one?
In short what constitutes a single responsibility and how separate should your concerns actually be?
MediatR Notifications can help with some of these thorny issues.
jonhilton.net/2016/08/31/how-to-easily-extend-your-app-using-mediatr-notifications/
EPiServer edit and admin not working after upgrade to EPiServer 11.8
I have upgraded a site from EPiServer 7.5 to 11.8.
When deploying the upgraded site to the test environment the edit and admin interface stopped working (the top episerver ui menu visible but lots of js errors and no “main edit window visible” and entire admin mode 404 not found).
The problem was related to some old config for “ProtectedAddons”, i just commented the below config in web.config on test server and the edit and admin mode works again.
(comment out/remove below from web.config)
<!--<virtualPathProviders> <clear /> <add name="ProtectedAddons" virtualPath="~/epi/" physicalPath="[appDataPath]\Modules" type="EPiServer.Web.Hosting.VirtualPathNonUnifiedProvider, EPiServer.Framework.AspNet" /> </virtualPathProviders>-->
Inspiration for the solution came from here: Object reference error in initialization modules
change a .net 4.6.1 project to .net 4.7 failed – Stack Overflow
when I change the targetting from .net 4.6.1 to .net 4.7 . I get this error when build , but there is no project .json , how can I pass this? project cannot compile now. Severity Code Description Project File Line Suppression State Error ` Your project is not referencing the “.NETFramework,Version=v4.7” framework. Add a reference to “.NETFramework,Version=v4.7” in the “frameworks” section of your project.json, and then re-run NuGet restore.
Delete /bin
and /obj
and rebuild your solution.
Source: change a .net 4.6.1 project to .net 4.7 failed – Stack Overflow
Introducing fuget.org – nuget discovery tool
fuget.org – a new site for browsing nuget packages. It is my best attempt to build a tool to help you both discover new packages and to dig in deep to learn them once found.
Extension methods for obtaining ContentReference from LinkItem and Url
(for EPiServer 8+)
…two simplified methods to cover LinkItem and Url:
public static ContentReference ToContentReference(this LinkItem linkItem) { if (linkItem == null) return ContentReference.EmptyReference; var content = UrlResolver.Current.Route(new UrlBuilder(linkItem.Href)); return content != null ? content.ContentLink : ContentReference.EmptyReference; }
And
public static ContentReference ToContentReference(this Url url) { if (url == null) return ContentReference.EmptyReference; var content = UrlResolver.Current.Route(new UrlBuilder(url)); return content != null ? content.ContentLink : ContentReference.EmptyReference; }
Source: Safest method of obtaining ContentReference from LinkItem
EPiServer CMS 11 reset search index url (EPiServe built in search)
(By THACH Lockevn, 1/4/2018 9:46:19 AM) To reset the search index, admin goes to IndexContent.aspx In CMS 11, IndexContent.aspx is included in the new EPiServer.Search.Cms package The URL has changed from /EPiServer/CMS/Admin/IndexContent.aspx to /EPiServer/EPiServer.Search.Cms/IndexContent.aspx
Source: Breaking changes (CMS 11)
asp.net mvc – razor views are not giving compile time error – Stack Overflow
Razor views are dynamically compiled by the ASP.NET runtime. If you want your views to be built at compile-time you could add the following option to your .csproj file:
<PropertyGroup>
<MvcBuildViews>true</MvcBuildViews>
</PropertyGroup>You may take a look at the this article for more details.
Source: asp.net mvc – razor views are not giving compile time error – Stack Overflow