Archive for the ‘.Net’ Category

Add the following lines in the migration code:

if (!System.Diagnostics.Debugger.IsAttached)

This launches and instance where you can debug inside an Entity Framework migration method.

Read Full Post »

There are several ways to remove unwanted characters from a string, here is one quite nice…

char[] unAllowedCharacters = “/\\.,;:+*’§½\”<>|!?$&=@#%{}^~[]`´¨¤”.ToCharArray();

text = String.Join(“”, text.Split(unAllowedCharacters));

Read Full Post »

Today I’m working in a project which previously has exclusive checkout right set to on. I changed this today, as I think that it’s generally not a good idea to have it like this (only one user can checkout a file a time).

However, I still got the error message “No items were checked out – The item is locked for check-out by”… error message in Visual Studio, I guess this is because the file was checked out prior to the exclusive checkout change. To fix this, I had to run the following command in a Visual Studio command prompt:

tf undo /workspace:<workspace name>;<user name> $”<path to file>”

Replace the values between <> with the appropriate values). The workspace name/user name and path was found in the output windows in Visual studio:

No items were checked out
The item $/THEPROJ/DEV-Branch/client/src/Client/frmMainMDI.cs is locked for check-out by donald.duck in workspace LATEST_REAL.

For the values above, this shoud be:

tf undo /workspace:LATEST_REAL;donald.duck $”/THEPROJ/DEV-Branch/client/src/Client/frmMainMDI.cs “

Read Full Post »

Another Regexp tester site…

This site is very handy if you want to write and test regular expressions: http://www.regexr.com/. A quick reference is also handy to have opened if you don’t have all rules in your head (I don’t): https://msdn.microsoft.com/en-us/library/az24scfc%28v=vs.110%29.aspx.

Read Full Post »

Simply run the command (it’s part of the Team Foundation Power Tools), this also makes it possible to do a undo checkout on  them:

tfpt uu . /noget /recursive

Read Full Post »

I successfully followed the official release notes for MVC4 which describes how to upgrade a MVC3 project to MVC4. I did the same, but upgraded a MVC2 project.

See here what should be done:

Read Full Post »

Merging of code could be a bit of pane in the ass sometimes, however when you only made changes to a number of files it might be easier to go trough a list of changed file and merge each of tem one by one.

You can get such as list by doing the following:

– Go to the ‘Source Control Explorer’
– Right-click on the folder you want to compare, and choose compare.
– Change the source version type to ‘Date’ and specify the start-date
– Change the target path to point to the same folder as the source path (i.e. the server-path)
– Change the target version type to Date and specify the end-date (or just leave it blank if you want to see all changed files up to todays date)

Read Full Post »

Older Posts »