Posts

Showing posts from February, 2011

PowerShell | Match Partial String

Input: @Display(Model.Header) (Orchard zone btw) Output: Header Solution: $zoneName = [regex]::Replace(".*@Display(Model.Header).*", "@Display\(Model.([A-Za-z]*).*?\)", "`$1") Obs: - ( and ) literals need to be escaped with \ - using (some text) in powershell enables reusing the matched string inside with $1, $2, $3, etc - Should use "`$1" or '$1' - .* removes all text before and after matched string

DNN5 | Use SkinPath not allowed in image tag

When facing ASPNET controls, our attributes are contained within commas, but referencing system variables and html tags together might be a problem. When can solve this by replacing our tag encolures by ascii: Separator="<img src="images/breadcrumb.sep.png" width='11' height='13'>" SkinPath is not needed, since referencing the image this way automcatically adds the path to the current skin installed.

The Project X is under source control

Problem: A project says it is under source control when trying to be opened by Visual Studio, ending up in opening failure: "The project 'OpenXML Power Tools' is under source control. An error occurred registering this project with source control. It is recommended that you do not make any changes to this project." If this error is not fixed, another error appears and opening the project is not possible: "One or more projects in the solution could not be loaded for the folloging reason(s): The application for the project is not allowed. These projects will be labeled as unavailable in Solution Explorer. Expand the project node to show the reason the project could not be loaded." Solution: Edit .csproj/.vbproj file end remove all <scc> occurrences. http://social.msdn.microsoft.com/Forums/en/tfsversioncontrol/thread/01e89840-1e9d-4c5a-8049-e4949c04c609