Microsoft Archives « Digital Tool Factory blog

The Digital Tool Factory Blog

The free version of Google Apps is going away, but have no fear

A few weeks ago Google decided to end their free version of GMail, or as they referred to it, Google Apps for domains. If you are an existing customer you were grandfathered in, but otherwise you will now have to pay to use their email service (and spam filtering) with your own domain name.

Happily all is not lost. Microsoft recently released their new, free service of Outlook.com. It is a blatant attempt compete with GMail, and quite frankly, it’s great! It is nowhere near as cluttered and ad-centric as GMail and the spam-filtering is equal to Google’s.

Check it out at Outlook.com. The signup – switchover procedure takes all of about 15 minutes.

And on another note, our new, under-promoted Facebook page is quite lonely – if you have a chance, could you take a look and like us?

This first appeared on the Digital Tool Factory newsletter on 12/31/2012


14
Jan 13


Written By Steve French

 

How to fix Visual Studio slowness problems by deleting ExpansionsXML.xml

The Problem

'Program Guy 1' photo (c) 2009, Briles Takes Pictures - license: http://creativecommons.org/licenses/by/2.0/I’ve had Visual Studio 2010 installed from the first day it was released, and lately it has gotten significantly slower.   That’s not surprising with an increased number of add-ons and extensions.  However, closing the program recently started taking an increasingly long period of time.  It recently reached OVER EIGHT MINUTES so I opted to do some googling.

The Cause

I started by installing PerfMon, and PerfMonWatson, which while telling me the computer was slow, did nothing to tell me of the nature of the problem.  Then I installed Process Monitor by the Sys Intenals division of Microsoft and watched what happened when I opened adn closed the Visual Studio 2010.

The result?  When you open or close Visual Studio 2010 a terrifying number of things happen, but in my case an xml,

C:Users[UserName]AppDataLocalMicrosoftVisualStudio10.01033ExpansionsXML.xml

was being accessed, read and closed several thousand times.  Apparently Visual Studio will do that when the file gets corrupted.

The Solution

Just delete the .xml file and everything should run normally.  Visual Studio 2010 regenerated the file, and it was about one fifth the size it was before.  Everything is working slightly faster in general, and it now closes at a normal speed.


22
Jun 12


Written By Steve French

 

How to create a Sql Azure database with Entity Framework codefirst

'King Cloud' photo (c) 2007, Karen Ka Ying Wong - license: http://creativecommons.org/licenses/by-sa/2.0/I’ve lately begun to use Windows Azure, and I thought I would start blogging about it as well.

Sql Azure database with entity framework codefirst – the song remains the same

As I am deeply committed to using ASP.net MVC 3 with Entity Framework CodeFirst, I thought at first moving to Azure might be a problem, as Sql Azure is marketed as a cousin to Sql Server, and not the real thing.  Happily that seems not to be the case.

I searched for a guide on how to use Entity Framework Codefirst with Sql Azure and couldn’t find one – so I just up and tried it and it worked quite well.  It works just like the regular Codefirst method, only you must specify the proper sql azure database in the web.Debug.config and the web.Release.config files.  Furthermore, that database must not already exist.  The Windows Azure admin screens strongly guide you in the direction of creating an initial database, but I’ve found if you just delete your default database it will create one for you.

So, in sum, you just treat Sql Azure the same as you would any other Sql Server database.  I’m not sure why Microsoft is marketing it as something radically different, but so far I have not discovered any meaningful differences between the two systems.


03
May 12


Written By Steve French

 

How to fix problems the Mailbox unavailable. The server response was: 5.7.1 Message rejected as spam by Content Filtering error

The Problem:

You are trying to send an email in C# from your website (using Exchange as the email server), but you get the error message

Mailbox unavailable. The server response was: 5.7.1 Message rejected as spam by Content Filtering.

whenever you send the email.  It is clearly not spam.

The Cause:

You are triggering a spam filter based on the number of words and characthers in the sample email you’re sending.

The Solution:

You should increase the number of words in the body of your email by five or more.  It’s strange, but it works.


17
Feb 12


Written By Steve French

 

ASP.Net MVC 3 In Review – One Year Later

'F'kin Computers.' photo (c) 2011, Cameron - license: http://creativecommons.org/licenses/by-sa/2.0/It’s been a little over a year since I’ve devoted myself to Asp.net MVC 3 and on the whole I’m quite impressed.  Microsoft seems to have picked a definite direction for the web (the Microsoft Web Platform Installer makes a nice guide for it), and I like it.  Here is my broad review, please bear in mind I’ve been doing asp.net webforms for about ten years.

The Pros of ASP.Net MVC 3

  1. The Razor View Engine – Brevity is wonderful
  2. The integration with Sql Server and Entity Framework CodeFirst
  3.  The full integration with JQuery
  4. The bare metal approach to html, it is much easier to find bugs in the code when there is less code.
  5. The full integration with Visual Studio 2010 – it is nice to have the platform and the IDE work fully together
  6. NuGet!  The single best way to install add-ons.
  7. The ease of testing your code via the test capabilities of Visual Studio

 

The Cons of ASP.Net MVC 3

  1. It is a pain to test actual data.  With the advent of code-first one would think that you could simply have a test database, but there is no way.  One has to use db fakes, which makes your entire testing a bit less useful.
  2. Coded User Interface Tests are not baked into the system in any way, and for no particular reason one cannot have CUITS in the same solution as the most popular ASP.net  MVC 3 scaffolding packages.

