Visual Studio 2008 Team Suite - SharePoint Workflow templates disappeared

by michaellotter 9. December 2008 14:44

The below post was a big senior moment for me because it took me several hours to figure out what was so obliviously wrong.  This post is for anybody else that has one and for my next one.  Smile  

Just recently I installed Visual Studio 2008 Team Suite on the same VPC that I had Visual Studio 2008 and Visual Studio 2005 installed on.  I was really excited about getting to use it until I noticed that the VSTO for Office 2007 wasn't displaying any templates.

 

This was really bad for me because I've been using the SharePoint Workflow template for my current project and I need to create 2 more workflows this week.  I searched the web for a solution and I couldn't find anybody else having the same problem or a solution.  I kept troubleshooting the problem but was striking out big time.  After a couple days of trying to figure it out casually I decided to dig in for a final stand and figure out what was wrong.  I started out uninstalling VS 2005 and VS 2008 Professional and rebooted but nothing different.  Then I installed SP1 for 3.5 and VS 2008 but when I rebooted nothing different.  Then I uninstalled MOSS SDK, WSS SDK and SharePoint Extensions and reinstalled with the latest bits and rebooted but still nothing different.  I was starting to get a little desperate at this point and I started looking at all the settings in VS and on the New Project pop-up window then I noticed that the default .NET Framework was 3.0 and not 3.5.  I changed it to 3.5 and all my templates magically appeared.  It would have been really nice if they had a dummy message appear saying "hey dummy wrong framework use 3.5 to see these".  Once I switched the .NET Framework to 3.5 everything appeared magically. 

 
To be honest I'm glad that it wasn't a major problem and I don't have these moments that often.  I hope everybody is having a better week than me.
 
Cheers 

Tags:

Microsoft Visual Studio 2008 | vsto

Creating a .NET Class from a InfoPath form data source using xsd.exe program

by michaellotter 5. December 2008 15:09

When doing InfoPath form development I’m always doingcertain things on a consistent basis and one of them is building a .NET Classfrom my InfoPath form data source.  Theapproach that I’m going to mention can be done in either version but theexample that I’m going to show is for InfoPath 2007.  The reason for building a .NET Class from myInfoPath data source is because I’m usually using the form with a SharePoint2007 workflow (Visual Studio 2008) or .NET Web Service for submitting data to adatabase.  The way I do it is very simpleand keeps the coding process from getting to complex.  Key thing for me is to make things simple andeasy to maintain.  Something to keep inmind is that we’re not building high transaction applications but InfoPath formsfor gathering information from people.   In this article I’m going to show how to takean “Employee Status Report” form data source and convert it into a C#Class.  If you’re a VB.NET person noworries because the process will be exactly the same except for one piece andI’ll point that out.  One more itembefore we get started, when I’m working with InfoPath 2007 forms first then Ialways do is save my form to a project folder but unpackaged.  To do this just use the “save as sourcefiles” command from the “File” menu.

 

The reason for doing this is to have the flexibility to getto any of the files that I want.  Forthis instant I want access to the “myschema.xsd” and “manifest.xsf”.  The “myschema.xsd” file is the XSD file forthe data source that is built with InfoPath designer and the “manifest.xsf”file is the main with all the instructions and makes InfoPath designer launch.

Now let’s take a quick look at the form for this example andthe design of the data source for the form.

  

As you can see the form is very simple but it’s reallyimportant to make sure that the data source is design logically and makes sincebecause we’re going to be using it as an object.  After a quick glance I’m sure you noticedthat “MyFields” was renamed to “EmployeeStatusReport”.  This was done to make sure it has a uniquename and could differentiate itself from other InfoPath form data sources.  Everything else is just named descriptivelyto make sure it’s understandable from the code. I’m not saying that my name approach of the fields is the way to go andany approach would be acceptable as long as its descriptive.

Now that the form is built and saved to my project folderwere going to close InfoPath and open “Visual Studio 2008 Command Prompt”.  The program is located on my machine at“Start -> Microsoft Visual Studio 2008 -> Visual Studio Tools”.  Once the command window is open navigate outto the location of your InfoPath form files. It should look something like the below image.

The file that we are after is the “myschema.xsd” file.  Now that we are in the location of the files let’srun the xsd.exe program to generatethe .NET Class.  Below is the commandline statement that I use but there are many more options available and you canread all them by typing in xsd.exeand hitting enter.

