Looks like the latest Microsoft "innovations" are aimed at preventing the Microsoft developers from moving to node.js and other popular web technologies. ASP.Net 5 even sacrificed Web Forms to create a framework that is very similar to node.js or other modern web framework. But they forget that developers are loyal to Microsoft mostly because of the excellent development experience. Within the latest years we ovserve deteriorating design surface experience in Microsoft web technologies, the void the component vendors are not able to fill. They are risking losing more developers than gaining...
End of rant.
Thursday, February 12, 2015
Thursday, January 15, 2015
SharePoints bails out if more than 10,000 search results.
Toy (but expensive!!!) search engine called FAST Search for SharePoint 2010 bails out if using wildcards and it decided that the query may return more than 10,000 results...
Good article about how to increase the limit.
Good article about how to increase the limit.
Tuesday, January 13, 2015
Change recovery model to Simple for all databases
Import-Module SQLServer
Get-SqlDatabase -sqlserver . | ? {$_.RecoveryModel -eq [Microsoft.SqlServer.Management.Smo.RecoveryModel]::Full } | % { $_.RecoveryModel = [Microsoft.SqlServer.Management.Smo.RecoveryModel]::Simple ; $_.Alter() }
Get-SqlDatabase -sqlserver . | ? {$_.RecoveryModel -eq [Microsoft.SqlServer.Management.Smo.RecoveryModel]::Full } | % { $_.RecoveryModel = [Microsoft.SqlServer.Management.Smo.RecoveryModel]::Simple ; $_.Alter() }
Tuesday, October 21, 2014
MSDN Magazine and me
I used to read from the MSDN magazine from cover to cover, but now I noticed I read one or two articles only skipping the rest of them. This is the sad truth about my skills and experience: I am no longer on the bleeding edge... Let's take a look:
- C++ - The last time I was writing C++ was 15 years ago. Plus I always disliked Microsoft C++
- Windows metro-style apps: Just not interested. The dev model will be tweaked a lot in the next couple of years. Plus that's not what I am doing right now.
- Entity Framework: good implementation of ORM. However for several years now I am not enthusiastic about ORM and DDD, because in my opinion they represent another cache with all issues of managing and trying to keep it in sync with database. This would make sense for desktop apps, but Microsoft decided to disallow using EF from Metro apps. So my interest in EF decreased even more
- ASP.net MVC: I was always excited about this, but did not actually use it for any production code because we are stuck with SharePoint 2010, which means Web Forms. I think it is also going through transition to make it fully asynchronous. At that point I would seriously consider it.
- Did I mention WinJS? Poorly designed. Waiting for its replacement, perhaps based in Node and Angular, something along of the lines with Ionic.
- SharePoint 2013. Not using it now, will probably upgrade in several months. Not thrilled about the app model. I always knew that SharePoint hates developers, but I always hoped that the future version of SharePoint will hate developers less. Not so. It will probably die hating developers even more...
- Cloud. I am not in the cloud yet. Azure is confusing with a sheer volume of products available on it. It changing every week, so it I take a Pluralsight course on Azure it will probably be already outdated. For this reason I usually skip all articles about Azure: it will all change a month from now, so why bother?
- TypeScript: waiting when async/await will be implemented. Before that I would recommend Traceur that does have that capabilities. There is one feature of TypeScript that I like: ability to specify weak contracts. If my function is getting an object, I don't care that it is of the type Person. All I care that it has a method with an expected signature (firstName(): string for example).
- Big Data. "Hey we got these terabytes and terabytes of data? What do we do now?" "Press Delete button"
- JavaScript
- node
- OWIN and Katana - these have potential of becoming as good as node
- NoSQL databases
- Kanban and Lean
Probably missing something...
Tuesday, June 17, 2014
Visual Studio 2013 bug with SharePoint 2010
We are using Über-packages with SharePoint that stopped working after we upgraded from Visual Studio 2010 to 2013.
The bug and workaround are described here
Description:
In VS2010 I can package the SharePoint 2010 projects without a problem.
When I open the same code in VS2013 I can compile without any compilation errors
However when I am trying to "publish" I am getting compilation errors.
This is related to the "additional assemblies" that are project outputs. If I change to hard-coded path this fixes the problem. Unfortunately that is not acceptable because we have multiple configurations.
Workaround:
1. Open C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\SharePointTools\Microsoft.VisualStudio.SharePoint.targets
2. Find the following line and remove the @(ProjectOutputReference)
<UnfilteredSharePointProjectDependency Include="@(ProjectItemReference);@(FeatureReference);@(ProjectOutputReference)" Condition="%(FullPath) != '$(MSBuildProjectFullPath)'" />
3. Reload the project and it should publish fine now.
Apparently it did not help me with the production code, so I ended up editing csproj file and manually forcing version 10 of the build tools:
The bug and workaround are described here
Description:
In VS2010 I can package the SharePoint 2010 projects without a problem.
When I open the same code in VS2013 I can compile without any compilation errors
However when I am trying to "publish" I am getting compilation errors.
This is related to the "additional assemblies" that are project outputs. If I change to hard-coded path this fixes the problem. Unfortunately that is not acceptable because we have multiple configurations.
Workaround:
1. Open C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\SharePointTools\Microsoft.VisualStudio.SharePoint.targets
2. Find the following line and remove the @(ProjectOutputReference)
<UnfilteredSharePointProjectDependency Include="@(ProjectItemReference);@(FeatureReference);@(ProjectOutputReference)" Condition="%(FullPath) != '$(MSBuildProjectFullPath)'" />
3. Reload the project and it should publish fine now.
Apparently it did not help me with the production code, so I ended up editing csproj file and manually forcing version 10 of the build tools:
Monday, April 21, 2014
Thursday, January 16, 2014
Yet another reason to use PowerShell
From this article:
Notice that all XML nodes in the document are converted to standard PowerShell properties, whether a node has children (e.g. catalog) or is a leaf node (e.g. price), or whether a leaf node is an element (e.g. author) or an attribute (e.g. id). In particular (as the last two examples above illustrate), element values and attribute values are treated exactly the same with standard “dot” notation.
This sill also help us suck work with DataSets, converting them to XML and then accessing the data as properties.
Notice that all XML nodes in the document are converted to standard PowerShell properties, whether a node has children (e.g. catalog) or is a leaf node (e.g. price), or whether a leaf node is an element (e.g. author) or an attribute (e.g. id). In particular (as the last two examples above illustrate), element values and attribute values are treated exactly the same with standard “dot” notation.
This sill also help us suck work with DataSets, converting them to XML and then accessing the data as properties.
Tuesday, January 14, 2014
Microsoft encourages bad developer practices
Look at this: http://sdt.bz/content/article.aspx?ArticleID=65362&page=1
“To give you a concrete scenario or example, let’s assume that you’re working on building an Azure website during the day, and you go home in the evening and suddenly the one thing that was bugging you about your website you want to go fix, and you suddenly know in your head, ‘Hey, these are three lines of code that I need to go add to make it work the way I want it to make it work.’ You can fire up a browser, use Visual Studio Online, get access to the source code, which is stored in Visual Studio Online, and then be able to edit your project with those three lines of change that you want to make, and boom, you are there. And you can deploy using Visual Studio Online right from there.”
What could go wrong? The developer fixes the issue and introduces three more, without integrating with other developers, testing, etc. deploys the stuff from his Visual Studio Online to production, breaking the site.
Why is Microsoft investing into the tools for deployment from the Visual Studio? They only encourage bad coding practices... This ability should be removed from the Visual Studio, instead we should be only deploy from the drop folder, after the code is integrated and built, all tests passed and the code is certified to be ready for prod. Instead of building tools to deploy from the Visual Studio Microsoft should make it easy to build deployment pipeline.
“To give you a concrete scenario or example, let’s assume that you’re working on building an Azure website during the day, and you go home in the evening and suddenly the one thing that was bugging you about your website you want to go fix, and you suddenly know in your head, ‘Hey, these are three lines of code that I need to go add to make it work the way I want it to make it work.’ You can fire up a browser, use Visual Studio Online, get access to the source code, which is stored in Visual Studio Online, and then be able to edit your project with those three lines of change that you want to make, and boom, you are there. And you can deploy using Visual Studio Online right from there.”
What could go wrong? The developer fixes the issue and introduces three more, without integrating with other developers, testing, etc. deploys the stuff from his Visual Studio Online to production, breaking the site.
Why is Microsoft investing into the tools for deployment from the Visual Studio? They only encourage bad coding practices... This ability should be removed from the Visual Studio, instead we should be only deploy from the drop folder, after the code is integrated and built, all tests passed and the code is certified to be ready for prod. Instead of building tools to deploy from the Visual Studio Microsoft should make it easy to build deployment pipeline.
Wednesday, August 21, 2013
Fix the gvim encoding problem on Windows
Files, created in Notepad with unicode won't display correctly in gvim unless explicitly set the encoding explicitly. To do that I mapped F6 key in .vimrc as follows:
:map <F6> :set encoding=utf-8<CR>:e!<CR>
:map <F6> :set encoding=utf-8<CR>:e!<CR>
Wednesday, April 17, 2013
Macro to remove attachments
People in my organization often don't pay attention to the size of the email attachments. My habit is to save the emails to the PST files. Hence the problem: my PCT files are huge. The solution: remove attachments. Simple Marco does the trick:
Sub RemoveAttachments()
Dim oMailItem As MailItem
Dim objAttachments As Outlook.Attachments
Dim i As Integer
Set oMailItem = Application.ActiveExplorer.Selection.Item(1)
Set objAttachments = oMailItem.Attachments
If objAttachments.Count > 0 Then
For i = objAttachments.Count To 1 Step -1
objAttachments.Item(i).Delete
Next i
oMailItem.Close (olSave)
End If
Set oMailItem = Nothing
End Sub
Sub RemoveAttachments()
Dim oMailItem As MailItem
Dim objAttachments As Outlook.Attachments
Dim i As Integer
Set oMailItem = Application.ActiveExplorer.Selection.Item(1)
Set objAttachments = oMailItem.Attachments
If objAttachments.Count > 0 Then
For i = objAttachments.Count To 1 Step -1
objAttachments.Item(i).Delete
Next i
oMailItem.Close (olSave)
End If
Set oMailItem = Nothing
End Sub
Thursday, August 23, 2012
So true!!!
The effect of a broken build generally, and specifically a build left broken at the end of a day’s work, is magnified if you are working in a distributed development team with groups in different time zones. In these circumstances, going home on a broken build is perhaps one of the most effective ways of alienating your remote colleagues.
Farley, David; Humble, Jez (2010-07-27). Continuous Delivery: Reliable Software Releases through Build, Test, and Deployment Automation (Addison-Wesley Signature Series (Fowler)) (Kindle Locations 2024-2026). Pearson Education (USA). Kindle Edition.
Farley, David; Humble, Jez (2010-07-27). Continuous Delivery: Reliable Software Releases through Build, Test, and Deployment Automation (Addison-Wesley Signature Series (Fowler)) (Kindle Locations 2024-2026). Pearson Education (USA). Kindle Edition.
Tuesday, August 21, 2012
Really good advise on configuration management
Keep the available configuration options for your application in the same repository as its source code, but keep the values somewhere else. Configuration settings have a lifecycle completely different from that of code, while passwords and other sensitive information should not be checked in to version control at all.
Farley, David; Humble, Jez (2010-07-27). Continuous Delivery: Reliable Software Releases through Build, Test, and Deployment Automation (Addison-Wesley Signature Series (Fowler)) (Kindle Locations 1581-1583). Pearson Education (USA). Kindle Edition.
Farley, David; Humble, Jez (2010-07-27). Continuous Delivery: Reliable Software Releases through Build, Test, and Deployment Automation (Addison-Wesley Signature Series (Fowler)) (Kindle Locations 1581-1583). Pearson Education (USA). Kindle Edition.
Thursday, June 07, 2012
Tuesday, May 01, 2012
More performant way to add items to SharePoint List
SPList.Items.Add(); -this code actually attempts to retrieve all items of the list.
Actually, you may retrieve an empty SPListItemCollection without querying the database by calling SPList.GetItems() and passing an SPQuery object designed to return no rows. So to add an item to a SharePoint list, use the following code instead: SPListItem newItem = SPList.GetItems(new SPQuery(){Query = "0"}).Add();
Mann, Steven; Murphy, Colin; Gazmuri, Pablo; Wheeler, Christina; Caravajal, Chris (2012-01-31). SharePoint 2010 Field Guide (Kindle Locations 8516-8520). John Wiley and Sons. Kindle Edition.
Actually, you may retrieve an empty SPListItemCollection without querying the database by calling SPList.GetItems() and passing an SPQuery object designed to return no rows. So to add an item to a SharePoint list, use the following code instead: SPListItem newItem = SPList.GetItems(new SPQuery(){Query = "0"}).Add();
Mann, Steven; Murphy, Colin; Gazmuri, Pablo; Wheeler, Christina; Caravajal, Chris (2012-01-31). SharePoint 2010 Field Guide (Kindle Locations 8516-8520). John Wiley and Sons. Kindle Edition.
Monday, April 16, 2012
List of JavaScript MVC frameworks
http://www.hanselman.com/blog/TheBigGlossaryOfOpenSourceJavaScriptAndWebFrameworksWithCoolNames.aspx
Monday, February 27, 2012
Wednesday, January 11, 2012
My Powershell Profile
I updated my profile in .\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 to include SharePoint:
function prompt {
$Host.UI.RawUI.WindowTitle=$(get-location)
"$ ";
}
#Set environment variables for Visual Studio Command Prompt
pushd 'c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC'
cmd /c "vcvarsall.bat&set" |
foreach {
if ($_ -match "=") {
$v = $_.split("="); set-item -force -path "ENV:\$($v[0])" -value "$($v[1])"
}
}
popd
write-host "`nVisual Studio 2010 Command Prompt variables set." -ForegroundColor Yellow
& ' C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\CONFIG\POWERSHELL\Registration\\sharepoint.ps1'
write-host "`nSharePoint environment set." -ForegroundColor Yellow
function prompt {
$Host.UI.RawUI.WindowTitle=$(get-location)
"$ ";
}
#Set environment variables for Visual Studio Command Prompt
pushd 'c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC'
cmd /c "vcvarsall.bat&set" |
foreach {
if ($_ -match "=") {
$v = $_.split("="); set-item -force -path "ENV:\$($v[0])" -value "$($v[1])"
}
}
popd
write-host "`nVisual Studio 2010 Command Prompt variables set." -ForegroundColor Yellow
& ' C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\CONFIG\POWERSHELL\Registration\\sharepoint.ps1'
write-host "`nSharePoint environment set." -ForegroundColor Yellow
Thursday, June 30, 2011
Kill Projects and Develop Agile Programs
http://ctotodevelopers.blogspot.com/2011/06/kill-projects-and-develop-agile.html
Wednesday, June 29, 2011
Best practices of the past
Looks like SharePoint faithfully following the best practices of 10 years ago. Lots of XML files, XSLT - some of younger developers don't remember the hype surrounding these at the turn of the millennium. When I experienced pain of setting up BCS in SharePoint 2010, it reminded me of EJB as they were around 2000: lots of duplication in various XML and code files, typo-unforgiving environment, etc.
Come on! It's 2011! Everyone is talking about "convention over configuration", "view engine", Razr, code-first Entity Framework, etc. Are we going to see these in SharePoint 2020?
Come on! It's 2011! Everyone is talking about "convention over configuration", "view engine", Razr, code-first Entity Framework, etc. Are we going to see these in SharePoint 2020?
Tuesday, June 28, 2011
Evil security in Win2008R2
On Windows Server 2008 R2 there is no way to install assembly into GAC. Drag and drop - get "Access denied". Gacutil is not installed!
Had to copy gacutil.exe and gacutil.exe.config from my Windows 7 workstation to the server, then can install assemblies without any problems. Evil security again???
Had to copy gacutil.exe and gacutil.exe.config from my Windows 7 workstation to the server, then can install assemblies without any problems. Evil security again???
Subscribe to:
Posts (Atom)