Digital Tool Factory blog - Backend web development in Atlanta GA

The Digital Tool Factory Blog

How to fix irritating problems with TFS and Visual Studio 2017

Due to a variety of circumstances I’m creating new projects with Visual Studio 2017, but using Team Foundation Server 2015 to house the source code – here is the proper sequence (for me) that gets the source code in place properly

  1.  Create Team Foundation Server Project using Visual Studio 2015 – note remote origin server
  2. Disconnect from VPN (and therefore TFS)
  3. Create Solution normally using Visual Studio 2017
  4. Do the normal “Add to Source Control” (from the File menu)  (if you do this while connected to the VPN/TFS it will try to force you to save it to TFS (where you can’t create a new project, or see the project you just created) – it will then do all the Git setup normally
  5. Reconnect to the VPN
  6. In the Team Explorer settings, add the remote origin server location to the “Remotes” section in the Repository settings – don’t forget to use the name “origin” as the name
  7. Commit and Push – everything should be working fine.

I’m sure there is a much better way to do this, but this is what works for me.


01
Dec 17


Written By Steve French

 

How to fix problems with Edit and Continue in Visual Studio 2017

For quite a while I’ve been trying to use the “Edit and Continue” feature of Visual Studio 2017, but kept on getting the warnings

  • attached to a process that does not support edit and continue
  • the code being debugged was optimized
  • intellitrace events and call information is enabled
  • the .net runtime this program is running on does not support edit and continue

So, on a whim, I uninstalled Stackify Prefix and voila!  Edit and Continue is now working just fine.


30
Nov 17


Written By Steve French

 

The peculiar problem when your entity framework query returns the same row for every record

This one had me confused for a long time, several hours in fact.  There were over 8,000 rows in the table, and the for some reason the query was returning the same row 8,000 times.  After much rending of garments and gnashing of teeth, I discovered that the table in question (in a sql server 2000 database (not created by me)) had no primary key defined.

So – I copy the data into a new table, create a key with the commands

alter table TableInQuestion
add NewIDColumn int identity(1,1)

Delete the empty key field (that was what threw me, there was a column named “Id”, which was not actually and ID column.) rename “NewIDColumn” to “Id”, then point EF to the new table with the data attribute (on the object)

[Table(“TableInQuestion”)]

and everything works like a charm

 


22
Sep 17


Written By Steve French

 

Connecting Entity Framework to Sql Server 2000

A lesson learned – when trying to map Entity Framework to Sql Server 2000  (if you must) – make sure that there are no nullable dates – if so, work around them.  I just spent hours looking into that.


25
Jul 17


Written By Steve French

 

Something to watch for on WordPress shortcodes

The first inclination is to create a shortcode that will look like [MyShortCode]My Only Parameter[/MyShortCode], which would look like this

function MyShortCode_func($content = null){
//————-stuff happens
return $processedContent;
}

However, if you want to have parameters = you must have the $atts parameter in the function, even if it is not used.  The proper function would be

function MyShortCode_func($atts, $content = null){
//————-stuff happens
return $processedContent;
}


12
Jun 17


Written By Steve French

 

How to fix problems with password reset tokens

For some reason, asp.net identity 2 generates password reset tokens that are not property url encoded, but does send them as part of a querystring.  Therefore – when you send out the email – the web browser will add spaces to the code, which renders it invalid.  The way around that is to base 64 encode (and decode) the code as it is sent and interpreted.  Below are the Base64 extension methods.

Also – make sure there is a guid (any guid) in the SecurityStamp column in the AspNetUsers table – that will also cause it to claim that the code is invalid.

public static string ConvertToBase64(this string str)
{
byte[] encbuff = Encoding.UTF8.GetBytes(str);
return HttpServerUtility.UrlTokenEncode(encbuff);
}

public static string ConvertFromBase64(this string str)
{
byte[] decbuff = HttpServerUtility.UrlTokenDecode(str);
return Encoding.UTF8.GetString(decbuff);
}


10
Jun 17


Written By Steve French

 

How to fix problems with file creation and web deployment in asp.net

The scenario – you have an asp.net app that creates a file of some kind – everything works great – then you upload it and the file is not created.

It turns out that Visual Studio will not deploy an empty folder, or a folder that it seems as empty anyway – if the app is creating the files, the new files will not be visible to Visual Studio.  Visual Studio will see an empty folder and not create it on the server.  You will run the app, and it will try to save a file to a folder that isn’t there, and will create an error.

The easiest way to do that is to just create a blank text file in the folder.  Visual Studio will see that file, and then upload the text file (in doing so creating the folder) and the app will have a folder to create the new file in.


05
Jun 17


Written By Steve French

 

My Qnap TS-431P-US 4-bay NAS Review – Part 1

As my current backup server (the now defunct Windows Home Server 2011) is reaching end of life – I reached out to my informed tecnical brethren and all of them mentioned the QNap brand of network attached storage – that in mind, I got the QNap TS431-P – and slapped two four terabyte drives.   As it’s formatting and making beeping noieses, I thought I would write this review.

Initial Thoughts

  • Everyone and every review had good things to say about this NAS
  • The outward appearance is noting special, sort of cheap looking – the initial packaging was the same
  • While the initial hard drive installation required the use of tiny screws, there was NO slop in the snap in process
  • Two drives took about five minutes to install – that included finding the right size screwdriver
  • The initial setup (largely automated as the system downloaded files and rebooted) took about 30 minutes, with little effort on my part
  • There is some sort of app store type service – that seems to be the norm for everything these days
  • It seems fairly quiet

On the whole, I’m pretty impressed

 


01
May 17


Written By Steve French

 

What to do when intellisense stops working in java script files in Visual Studio 2015

Recently I was working on a project and noticed that none of my jquery code extension were working in Visual Studio 2015.  After much rending of garments and gnashing of teeth I discovered that the jquery code snippet plug just doesn’t work with jquery 3 – I downgraded to the most recent version of 2.0 and it all worked perfectly.


05
Mar 17


Written By Steve French

 

What to do when your web.release.config does not transform in Visual Studio 2015

Make sure that you are building in release mode – i.e. go to Build => Configuration Manager, and make sure that the relevant project is set to “Release” (like below)


03
Feb 17


Written By Steve French

 




Copyright 2011 Digital Tool Factory. All Rights Reserved. Powered by raw technical talent. And in this case, WordPress.