C# version:

xsd.exe /c /l:CSmyschema.xsd

VB.NET version:

Xsd.exe /c /l:VBmyschema.xsd

Once its done running (which should happen in matter of seconds)a message should appear saying that it wrote a new file called “myschema.cs”.

Once the file has been generated I just go rename the fileto the namespace name and then add it to my Visual Studio SharePoint workflowor .NET Web Service project.  Once thefile is available in the project you have the capability to bind the datasource to the .NET Class and you have all your data is available in astandardized format.  If you ever makechanges to your InfoPath data source you’ll need to rerun the xsd.exe commandagainst the new “schema.xsd” file and then just delete the old .NET Class fromthe Visual Studio project and add the new .NET Class to the project and you’redone.

I’ve talked with a lot of hard core developers in the pastabout this approach and a lot of them just look at me strange because I’mhaving a program build the code for me but to be honest it works and I don’tsee anything wrong with it for what I’m using it for.  The cool thing is I never have to make anymodifications to that code file and it’s all generated by the xsd.exe program.  For me this is a great way to get clients tostandardize there development process for building and supporting InfoPathforms.

After this weekend I’ll be putting together a couple morearticles on how I use the .NET Class with a .NET Web Service and Visual Studio2008 SharePoint Workflow project. When reading the next articles you’ll noticethat everything is just as simple as this one is.  Simplicity is my main goal and notcomplexity.

Cheers

Tags:

InfoPath 2007 | Microsoft Visual Studio 2008 | xsd.exe

Easy way to build a .NET Class from your InfoPath form data source

by michaellotter 28. November 2008 11:58

 

When I started my consulting career up again I didn’t have a lot of experience working with XML, XSD or .NET from the application development side but had experience with SharePoint and .NET Console applications.  When I started my new job I was lucky enough to work with a fellow named Josh Carlisle on a project and he taught me how to build my data structures with an XSD file and then convert to a .NET Class with the XSD.exe tool.  It took me awhile to fully understand everything but once I did it made my life so much easier.  Later that year I started working with InfoPath 2003 and at one point during that year I got involved with a large project that required me to add all the data that was collected from a InfoPath form and submit it to a database.  I thought at first this was going to be a royal pain because of the learning curve for XPath and XML (didn’t know it that well) but then I remembered that all InfoPath forms have a XSD file and it could be just a simple of taking that XSD file and converting to a .NET Class with the XSD.exe tool and then binding the InfoPath data source to the .NET Class.  So, I gave it a shot and amazingly enough it worked.  The project ended up being painless because I used this method and it also cut down on the development life cycle.  It’s now the end of 2008 and Office 2003 is just a memory for me and Office 2007 is in full swing but one thing that hasn’t changed is how I read all my data from my InfoPath forms when using them with either a Web Service or Workflow.  That’s right I said workflow, I use the same technique for workflows too because I’m still using InfoPath forms but now with Workflows.  Granted the method is not as simple as with Web Services but it’s still really easy and gives my clients a very structured approach for reading the data from an InfoPath form.  In the coming week I’m going to write two posts on how to do this with a Web Service and Workflow but now it’s back to work for me. Hope everybody had a good day off.

Cheers,
Michael

 

Tags:

InfoPath 2007 | Microsoft Visual Studio 2008

Debugging a InfoPath Forms Services or Form Server form (InfoPath 2007)

by michaellotter 13. March 2008 14:24

Last week B&R Business Solutions won a contract for a SharePoint and FBA installation and that got me on the kick of FBA again. Last weekend I built some code to retrieve the username for a FBA user and during that process I ended up wanting to debug my browser based InfoPath 2007 form. This was going to be the first time for me to try this because in the past I've always made my forms code free because I never wanted any of my clients to maintain code for InfoPath 2007 form if it could all be built in Visual Studio Web Service or Class project. My thought was it should be extremely easy to do because I had a Visual Studio 2008 VSTO InfoPath 2007 project and the form was web based. I was hoping debugging was going to be as easy as SharePoint debugging is and believe it or not it was. To debug my web based form all I had to do was attach the w3wp.exe process where my InfoPath 2007 web based form was running under to my Visual Studio 2008 VSTO InfoPath 2007 project and set my break point in the code. I was really surprised it was this easy to do because I was guessing that there had to be something funky to make it work but I was totally wrong.

