Thursday 16 August 2012

Visual Studio 2012: System.FormatException: The format of value 'application/json; charset=utf-8' is invalid.

After installing Visual Studio 2012 RTM over Visual Studio 2012 RC one of my Web API start failing with error:

Server Error in '/' Application.
--------------------------------------------------------------------------------

The format of value 'application/json; charset=utf-8' is invalid. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.FormatException: The format of value 'application/json; charset=utf-8' is invalid.

Source Error: ...

Solution is simple - just update NuGet API packages (Microsoft ASP.NET Web API Client, Web API Core, ...)  it can be done by UI or runing following command:

PM>Update-Package

Probably updating to latest version is also good for other packages like EntityFramework, ...
The Microsoft Visual Studio .NET logo.
The Microsoft Visual Studio .NET logo. (Photo credit: Wikipedia)
Enhanced by Zemanta

Friday 27 July 2012

Visual Studio C# web application build fails with "Error 46"

After rebuild I've got following error:

"Error 46 It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. ..."

Clear build and rebuild didn't help. Deleting all files in Bin folder did help! :)

When you are sick of deleting bin folder, just simple add folowing tag to *.csproj:


<Target Name="AfterBuild" Condition="'$(Configuration)'=='Release'">
  <RemoveDir Directories="$(IntermediateOutputPath)" />
</Target>


Source:
http://stackoverflow.com/questions/7388359/mvc3-project-build-fails-because-of-web-config-in-obj-folder
Enhanced by Zemanta

Tuesday 24 July 2012

Backend as a Service - list of providers

List of most used BaaS (Back-end as a Service) providers for mobile application development:



Storageroomapp is more content oriented (aka CMS via REST).

Some articles to read:


Thursday 19 July 2012

Enable .config file build configuration transformations in non-web based applications

Not posible OutOfTheBox in Visual Studio 2010 and not in current Visual Studio 12 RC, but it exists an easy work around in David Sandor blog post.

Monday 23 April 2012

VirtualBox - error after moving VDI file - Failed to open the hard disk

I was running out of disk space, so I needed to move virtual disk drive (VDI file) to another partition. As normally (read: in other virtualization tools) I removed/detached VDI file from virtual machine, moved it to new partition and added to existing virtual machine in this step error occurred:

"Failed to open the hard disk filepath.vdi
Cannot register the hard disk filepath guid because a hard disk different filepath.vdi with UUID guid already exists.guid "

Solution:
Run following command "vboxmanage internalcommands sethduuid filepath.vdi"

PS vboxmanage.exe is normally located in "C:\Program Files\Oracle\VirtualBox"

Thursday 5 April 2012

ADT17 bug: "java.lang.NoClassDefFoundError"

After successful build of Android application it crashes with error:

java.lang.NoClassDefFoundError: com.google.android.apps.analytics.GoogleAnalyticsTracker

Or some other class. Probably you have installed new ADT17 update. ;)

Resolution: Move \lib to \libs folder.

Tuesday 17 January 2012

Database mail not working - restart/re enable service broker


Situation:
- no mail is send
- databasemail.exe is missing in taskmanager
- in event log "An error occurred in Service Broker internal activation while trying to scan the user queue 'msdb.dbo.ExternalMailQueue' for its status. Error: 1222, State: 56. Lock request time out period exceeded. This is an informational message only. No user action is required."

Try:
ALTER DATABASE [msdb] SET SINGLE_USER WITH ROLLBACK IMMEDIATE
ALTER DATABASE [msdb] SET DISABLE_BROKER
SELECT is_broker_enabled FROM sys.databases WHERE name = 'msdb' ;
ALTER DATABASE [msdb] SET ENABLE_BROKER
SELECT is_broker_enabled FROM sys.databases WHERE name = 'msdb' ;
ALTER DATABASE [msdb] SET MULTI_USER

EXEC msdb.dbo.sysmail_stop_sp;
EXEC msdb.dbo.sysmail_help_status_sp;
EXEC msdb.dbo.sysmail_start_sp;
EXEC msdb.dbo.sysmail_help_status_sp;
EXEC msdb.dbo.sysmail_help_queue_sp @queue_type = 'mail';

Thursday 5 January 2012

How to clean up Word HTML document?

When saving word DOCx as HTML file, you'll huge html file with a lot of classes, tags, etc,.. This on-line Cleanup tool can help you.