Oct 28 2009

How to workaround the Error: “The application cannot start.” in Visual Studio 2010 Beta 2

Category: amilsark @ 17:17

I witnessed this error after a failed attempt to upgrade an ASP.Net MVC 1.0 application to ASP.Net MVC 2 using Visual Studio 2010 Beta 2.  When I closed Visual Studio 2010 Beta 2 and tried to reopen it, the application crashed with the error “The application cannot start.

 

I found this Microsoft connect article which helped me solve the problem.  Microsoft Connect

 

Steps I took:

1. Open a command prompt

2. Type:  cd “C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE”  (notice I’m using a x64 machine, the program files directory would be different on a 32 bit system)

3. Type: devenv /resetuserdata

This will reset your language preference that you select when you first load Visual Studio 2010 Beta 2.  My custom fonts (sizes, colors, etc) were retained.

 

Now Visual Studio 2010 Beta 2 loads again.  This is a bug that might be related to a raster font, but this should get you back up and working for now.

Tags: , ,

Oct 20 2009

SharePoint 2010 Service Applications (Shared Services) Overview

Category: amilsark @ 17:04

In the new service infrastructure powering SharePoint 2010, there are some significant changes and additions.

For starters these services are now called Service Applications and there is no Shared Services Provider (SSP).  Certain service instances can now be used across farms!

 

Configuration Flexibility

Web applications can be configured to only use a subset of the deployed services.

You can deploy multiple instances of the same service in a farm by giving the new service instances unique names.

You can share services across multiple web applications in a farm.

Services Can Even Be Shared Across Farms

Certain services that support sharing instances across farms can be run on a central farm in your company’s WAN and allow you to manage that service in one place.  A good example of this might be the User Profile Import service.  If your LOB system is located in one regional office you can run a specific instance of the Business Connectivity service for communication with that system locally and consume that data from other locations.

Service Application Architecture