Since I'm doing this extra SharePoint/FBA project with Nas, I only suspect that I will do more things with InfoPath and FBA. Most likely I will end up building a new .NET Class for retrieving FBA user information based off user id for pre-populating web based InfoPath 2007 forms.

Well it's time for me to get some sleep because I've a lot of things to do tomorrow. I hope everybody has a great weekend.

Cheers,
Michael

Tags:

InfoPath Forms Services | Microsoft Visual Studio 2008

Speaking at the South Florida Code Camp on February 2nd

by michaellotter 20. January 2008 23:57

That's right it's time for the South Florida Code Camp and I'll be down there giving a new session on InfoPath 2007 and Visual Studio 2008.  For this session I'm thinking about changing a couple of things around and doing some really new stuff that includes C# code for updating AD and XMLFormView control for displaying an InfoPath 2007 form.  I'm thinking that the InfoPath 2007 form will be a data entry form that allows users to update their AD information.  I've been thinking about this new presentation for a while and since Visual Studio 2008 was officially released I figured that I should also change up the InfoPath part.  I'm really excited about building the new code and presenting it and after the code camp is over I'll post it on my Code Camp and User Group page.

All the information about the South Florida Code Camp can be found on the http://codecamp08.fladotnet.com/ website.  From what I heard while at Philly Code Camp from other speakers this code camp is suppose to be as big as or bigger than the Philly Code Camp one.  To see what sessions are currently on tap checkout the agenda page http://codecamp08.fladotnet.com/agenda.aspx.  The code camp is going to have 12 different tracks and that means tons of sessions.  The "SharePoint/ Office" track already has my "InfoPath 2007 and Visual Studio 2008" session and "Utilizing Visual Studio 2008 capabilities for better SharePoint Development Part 1 and Part 2" sessions on tap.  In my opinion this track is already shaping up to be a killer track.

I'm really excited about this code camp and I'm glad to have the chance to speak at it and I hope to meet some new SharePoint colleagues there to.  Well I'm about all posted out for the night.  Hope to see some of you there.

Cheers

Tags:

InfoPath 2007 | Public Speaking | Code Camp | Microsoft Visual Studio 2008

Visual Studio 2008 VSTO and InfoPath-2007 error when trying to run debug

by michaellotter 13. January 2008 22:24

On Saturday when I was adding my finishing touches to my demo for the Philly Code Camp I ran into an error with Visual Studio 2008 VSTO and InfoPath 2007. Whenever I tried to run my InfoPath 2007 form in debug mode I got the following error.

 

"Microsoft Office InfoPath does not recognize some or all of the command line options. Exit and restart Microsoft Office InfoPath with the correct command line options"

When I discovered this error and found out that it happened with a brand new project my heart started to beat a little faster (ok lot faster) because I knew the pressure was on to fix the problem before my session started. I started to do searches on the internet and I couldn't find any answers and then I did one final search and I found some link that talked about a similar error with Visual Studio 2008 Beta 2 and another office application. It mentioned about updating Office 2007 with a patch to fix the error. After reading that I looked at the version I was running and notice that I wasn't running SP1 for Office 2007 and decided to install that and see if it would fix the error. Luckily I had internet access at the code camp and started the download and about 30 minutes later I got it downloaded and installed. Then I crossed all my fingers and toes and tried the debug mode again and it worked. By installing SP1 for Office 2007 fixed the problem. I'm sure there will be many more little things pop-up and if I run into them I'll be sure to post them.

By the way Philly code camp rocked the house and I'm glad that I got a chance to speak.

Cheers

Tags:

InfoPath 2007 | Microsoft Visual Studio 2008

About me

Michael Lotter
B&R Business Solutions
SharePoint Solution Architect
MCTS
More...

 

SharePoint Saturday

SharePoint Saturday is a free event open to the public and is focused on all aspects of SharePoint and related Microsoft Office technologies.  
  

 

 

 

 

 

 

Calendar

<<  March 2010  >>
MoTuWeThFrSaSu
22232425262728
1234567
891011121314
15161718192021
22232425262728
2930311234

View posts in large calendar

RecentComments

Comment RSS