BusinessRx Community

Dedicated to the advancement of software, technology and the people who devote their lives to it.

Welcome to BusinessRx Community Sign in | Join | Help
in Search

BusinessRx Reading List

These blog entries are written by industry experts and leaders. We consider this content to be a good read for any software developer or web technologist.

February 2010 - Posts

  • No Intellisense with VS 2010 RC (and how to fix it)

    [In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu]

    Patrick recently posted about something he found odd when installing the VS 2010 RC – which was that code intellisense for C# wasn’t working.  When he pulled up Tools->Options and checked under the Text Editor->C# settings he noticed that the reason Intellisense wasn’t working was because his profile had them turned off – and he couldn’t understand why it was configured to be off by default:

    image

    Why does this happen?

    The above situation occurs because:

    1) When you run VS 2010 the first time on a machine that has had VS 2008 installed on it, it asks you if you want to import your existing VS 2008 profile settings.  By default this checkbox is checked – which means you by default automatically import your existing settings.

    2) Some VS plugins – for example Resharper – turn off the built-in C# code intellisense within VS and instead replace it with their own implementation.  If you’ve installed Resharper on VS 2008, the above VS code intellisense profile settings are turned off.  When you import your existing profile during VS 2010’s first time run experience the code intellisense settings import over in a disabled state.  If you haven’t installed Resharper on VS 2010 (which is a separate install) – then by default you’ll end up with intellisense turned off.

    How to Fix this?

    Fixing this situation with the VS 2010 RC is pretty easy.  Just do one of two things:

    1) Use the Tools->Options menu command, select the Text Editor->C# settings, and then check the two circled check boxes above (Auto-list members and Parameter information).  Intellisense will then be turned on and work fine.

    or:

    2) Install the version of Resharper that works with the VS 2010 RC. It then enables intellisense using its own mechanism.

    We are modifying the profile import behavior in the final release of VS 2010

    We’ve heard reports of a few people running into this – and since the behavior is pretty confusing we are modifying the profile import behavior with the final release of VS 2010 to avoid it.  If a plugin has turned intellisense off with VS 2008, by default when you import the profile into VS 2010 we will re-enable it.  This will ensure that on a clean VS 2010 install intellisense always works by default. 

    Hope this helps,

    Scott

  • FIX: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS

    I teach two six week courses on ASP.NET at the University of California - San Diego Extension. The first class serves as an introduction to ASP.NET and as such many of the students create their first ASP.NET websites in class. During the first meeting students create a simple ASP.NET website. At the end of the first evening, those students who did not bring their own laptop need to work on their website from home or work; they may copy the files to a thumb drive or ZIP up the files and send them via email. In either case, it's not uncommon for students to bump into the following error when opening the website to bump into the following error message:

    It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

    This error message isn't the most sensible error message, especially those to ASP.NET, so let me try to explain it.

    Configuration information for an ASP.NET website is defined in one or more Web.config files. The configuration settings are applied in a hierarchical manner. There's a “global” Web.config file that spells out the baseline configuration information for all websites on the web server; this file lives in the %WINDIR%\Microsoft.Net\Framework\version\CONFIG folder. You can also have a Web.config file in the root folder of your website. This Web.config file can override settings defined in the “global” Web.config file, or add new ones. Additionally, you may have Web.config files in the subfolders of your website, which define new configuration settings or override configuration settings defined in Web.config files higher up in the hierarchy.

    Certain configuration elements in Web.config cannot be defined beyond the application level, meaning that they must be defined in the “global” Web.config file or in the Web.config file in the website's root folder. The <authentication> element is one such example. The above error message indicates that there is a Web.config file in one of the website's subfolders than has one of these configuration elements that cannot be defined beyond the application level.

    This problem most commonly arises when you open the website in Visual Studio but accidentally open the parent of the root folder. For example, imagine that you have a website located at C:\MyProjects\Website1, where the Website1 folder is the root of the website. When you open this website from Visual Studio you are asked to specify the website's root folder - it is imperative that choose the Website1 folder. If you accidentally select the MyProjects folder then the Web.config file in the Website1 folder is now in one of the website's subfolders. Because that Web.config file includes the <authentication> element, among other application-level settings, you'll receive the above error.

    The fix to this error (in most cases), then, is to close your project and reopen it from Visual Studio, making sure that you select the appropriate folder.

    Happy Programming!

  • Patch for VS 2010 RC Intellisense Crash Issue Now Available

    [In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu]

    Last week I blogged about an intellisense crashing issue that is unfortunately in the VS 2010 RC. 

    Crash Symptom

    If you are encountering frequent VS 2010 crashes when you are typing in the editor while Intellisense is popping up and/or being dismissed then you are running into this issue.

    Patch Now Available

    This morning we made available a VS 2010 RC patch which fixes this issue.  You can download and run it here

    Please apply it if you are encountering any crashes with the VS 2010 RC, or if you have a tablet, multi-touch, screen-reader or external devices attached (including Wacom tablets, phones/ipods, and others that connect via USB).

    Please make sure to submit any issues you encounter with the VS 2010 RC to us via the connect.microsoft.com web-site.  Once you’ve entered the issue there please send me email (scottgu@microsoft.com) with a pointer to the issue and I’ll make sure the appropriate team follows up quickly.

    Hope this helps,

    Scott

  • Intellisense Crashing fix for VS 2010

    [In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu]

    We shipped the VS 2010 RC on Monday, and have seen some great feedback regarding performance and stability with it.

    One issue, though, that we have seen a number of people run into is an intellisense crash that happens very frequently on machines that have UI Automation enabled and certain devices connected.

    Crash Symptom

    If you are encountering frequent VS 2010 crashes when you are typing in the editor while Intellisense is popping up and/or being dismissed then you are running into this issue.

    Why does the crash happen?

    The most common cause of the crash happening is that you are running a machine that:

    • Is a Tablet PC (even if you aren’t using the pen)
    • Has multi-touch screen drivers enabled
    • Has an external input device like a pen or Wacom tablet
    • Has a screen-reader enabled

    It turns out that a late fix right before the RC shipped modified a UI input code path that unfortunately exposed this bug.

    A patch is coming to fix this issue

    We are working on shipping a VS 2010 RC patch that we’ll release next week that will fix the issue and prevent it from occurring.  I’ll blog a pointer to the patch once it is available.

    How to work around the issue now

    There are two ways you can work around the issue now.  One is to disable your Tablet services (read this article for details on how to do this) and/or disable Multi-touch/Pen drivers on your system.  The other is to set a registry key.

    You can read about both of these workaround in this VS Team Blog Post.

    What if you still see crashes?

    Please send me email (scottgu@microsoft.com) if you are still seeing any crashes after trying out these steps (or encounter crashes for non-Intellisense scenarios) – we’d like to make sure we investigate and follow-up any others you encounter.

    Hope this helps,

    Scott

  • LIDNUG Online Chat with Me on Thursday Feb 11th

    Today we opened up the VS 2010 RC for everyone to download.  You can download it here.  Jason Zander (who runs the Visual Studio team) has a good blog post that summarizes a lot of common questions about it here.

    As I mentioned in my blog post about the RC on Monday, please send me email (scottgu@microsoft.com) about any bugs or issues you encounter – that way I can make sure to connect you with someone who can follow up and investigate them quickly.

    Online Chat with Me Thursday February 11th at 10am PST

    I’m doing a virtual webcast chat Thursday February 11th from 10am to 11:30am (PST timezone).  The chat is open to everyone and sponsored by the LIDNUG user group.  The format of the chat is open - and you can ask anything while you listen in as I try and answer as many questions as possible.  I expect I’ll spend a lot of time talking about VS 2010, .NET 4, Silverlight 4, ASP.NET 4 and ASP.NET MVC 2.

    You can register and attend the chat for free here.

    Hope this helps,

    Scott

  • VS 2010 / .NET 4 Release Candidate

    [In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu]

    This afternoon we made available the VS 2010 and .NET 4 release candidates.  You can find download links here.

    Right now the downloads are available only to MSDN subscribers.  Starting Wednesday (Feb 10th) everyone will be able to download them (regardless of whether you are a MSDN subscriber or not).

    Background on the Release Candidate

    I blogged about us deciding to ship a public VS 2010 release candidate last December.  The primary motivation behind releasing a public RC was to ensure that we could get broad testing and feedback on the performance and stability work we’ve been doing since the last public VS 2010 Beta 2 release.

    Over the last few months we’ve been releasing interim builds to a small set of folks who have been helping us validate fixes and measure very large projects and solutions.  The feedback from them has been extremely positive the last few weeks – which is why we are now opening up today’s build to a much wider set of people to people to try out.

    The RC has only been out a few hours so far – but the feedback so far on Twitter has been nice to see:

    • @DanWahlin: The performance improvements with Visual Studio 2010 RC compared to previous builds are huge. Really happy with what I'm seeing so far.
    • @peterbromberg: VS2010 RC: I must admit, I am impressed. Major speed and performance improvements. They are obvious immediately!
    • @Nick_Craver: RC performance is ridiculously faster, can't wait to switch over full time!
    • @Rlz2cool: Just tried VS2010 RC. One word incredible. Super fast, great build with things I saw in earlier releases fixed. So awesome.
    • @ddotterer: Trying out VS2010 RC: Snappier UI, much faster intellisense, significant build time reduction, etc. Overall: AWESOME JOB
    • @tomkirbygreen: Oh my goodness, VS2010 RC is much, much faster. Kudos to the VS perf team and everyone else. Uninstalling Visual Studio 2008 :-)
    • @JoshODBrown The developers on the Visual Studio 2010 RC must have had their usual beverages replaced with unicorn tears or something. #VS2010 #awesome
    • @jbristowe: Holy Butterball! VS 2010 RC is crazy fast. It makes me feel like this: http://bit.ly/cPaOvE

    Reporting Issues

    Our goal with releasing the public RC build today is to get a lot of eyes on the product helping to find and report the remaining bugs we need to fix.  If you do find an issue, please submit a bug report via the Visual Studio Connect site and also please send me an email directly (scottgu@microsoft.com) with details about it.  I can then route your email to someone to investigate and follow-up directly (which can help expedite the investigation).

    If you do install and use the VS 2010 RC we’d also really appreciate if you would fill out this survey about your experiences.

    Answers to a few questions and known issues

    Here are a few answers to some questions/known issues:

    • If you have previously installed VS 2010 Beta 2 on your computer you should use Add/Remove Programs (within Windows Control Panel) to remove VS 2010 Beta2 and .NET 4 Beta2 before installing the VS 2010 RC.  Note that VS 2010 RC can be installed on the same machine side-by-side with VS 2008 and VS 2005.
    • Silverlight 3 projects are supported with today’s VS 2010 RC build – however Silverlight 4 projects are not yet supported.  We will be adding VS 2010 RC support for SL4 with the next public Silverlight 4 drop. If you are doing active Silverlight 4 development today we recommend staying with the VS10 Beta 2 build for now.
    • We recently identified a crashing bug that can impact systems that have multi-touch and some screen-readers enabled.  We are working on a patch for people who are impacted by it.
    • We recently found an issue where project upgrades from VS 2008 can take a long time to complete if the project has .xsd files within them.  If you think VS is taking a long time on a project upgrade give it a few more minutes to complete before assuming it has hung – you might be running into this slow upgrade issue.  Note that once the project is upgraded the performance should return to normal. We are working to fix this with the final release.

    Hope this helps,

    Scott

  • jQuery 1.4.1 Intellisense with Visual Studio

    [In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu]

    A few people have emailed me recently asking about the availability of a Visual Studio –vsdoc intellisense hint file for jQuery 1.4.1. 

    I blogged about –vsdoc files in the past – they provide additional intellisense help information for Visual Studio, and enable you to get a richer intellisense experience with dynamic Javascript libraries.  If you are using VS 2008 SP1 you’ll want to download and install this patch in order to have VS 2008 automatically use –vsdoc files with intellisense.  VS 2010 has support for –vsdoc files built-in.

    jQuery 1.4.1 –vsdoc download

    The good news is that you can download –vsdoc files for jQuery directly from the jQuery web-site (look for the “Documentation: Visual Studio” link under each major version).  Here is a direct pointer to the recently released –vsdoc file for jQuery 1.4.1 that you can use.

    Hope this helps,

    Scott

  • Built-in Charting Controls (VS 2010 and .NET 4 Series)

    [In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu]

    This is the fifteenth in a series of blog posts I’m doing on the upcoming VS 2010 and .NET 4 release.  Today’s post covers a nice addition to ASP.NET and Windows Forms with .NET 4 - built-in charting control support.

    ASP.NET and Windows Forms Charting Controls

    A little over 14 months ago I blogged about how Microsoft was making available a free download of charting controls for both ASP.NET 3.5 and Windows Forms 3.5. 

    You can download and use these runtime controls for free within your web and client applications today.  You can also download VS 2008 tooling support for them.  They provide a rich set of charting capabilities that is easy to use.  To get a sense of what all you can do with them, I recommend downloading the ASP.NET and Windows Forms sample projects which provide more than 200 samples within them.  Below is a screen-shot of some pie and doughnut chart samples from the ASP.NET sample application:

    image

    Charting Controls Now Built-into .NET 4

    With .NET 3.5 you had to separately download the chart controls and add them into your application.  With .NET 4 these controls are now built-into ASP.NET 4 and Windows Forms 4 – which means you can immediately take advantage of them out of the box (no separate download or registration required). 

    Within ASP.NET 4 applications you’ll find that there is now a new <asp:chart> control within the “Data” tab of the Toolbox:

    image

    You can use this control without having to register or wire-up any configuration file entries.  All of the charting control configuration is now pre-registered with ASP.NET 4 (meaning nothing has to be added to an application’s web.config file for them to work).  This enables you to maintain very clean and minimal Web.config files.

    Learning more about the <asp:chart> control

    Scott Mitchell has written a great series of articles on the www.4guysfromrolla.com site on how to take advantage of the <asp:chart> control:

    1. Getting Started - walks through getting started using the Chart Controls, from version requirements to downloading and installing the Chart Controls, to displaying a simple chart in an ASP.NET page.
    2. Plotting Chart Data - examines the multitude of ways by which data can be plotted on a chart, from databinding to manually adding the points one at a time.
    3. Rendering the Chart - the Chart Controls offer a variety of ways to render the chart data into an image. This article explores these options.
    4. Sorting and Filtering Chart Data - this article shows how to programmatically sort and filter the chart's data prior to display.
    5. Programmatically Generating Chart Images - learn how to programmatically create and alter the chart image file.
    6. Creating Drill Down Reports - see how to build drill down reports using the Chart control.
    7. Adding Statistical Formulas - learn how to add statistical formulas, such as mean, median, variance, and forecasts, to your charts.
    8. Enhancing Charts With Ajax - improve the user experience for dynamic and interactive charts using Ajax.

    His articles are written using .NET 3.5 and the separate ASP.NET charting controls download – but all of the concepts and syntax work out of the box exactly the same with ASP.NET 4.

    Michael Ceranski has also written a blog post demonstrating how to use the ASP.NET Chart control within an ASP.NET MVC application.  I’m hoping someone will create some nice ASP.NET MVC Html.Chart() helper methods soon that will make this even easier to do in the future.

    Hope this helps,

    Scott

  • ASP.NET MVC 2 (Release Candidate 2) Now Available

    [In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu]

    Earlier this evening the ASP.NET team shipped ASP.NET MVC (Release Candidate 2) for VS 2008/.NET 3.5.  You can download it here.

    The RC2 release of ASP.NET MVC 2 is a follow-up to the first ASP.NET MVC 2 RC build that we shipped in December.  It includes a bunch of bug fixes, performance work, and some final API and behavior additions/changes.  Below are a few of the changes between the RC1 and RC2 release (read the release notes for even more details):

    • The new ASP.NET MVC 2 validation feature now performs model-validation instead of input-validation (this means that when you use model binding all model properties are validated instead of just validations on changed values of a model).  This behavior change was based on extensive feedback from the community.
    • The new strongly-typed HTML input helpers now support lambda expressions which reference array or collection indexes.  This means you can now write code like Html.EditorFor(m=>m.OrdersIdea) and have it correctly output an HTML <input> element whose “name” attribute contains the index (e.g. Orders[0] for the first element), and whose “value” contains the appropriate value.
    • The new templated Html.EditorFor() and Html.DisplayFor() helper methods now auto-scaffold simple properties (and do not render complex sub-properties by default).  This makes it easier to generate automatic scaffolded forms.  I’ll be covering this support in a future blog post.
    • The “id” attribute of client-script validation message elements is now cleaner.  With RC1 they had a form0_ prefix.  Now the id value is simply the input form element name postfixed with a validationMessage string (e.g. unitPrice_validationMessage).
    • The Html.ValidationSummary() helper method now takes an optional boolean parameter which enables you to control whether only model-level validation messages are rendered by it, or whether property level validation messages are rendered as well.  This provides you with more UI customization options for how validation messages are displayed within your UI.
    • The AccountController class created with the default ASP.NET MVC Web Application project template is cleaner.
    • Visual Studio now includes scaffolding support for Delete action methods within Controllers, as well as Delete views (I always found it odd that the default T4 templates didn’t support this before).
    • jQuery 1.4.1 is now included by default with new ASP.NET MVC 2 projects, along with a –vsdoc file that provides Visual Studio documentation intellisense for it.
    • The RC2 release has some significant performance tuning improvements (for example: the lambda based strongly-typed HTML helpers are now much faster).

    Today’s RC2 release only work with VS 2008 and .NET 3.5.  We’ll shortly be releasing the VS 2010 RC (which will be available for everyone to download). It will include ASP. NET MVC 2 support built-in (no separate download required).

    Hope this helps,

    Scott

    P.S. The source code for the ASP.NET MVC RC2 release (along with a MVC futures library that goes with it) can be downloaded here. You can learn even more about ASP.NET MVC 2 by reading the ASP.NET MVC 2 blog series I’m working on.

This Blog

Syndication

Powered by Community Server, by Telligent Systems
'