On the whole, I am a huge fan – for more information about it, check out the wonderful work that Shawn Wildermuth and Scott Hanselman have been doing.


14
Feb 12


Written By Steve French

 

How to fix problems with the X-Axis in Microsoft Charting Components

The Problem: You’re creating a line or area chart using the Microsoft Charting components (the ones in System.Web.UI.DataVisualization.Charting, not System.Web.Helpers) and for whatever reason the first entry is actually in the second quadrant, like so:

The Cause: The charting components assume you want to show some sort of contrast for the first value, but it just doesn’t look right in this case.

The Solution: Set your minimum value to 1 instead of zero (zero is the default), like so

myChart.ChartAreas[0].AxisX.Minimum = 1;

The chart will now be pushed flush left, for a much better appearance.  You will see something like the chart below.

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog


01
Sep 11


Written By Steve French

 

How to fix problems with Coded User Interface Tests

The Problem:

You attempt to create a new Coded User Interface Test in Visual Studio 2010, and you get the following error:

The following package failed to load: C:Users[File Path Goes Here]Microsoft.VisualStudio.TestTools.UITest.Extension.IE.dll. Coded UI Test is now in an inconsistent state. Remove this package and restart Visual Studio to work with Coded UI Test.

The Cause:

For whatever reason, Visual Studio does not copy Microsoft.VisualStudio.TestTools.UITest.Extension.IE.dll into the solution, and but it thinks it did.

The Solution:

Just copy the file over yourself.  Here’s how.

  1. Close Visual Studio
  2. Go to C:Program Files (x86)Microsoft Visual Studio 10.0Common7IDEPrivateAssemblies
  3. Copy the Microsoft.VisualStudio.TestTools.UITest.Extension.IE.dll file into the bin/debug directory
  4. Restart Visual Studio and try again.

No idea on the root cause, but that should fix the problem.

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog


11
Jul 11


Written By Steve French

 

How to fix problems with Linq and the Entity Framework

database 2

The Problem:

You attempt to do a query using Linq To Entities and your code does not work.

The Cause:

For reasons unknown, Linq to Entities has different operators than Linq To Sql.

The Solution:

Call your initial query/pull and us .ToList() on it before you run any of the problem operators – this fixes the problem entirely.
I am embarrassed to say that I spent 30 minutes trying to get Linq to Entities to work directly before I thought of that.

Creative Commons License photo credit: Tim Morgan

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog


24
Jun 11


Written By Steve French

 

How to do a cool flash notification message in asp.net mvc 3 in 6 easy steps

I pieced all of this together from various sources online, so the code is a bit rough, but here it is:

1.  Create a partial razor view, call it _NotifyBar.cshtml, it contains this:

@if (Request.Cookies["NotifyBar"]!=null)
{

var c = new HttpCookie(“NotifyBar”);
c.Expires = DateTime.Now.AddDays( -1 );
Response.Cookies.Add( c );

}

2.  Put this in the header of your _Layout.cshtml file
//here is the jbar stuff

<script type=”text/javascript”>//
$(document).ready(function () {
$(“#message”).fadeIn(2000);
$(“#message”).delay(5000).fadeOut(1000);
$(“#message a.close-notify”).click(function () {
$(“#message”).fadeOut(“slow”);
return false;
});
});
</script>

3.  Right after the body of your _Layout.cshtml page there is this code

@Html.Partial(“_NotifyBar”)

4. Create a file called ExtensionMethods.cs, add in this code

public static ActionResult SetStatusMessage(this ActionResult ar, string str)
{
var c = new HttpCookie(“NotifyBar”);
//c.Expires = DateTime.Now.AddDays(-1);
c.Value = str;
HttpContext.Current.Response.Cookies.Add(c);
return ar;
}

5. Put this in your stylesheet

#message {
font-family:Arial,Helvetica,sans-serif;
position:fixed;
top:0px;
left:0px;
width:100%;
z-index:105;
text-align:center;
font-weight:bold;
font-size:100%;
color:white;
padding:10px 0px 10px 0px;
background-color:#8E1609;
}

#message span {
text-align: center;
width: 95%;
float:left;
}

.close-notify {
white-space: nowrap;
float:right;
margin-right:10px;
color:#fff;
text-decoration:none;
border:2px #fff solid;
padding-left:3px;
padding-right:3px
}

.close-notify a {
color: #fff;
}

6. Then in your controller, just return add “SetStatusMessage” on your RedirectToAction, for example

return RedirectToAction(“Index”).SetStatusMessage(“You have successfully edited the ” + project.ProjectName + ” project.”);

That’s it!  You can now have a fade-out notification message on any page you like.  The use of the cookies is a bit cumbersome, but I could implemnt it quickly.

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog


24
May 11


Written By Steve French

 

How to Fix the “Service Unavailable” problem in IIS

Gears gears cogs bits n piecesThe Problem: For whatever reason, your website is displaying a white screen with “Service Unavailable” and nothing else.

The Cause: There could be many causes, but the one I just discovered was that the application pool had shut down for no good reason.

The Solution: In IIS, navigate to “Application Pools”, right click to bring up the content manager – select “Stop”, and then select “Start”.  That should fix the problem in most cases.

Creative Commons License photo credit: Elsie esq.

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog


23
May 11


Written By Steve French

 



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