Now the Visual Studio® 2008 Web Deployment Projects - RTW is released. This version of the Web Deployment Projects add-in is a 2008 version of the Web Deployment Projects for Visual Studio 2005.
With the deployment projects add-in you can control the deployment of your web Application easily. You configure it once and with the click of a button you can get a precompliled version of your application.
It really is a XML (project) file, containing the configuration for all your builds (debug, test, release or whatever). In combination with the Web Setup Project (you can make the Web Deployment Project the source for your Web Setup) it is really easy to create Setups for your Web Application. 

Download it here: http://www.microsoft.com/downloads/thankyou.aspx?familyId=0aa30ae8-c73b-4bdd-bb1b-fe697256c459&displayLang=en

Henry Cordes
My thoughts exactly...

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Blogengine.net

Published 1/26/2008 by Henry in ASP.NET

While I changed the bloggingengine for this blog from dasBlog to subText some time ago (because I wanted SQL server support instead of XML Files), a fellow developer pointed me to blogengine.net.

My main reason for wanting to change this fast again is that in my opinion blogengine.net is the best option at this moment in time. It provides XML and SQL Server support through the provider model, so a new datasource is easily integrated. I think because it has not been around that long it's foundation is pure ASP.NET 2.0. Blogengine.net has learned from the mistakes that dasBlog, subText etc. have made.
In software development projects sooner or later we always come for the choice: 'Are we going on on this path, or are we going to built from scratch?'. I think that blogengine.net is a good example that it sometimes can be rewarding to start all over.

Anyway I moved to blogengine.net so now I have tag support and a new layout once more. 
Blogengine.net is available on Codeplex.

Henry Cordes
My thoughts exactly...

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Microsoft Press have just released an e-book on Visual Studio 2008 technologies and are giving it away for free. The e-book includes excerpts from three recent book releases and provides a wealth of information and insights from top experts:

Look here

Henry Cordes
My thoughts exactly...

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

ASP.NET MVC Framework

Published 10/27/2007 by Henry in ASP.NET | Patterns

On Scott Guthrie's blog I saw that there is going to be a framework to build ASP.Net applications using the Model View Controller pattern.

What is the Model View Controller Pattern?
The MVC design pattern provides the ability to vary different software components separately. The pattern improves the software robustness and reusability.
The MVC pattern helps the software designer to fulfill the object-oriented design principles, such as the Open Closed Principle(OCP).
The idea of the OCP is that developers must decide early on in the analysis or design phase which parts of the system will be expanded later and which will stay fixed.
According to the OCP principle, the design is extended by adding new code and classes by inheriting existing base classes rather than modifying the existing ones.
Completed and tested code is declared closed, and it is never modified.


Classic design pattern Model View Controller
  • Model: Contains and manipulates the data in the program.  These are the components of the application that are responsible for maintaining state.  Often this state is persisted inside a database
  • View: defines how the data of the model is presented to the user; the view forwards received commands and requests to the controller. These are the components responsible for displaying the application's user interface. 
  • Controller:Defines how the user interface reacts to received commands and requests. These are the components responsible for handling end user interaction, manipulating the model, and ultimately choosing a view to render to display UI.  In a MVC application the view is only about displaying information - it is the controller that handles and responds to user input and interaction.

The idea is that the Presentation layer (GUI) easily can be switched from for example an ASP.Net web user interface for a windows Forms user interface.
The discussion if this is practical and will be used in real world applications always comes up when discussing this pattern.
When we switch the UI for a Unit test framework, this discussion is almost always turned over in favor for the pattern, because (Unit)testing ASP.Net Webpages can be quite cumbersome at times.
So just for the sake of (unit) testing our code alone this pattern can really add value to our work as developers.
The maintainability of the code should benefit also, because all the layers of our application are really separated and encapsulated.

