Build action in Visual Studio

Earlier today I was creating a new class file for a project of mine in Visual Studio.
Then I went on using the class defined in that file in a web form, but, to my surprise, the class was inaccessible.

I double checked the access level of the class, but it appears that wasn’t the issue, so I started googling for this problem, but I ended up looking at situation different from mine and not really useful.
After a few minutes of scratching my head on this unusual problem, I finally had a look at a pane I rarely look at:

compileIn the Properties pane, the Build Action was set to Content instead of Compile: this is the ways of telling the IDE to include this file in the project as a static resource. So, in this case, the class file was included as a simple plain text file with no action performed on it: no compilation mean of course no usable class, so that was the reason for the seemingly inexplicable behavior.

To have a deeper look into this topic, I strongly advise to read this interesting post on StackOverflow.

Advertisements

HTML5 horizontal alignment

An inline element can be centered using the text-align: center style on the parent element like in the following example:

<div id="containersharing" style="text-align: center">
<h1>Share or bookmark this page</h1>
<!-- AddThis code START -->
<!-- Go to www.addthis.com/dashboard to customize your tools -->
<div class="addthis_sharing_toolbox" style="display: inline-block;"></div>
<!-- AddThis code END -->
</div>

A block element can be horizontally centered using the following class selector:

.containerfootertext {
    width: 50%;
    margin: 0 auto;
    overflow: hidden;
}

Solve iCloud sync issue on Windows

There are cases whre the iCloud folder on yopur Windows machine is not synchronizing with your account, no matter what.
There is a way to get out from this issue by cleaning up the iCloud configuration and let the client to set it up from scratch again:

  • From the iCloud control panel sign out your account
  • Go to %appadata%\R­oaming\Apple Computer\MediaStream
  • Delete all files and folders in MediaStream folder and restart the machine
  • From iCloud control panel, log back in.

From this time forward, the iCloud service will re-synch your data from the cloud.

S-Health and password

One of the very annoying new functionality of the Samsung’s S-Health application is the password protection.
After update, during setup the user is asked to set a password, but at this stage is not clear to the user how this password will work. In fact, once set, it will ask the password every time the software is accessed for any reason, not only on startup.

This means, for instance, the step counter will not work when you turn the phone on until you unlock it; if you mistakenly touch the widget on the homescreen and fail to input password, all the activity is suspended until you do so.

As this application is hardly keeper of your utmost secrets (bank account and the like) it is unclear to me why it should provide for this feature by default.
To make the matter worse, the option to manage the password is not shown in the S-Health configuration.
It tooks me a little while to figure out that this feature was activated via the menu button:

Menu > Settings > Password

There you can easily disable the password and get back to the hassle-free usage.