November 25, 2011

Changes to 64 bit application are not allowed

This message occurs because in 64bit mode CLR does not support "Edit and Continue". The simple workaround is to change target for project to x86 mode. In this mode application will be run as 32-bit application on 64-bits machine.

November 24, 2011

C# Examples in Visual Studio

Are you beginner in C#? Do you need more C# examples? You can find them in Visual Studio. Click Help -Samples. There are a lot of usefull examples. Enjoy

November 22, 2011

Effective C# - Part 1

Slides are based on "Effective C# (50 ways to improve your C#) Bill Wagner" book. Slides get quick overview over book and show specifics of C#. Presentation is useful for C# developers who want to use all power of this language.

November 16, 2011

How to create Relative Path in C#

It is pretty easy to create relative path in C#. Just what you need is to use System.Uri class.

Example:
System.Uri root = new System.Uri( @"C:\TestDir\" );
System.Uri filename = new System.Uri( @"C:\TestDir\MyTestLocation\MyFile.cs" );
System.Uri relativePath = root.MakeRelativeUri( filename )

Console.WriteLine( relativePath.toString() );
At the Output you will see "../MyTestLocation/MyFile.cs".

September 17, 2011

Refactoring

Every developer sooner or later starts understanding that his code needs to be re-factored. This presentation will give answers for "What is refactoring?", "Where is it necessary to do refactoring?", "How to do this?"
View more presentations from Yuriy Seniuk

Free useful tools

Do you need some tools for helping you developing. Here you can find some of them:


View more presentations from Yuriy Seniuk

April 17, 2011

How to share resources between projects.

It was a very annoying problem with sharing icons between projects.

The solution described here is how to share icons between projects using Visual Studio in correct way. Lets start step-by-step!
1. The correct way in sharing some resources consist in creation of the global shared project. Create new Project with name Resources;


2. Next we must add some resource (e.g some icons) to the project. Do this as usual. Go to the projects setting. Select tab Resources and Add Existing File... to the project. We can see that icon is added to the project and was copied to the local folder;


3. Next step consists of adding this icons to the other project. But one important think! You must add this icon as link. In this case we avoid the resource duplication. OK. Create new Project is same solution and name it for example Main. Create some folder in your other project. For example we can name it as Resource. (Logical name for our purpose). Then right click at this folder. Select Add Existing Item... and choose our image from shared project. Do not forget to add this file as link. Well, you see that just added file can a little differ icon;


Added image must looks like this

4. Now we must set Build Action for this file to None. For this select the file and go to the Properties Window. There choose None for Build Action. We need to do this to avoid  the embedding this icon to the Assembly;


5. Well, we must to perform last step to complete task. Open Project Settings for project where we just adds the icon. Choose the Resource tab and drag linked image to the resources.

 

Yep! These five simple steps you must perform to share some icons between projects. But you can ask "What is the benefits of this?" There are:
  • All resources are located in one place;
  • Resources are not grabbed by projects locally. It means you can substitute some icons is Shared project and they will automatically be caught in all paced where they used;
  • If you share large files, you save the size of your App;
  • In case if you share icons between project you can use this icons in designer mode.

April 13, 2011

GMail addressee feature

Today I found out a very interesting thing regarding GMail addressee name. For example if you have friend with e-mail myfriend@gmail.com you can send the e-mail directly to this address. But it is also correct to send e-mail to the my.friend@gmail.com, or m.y.f.r.i.e.n.d@gmail.com. 
It is very interesting. As I recollect google suggest me some variant of email address separated by dot when I creating a gmail account . But I didn't  pay attention for this at that time.

March 6, 2011

I like this car.. (Golf VI)

This is an amazing car! I like it! I have Golf III, it's cool, but this car...
Just look a video and you will understand what I mean... enjoy..

March 1, 2011

Initializing Arrays

Today I have found for me new method how I can initialize my array. The point of the matter is that user can skip type in right part. For example:
int[] i = new[] { 0, 1, 2 };
Here we can see that int in right part is skipped. As for me this is interesting.. I had been happened to come across this code after "R#" refactored my code..

Also there are two well known method how array could be initialized:
int[] ii = new int[] { 0, 1, 2 };
int[] iii = { 0, 1, 2 };
p.s. live and learn!