The ASP.NET MVC Framework will be fully integrated with ASP.NET, which means it supports existing ASP.NET features like forms/windows authentication, URL authorization, membership/roles, output and data caching, session/profile state management, health monitoring, configuration system, the provider architecture, etc.
It will be pluggable and extensible for example: you can optionally plug-in your own view engine, routing policy, parameter serialization, etc. 
It also supports IOC container models (Windsor, Spring.Net, NHibernate) for using existing dependency injection.
You can unit test the application without having to run the Controllers within an ASP.NET process (making unit testing fast).
You can use any unit testing framework you want to do testing ( NUnit, MBUnit, MS Test).

I really am interested and will try to follow this, frankly I can't wait to try out a CTP.

Henry Cordes
My thoughts exactly...

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Microsoft ASP.NET AJAX version 1.0 Beta Released

'ATLAS', Microsoft's AJAX Framework, has changed names, the codename 'ATLAS' is no longer used.
Instead Microsoft ASP.NET AJAX is the official name. The 1.0 Beta version is now released. Download from here
ASP.NET AJAX is a free framework for creating client-centric, interactive Web applications that work across many popular browsers and on any server platform.

More information can be found here:  http://ajax.asp.net/.
Microsoft claims the AJAX framework is platform independent. In fact I quote: 'The Microsoft AJAX Library is a standalone collection of the standards-based Javascript classes included in ASP.NET AJAX. It’s supported by most popular browsers and can be used to build client-centric Web applications that integrate with any backend data provider.'

There is a migration guide in case you already implemented one of the ATLAS Beta's or the CTP that was released not that long ago. This guide is available here.
Read the Changes between the ASP.NET AJAX (“Atlas”) CTP and the v1.0 Beta Release whitepaper which is also available as a Word document and a PDF document.

Download  ASP.NET AJAX v1.0 BETA Get involved in ASP.NET AJAX forums destination-videos.gif


Henry Cordes
My thoughts exactly...

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

While trying to understand which deployment models we have in .NET 2.0 I stumbled upon the following Visual Studio 2005 add-in:

Visual Studio 2005 Web Deployment Projects

This add-in provides additional functionality to build and deploy Web sites and Web applications in ASP.NET 2.0 and Visual Studio 2005. This add-in includes a tool to merge the assemblies created during ASP.NET 2.0 pre-compilation, and provides a comprehensive UI within Visual Studio 2005 to manage build configurations, merging, and using pre-build and post-build tasks with MSBuild.

Web  Deployment Project

I think this screenshot provides a good idea about some of the the possibilities.


Henry Cordes
My thoughts exactly...

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

After a long time, I will try to start adding new items to my blog.
I started working for another organisation and I have been on vacation etc. etc.
In my new job I am doing a conversion for an application from .NET Framework 1.1 to .NET Framework 2.0.
It is an ASP.NET application containing around 20 projects.

After the conversion to a IIS Website in Visual Studio 2005 I hit the F5 key and got the message:

Unable to start debugging on the web server.
The Microsoft Visual studio Remote Debugging monitor (MSVSMON.EXE) does not appear to be running on the remote computer.

Visual Studio 2005 Remote Debugger
After searching around for a while MVSSMON.Exe is the application that resides in the Windows Start Menu under 'Microsoft Visual Studio 2005 > Visual Studio Tools' and is named: 'Visual Studio 2005 Remote Debugger'.
When I started the 'Visual Studio 2005 Remote Debugger Configuration Wizard', I could run the apllication as a service and debugging works always.
It seems that when you use the IIS Website model to develop webapps the remote debugger needs to be running (Visual Studio 'thinks' it is debugging a remote machine).

Henry Cordes
My thoughts exactly...

Currently rated 3.0 by 1 people

  • Currently 3/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Viewstate and Postback

Published 1/12/2006 by Henry in ASP.NET | C#
Tags: ,

While working on an ASP.NET project I am building kind of a wizard. There will be dynamically created input controls like textboxes, dropdownlists, radiolists etc. So I built controls that contain validation etc.
But between postbacks, while dynamically creating "new" wizardforms (different controls than on the previous one) the viewstate cannot handle this anymore.

