- Changing location of configuration files (there is no AppData folder on Mac or Linux)
- Disabling tracing (it doesn't work)
Monday, May 9, 2016
Commerce Server Desktop Business Tools: Unsuccessful Attempt to Run on Mac OSX
Tuesday, April 19, 2016
Sitecore and IIS URL Rewrite module
- Add or remove trailing slash
- Enforce lower case URLs
- Use canonical hostnames
- Redirect to HTTPS
- etc.
- Do not use URL Rewrite module with complex website which work you could not fully control. Or use only with a part of site that you fully control. It is CD part for Sitecore.
- Rewrite URL Rewrite rule. In our example it could be "^(((?!ListManagement).*)/$" instead of standard "(.*)/$"
- Use URL Rewrite module alternatives, as example ISAPI_Rewrite
Saturday, April 16, 2016
Sitecore PageExtenders: non greedy approach
Wednesday, April 6, 2016
Sitecore Social Connected 2.1: Second Life
Error, that is appeared in log:
ERROR Value was either too large or too small for an Int32.
Exception: System.OverflowException
Message: Value was either too large or too small for an Int32.
Source: mscorlib
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at System.Convert.ToInt32(String value)
at TweetSharp.TwitterService.GetAccessToken(OAuthRequestToken requestToken, String verifier)
at Sitecore.Social.Twitter.Networks.Providers.TwitterProvider.AuthGetAccessToken(AuthArgs args)
at Sitecore.Social.Client.Connector.SocialLogin.ProcessRequest(HttpContext httpContext)
Could be fixed in 2 steps:
- Downloading newer Social Connected 3.0 module
- Unzipping and replacing TweetSharp.dll in your Sitecore
"Invalid Scopes: offline_access, publish_stream, read_stream. This message is only shown to developers. Users of your app will ignore these permissions if present. Please read documentation for valid permissions at https://developers.facebook.com/docs/facebook-login/permissions".
But there was no ready to use solution. Problem was inside:
private void AddPermissionsToRequest(GetAccountCredentialsRequest accountCredentialsRequest, string networkName) { string a; if ((a = networkName.ToLowerInvariant()) != null) { if (a == "facebook") { accountCredentialsRequest.Permissions.Add("offline_access", string.Empty); accountCredentialsRequest.Permissions.Add("publish_stream", string.Empty); accountCredentialsRequest.Permissions.Add("manage_pages", string.Empty); accountCredentialsRequest.Permissions.Add("read_stream", string.Empty); return; } ...
Ok, it is only constants, lets change them:
- Open ILDASM
- Dump Sitecore.Social.Client, Version=2.1.0.0 to some.il file
- Replace "offline_access", "publish_stream", "read_stream" with "publish_pages", "user_posts", "public_profile". It is not strict correspondence, it should be deeply investigated, but these permissions will be enough to create and post social messages.
- Using ILASM, assemble some.il into Sitecore.Social.Client and copy it to our Sitecore bin folder
public string GetDisplayName(Account account) { System.Collections.Generic.IDictionary<string, object> accountData = this.GetAccountData(account, "/me"); if (accountData == null) { return null; } return string.Format("{0} {1}", accountData["first_name"], accountData["last_name"]); }
Yahoo! We gave Sitecore Social Connected 2.1 second life.
P.S. Probably it is not all problems that could appear with changes in Facebook and Twitter APIs, but described above method fixes at least part of them. Use this solution on your own risk!
Friday, April 24, 2015
Debugging optimized managed code in Sitecore (any other website) / Disable JIT Optimization
Latest Sitecore installation contains assemblies build with checked optimization flag. It causes troubles when you attach to w3wp(IIS) process and try to debug them. There is known way how to disable JIT Optimization:
Disabling Runtime Optimization:
- Close any application that may be using the optimized binaries.
- Navigate to the folder containing the binaries.
- Create a new file named BINARYNAME_WITHOUT_THE_EXTENSION.ini
E.g. If I do not want MyApp.exe to be optimized, and then create an INI file named MyApp.ini.
E.g. If I do not want MyAppHelper.dll to be optimized, and then create an INI file named MyAppHelper.ini. - Open the INI file.
Add the following text:
[.NET Framework Debugging Control]
GenerateTrackingInfo=1
AllowOptimize=0 - Save the file.
- Now you are ready to debug the application with optimization disabled.
- Note that you will have to create the INI file for each dll/exe that contains the code you want to debug.
- So the best way to go about this is to create a small windows app that will create an INI file for all files (exe and dll) in a particular folder.
But it does not work when you attach to w3wp process… It happens because IIS uses assemblies from ASP.Net Temporary folder, e.g. C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files. So, you should open your solution from folder on IIS and start debug from VS.
There are a lot of DLL files in Sitecore BIN folder and I decided to write powershell script that will create ini files for all assemblies.
Get-ChildItem (Get-Item -Path ".\" -Verbose).FullName -Filter *.dll |
Foreach-Object{
$newName = $_.DirectoryName +"\"+ [System.IO.Path]::GetFileNameWithoutExtension($_) + ".ini"
"[.NET Framework Debugging Control]
GenerateTrackingInfo=1
AllowOptimize=0" | Out-File $newName
Write-host $newName
}
Use and enjoy :-)
Wednesday, January 14, 2015
Sitecore 8 Roles Dependencies
Here is Sitecore 8 roles graph with installed ExM and WFFM:
Some remarks:
1) New roles: List Manager Editors, Experience Explorer, Analytics Advanced Testing, Sitecore Client Bucket Mangement, Analytics Maintaining