These applications are deployed to IIS in a single web site (“SharePoint" Web Services”).  It is recommended to run this web site under one application pool for optimal performance.

Deploying Services

There are 3 ways to deploy services:

1. Selecting services when running the configuration wizard

2. Adding services through the Manage Service Applications page in Central Administration

3. Use power shell (replaces STSADM command line)

Service Descriptions

Service App Description Data Store Cross Farm SharePoint Foundation 2010 SharePoint Server 2010 Standard SharePoint Server 2010 Enterprise
Access Services View/Edit/Interact with Access 2010 DB’s in the browser Cache       X
Business Data Connectivity Access LOB data DB x x x x
Excel Services View/Edit/Interact with Excel 2010 files Cache       X
Managed Metadata Service Access managed taxonomy hierarchies, keywords, and social tagging infrastructure as well as Content Type publishing across site collections DB x   x x
PerformancePoint Provides the capabilities of PerformancePoint Services Cache       x
PowerPoint View/Edit/Broadcast PowerPoint presentations in a web browser Cache       x
Search Crawls content, produces index partitions, serves search queries DB x   x x
Secure Store Services Provides single sign-on authentication to access multiple applications or services DB x   x x
State Service Provides Temporary Storage of user session data for SharePoint Server components DB     x x
Usage and Health Data Collection Collects farm wide usage and health data and provides the ability to view various reports DB   x x x
User Profile Adds support for My Sites, Profile pages, Social Tagging, and other social computing features DB x   x x
Visio Graphics Service Viewing and refreshing of Visio diagrams in the browser BLOB cache       x
Web Analytics Provides Web Service interfaces   x      
Word Automation Services Performs automated bulk document conversions Cache       x
Microsoft SharePoint Foundation Subscription Settings Service Tracks subscription ID’s and settings for services that are deployed in partitioned mode.  Windows Powershell only DB   x x x
Office Web Apps (Separate SKU)            
Word 2010 Viewing, PowerPoint 2010, Excel Services in SharePoint Server 2010, OneNote 2010 Allows you to create and collaborate with Office documents through the browser.   These documents are no different than creating them in the client applications.          

 

One question i have:  Is there still search functionality in SharePoint Foundation 2010?  I’m assuming the Search Service above refers to the MOSS Indexing style with crawl schedules and such.

Tags: , ,

Oct 19 2009

New SharePoint 2010 Documentation Released!

Category: amilsark @ 19:45

Today with the kickoff to SharePoint Conference 2009, Microsoft has released a lot of new documentation.

There are many exciting features and improvements with this release!

Also exciting is that a public beta will be available in November!

 

MSDN: http://msdn.microsoft.com/en-us/library/dd776256.aspx

Microsoft Download Center: http://www.microsoft.com/downloads/en/results.aspx?pocId=&freetext=sharepoint%202010&DisplayLang=en

 

I will be blogging about my experiences with SharePoint 2010 in the coming months.

Tags: , , ,

Oct 5 2009

Send Instant Message Notifications from your .Net Applications!

Category: amilsark @ 21:44
 
I’ve been interested in figuring out how to notify someone of an interesting application event by other means than just email.
This led me to find the MSNPSharp .Net Instant Messaging Library.  This library works with the MSN Instant Messaging Protocol.
 
Here are some features of the current version (2.5.7 with 3.0 coming out Fall 2009) – borrowed from the MSNPSharp Google code site (http://code.google.com/p/msnp-sharp/)
 

Features

The library currently supports the following features:

Messaging
Address Book
Roaming Profile
Nameserver(NS) and Switchboard(SB)
  • Signing in from multiple places (MPOP)
  • Support for bots (Provisioned_Accounts)
  • Hotmail mailbox status
  • Notifications of new mail
  • Setting presence status
  • Request or receive conversations
  • Multiple users in one conversation
  • File transfers
  • P2P framework support
  • Flexible tracing of warnings and errors
  • Proxy support and custom servers
 
 
 

How I Use It:

 
I implemented a simple ‘SendIM’ method as part of a Notification class.  This will simply connect to the MSN service with my IM account credentials and then
send an instant message with whatever text we choose.   If you noticed in the features list of this library, it can do offline messaging.  I’m not sure exactly how that works yet,
but it is worth understanding a little more. 
 
 

Download the binaries from http://code.google.com/p/msnp-sharp/.
Add a reference in your project to the MSNPSharp library.
 
Follow the below code to create a one way Instant message to the email address ‘contact’ you pass in.  The account you use
must be a valid account with live.com or hotmail.
 
I’ve found that we need the Thread.Sleep  in order to give it time to connect or else a null reference exception is thrown on the
conv.Switchboard.SendTextMessage(message) line.
 
   1: public void SendIM(string contact)
   2:         {
   3:            var  messenger = new Messenger();  
   4:             var message = new TextMessage("This works!! Give Andy a dollar... Now please..");
   5:             messenger.Credentials.Account = "youraccountemailaddress";
   6:             messenger.Credentials.Password = "yourpassword";
   7:             messenger.Nameserver.BotMode = true;
   8:             messenger.Nameserver.AutoSynchronize = false;
   9:             messenger.Connect();
  10:             System.Threading.Thread.Sleep(5000);
  11:  
  12:             try
  13:             {
  14:                 var conv = messenger.CreateConversation();
  15:                 conv.Switchboard.Invite(contact);
  16:                 System.Threading.Thread.Sleep(5000);
  17:                 conv.Switchboard.SendTextMessage(message);
  18:             }
  19:             catch(NullReferenceException nullex)
  20:             {
  21:                  //fall back email or logging   
  22:             }
  23:             catch(Exception ex)
  24:             {
  25:                 //fall back email or logging
  26:             }
  27:  
  28:         }

 

If you have anymore experience with this library or Instant message protocol please comment and share any gotchas or ideas you might have that might help myself and the community.

Tags: , , , ,

Oct 1 2009

ASP.Net MVC 1.0 and Html.CheckBox

Category: amilsark @ 18:40

With a background in ASP.Net web forms, the Html.CheckBox used with ASP.Net MVC did not behave how I thought it would.

For example when adding a checkbox to the View inside a table:

   1: <%=Html.CheckBox("cb" + item.player.idPlayer)%>

Firebug shows me this rendered in the html source of the page:

image


What is that hidden field for???


A developer on the Microsoft ASP.Net team said that this was by design so that we can properly assign a value of ‘false’ to an unchecked checkbox (link). 

I’m assuming this was the fix for the issue in the MVC 1.0 RC builds where a null value was being returning for unchecked checkboxes.


But in ASP.Net MVC 1.0, here is what the Request.Form values are (notice all checkbox inputs are listed with either a value of ‘false’ or ‘true’):

image

 


So in my case to loop through the returned inputs and grab the Player ID’s which have been checked:

Here is the controller action code to look for checked checkboxes (from Andrey Tkach on Stack Overflow):




   1: var selectedPlayerIds = new List<int>();
   2:             IEnumerable<Player> players;
   3:  
   4:             foreach (string key in Request.Form)
   5:             {
   6:                 var checkBox = String.Empty;
   7:                 if(key.StartsWith("cb"))
   8:                 {
   9:                     checkBox = Request.Form["" + key];
  10:                     if (checkBox != "false")
  11:                     {
  12:                         int id = Convert.ToInt32(key.Remove(0, 2));
  13:                         selectedPlayerIds.Add(id);
  14:                     }
  15:                 }
  16:             }





I am now able to use these playerID’s for interaction with the repository and perform interesting logic.

Tags: , ,