The following information is available:

Stacktrace starts with:
[InvalidCastException: Specified cast is not valid.]
   System.Web.UI.StateBag.LoadViewState(Object state)
   etc, etc.

So on a page that contains controls, when dynamically creating controls on this page after a postback there can arise a problem with the viewstate. I consider this to be a bug, but Microsoft explains the reason why in another manner.

After asking Uncle Google I learnt the following from the MSDN website
Dynamic controls and ViewState

MSDN website:
In most scenarios, this view state processing model works fine. Typically, you add dynamic controls to the end of a container's collection of controls. The view state information stored for the dynamic controls is therefore extra information at the end of the view state structure for the appropriate container, and the page can ignore it until after the controls are created.
However, view state information about dynamically created controls can be a problem in two scenarios:

If you insert dynamic controls between existing controls.
If you insert controls dynamically and then reinsert them during a round trip, but with different values.
If you insert dynamic controls between existing controls, the dynamic control's view state information is inserted into the corresponding location of the view state structure. When the page is posted and the view state is loaded, the dynamic control does not yet exist; therefore, the extra information in view state does not correspond to the right control. The result is usually an error indicating an invalid cast.

In other words, sorry we cannot do this with ASP.NET.
I tried to sit back and think the problem over:

After postbacks I cannot rebuild the page with new controls.

Solution:
Store necessary state info in Session and use Response.Redirect(url); to redirect the aspx page to itself.

Microsoft does not even mention this in the article.

Henry Cordes
My thoughts exactly... 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

.NET Framework version... (2)

Published 12/12/2005 by Henry in ASP.NET
Tags:

I found a tool that does all the stuff I wrote about in this article. I think this is a helpful tool even if in version 2005 of Visual Studio Microsoft added something similar. I work on a project were no Visual Studio 2005 or Framework 2.0 is available and I use the tool a lot.

Here you can find the tool I talk about http://www.denisbauer.com/NETTools/ASPNETVersionSwitcher.aspx, it is called: Version Switcher.

Henry Cordes
My thoughts exactly...

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Load document in iframe dynamically

Published 11/3/2005 by Henry in ASP.NET | C#
Tags:

Supose you need to show an xml, html or aspx document inside an ASP.NET page. So you actually want to embed another page or document inside the original page. You want to load a document in an iframe dynamically from the server-side.
What you really need is an iFrame server control. However an iFrame is an html control and it's properties are not directly available at the server side (in the codebehind). So we need a way to access the 'src' property of the iFrame directly. Inside the iFrame's tag in the html of the aspx page we set the 'runat' attribute with the 'server' value.

   1:  <iframe id ="MyIframe" runat ="server"> 
   2:  </iframe> 

In the aspx.cs (codebehind) file we declare a System.Web.UI.HtmlGenericControl and name it (the name does not have to be the same as in the html page, but I think it is good practice to do so).

   1:  protected System.Web.UI.HtmlControls.HtmlGenericControl MyIframe;

We create a method we can call in order to load a document in our iFrame by using the FindControl method of the System.Web.UI.Page and typecast it This way we can acces all properties of the HtmlControl through the Attributes property. The "MyIframe" referred in Find Control is the ID as declared in the ASPX Page.

   1:  private void LoadDocumentInIFrame(string url)
   2:  { 
   3:      HtmlControl MyIframe = (HtmlControl)this.FindControl("MyIframe"); 
   4:      MyIframe.Attributes["width"] = "100%"; 
   5:      MyIframe.Attributes["height"] = "400px"; 
   6:      MyIframe.Attributes["src"] = url; 
   7:  }
   8:   
   9:   
  10:  // Example that calls the method
  11:  LoadDocumentInIFrame("http://www.google.com")


This way we can load a document in an iframe dynamically from server-side.
With the FindControl() we can get a reference to the HtmlGenericControl object and access the properties of it. As you will understand this is not limited only to the iFrame, but can be used for more 'HTML' controls.

Henry Cordes
My thoughts exactly...

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5