Minimize
Posted By Néstor Sánchez on Thursday, July 09, 2009 10:23 PM

After learning Silverlight 3 was going to be launched on July 10 I got ready to install it on my dev machine. I went to the official website and was greeted with this message:

image

Right below that there was a System Requirements link and after following it I saw a chart that did not show support for IE8 in Windows 7 (I forgot to take a screenshot). I quickly sent a tweet (@hooligannes) the info and got replies from two people who didn’t have any problems, so I decided to dive in. Here’s what happened.

Failed Runtime Installation
A short while after pressing on the Click to Install button, I was shown a message that said that I could not install Silverlight without updating my development tools first. My guess is that users without a dev environment with Silverlight tools will not see this. I can’t validate though. It is too bad that a link to the dev tools is not provided in that screen. That could definitely be improved.

Silverlight Tools Installation
A few clicks later I was on the downloads page for the Silverlight 3 Tools For Visual Studio 2008 SP1

image

The installer informed that it would prepare the download, get the runtime, clean the installation, uninstall the Silverlight 2 Tools, update Visual Studio, install the SDK and then install the tools. The screens of the installation progress follow:

image

image

image

clip_image001

clip_image002

clip_image003

clip_image004

 

image

Naively, I did this install with IE open. I was still on the Silverlight home page, after pressing on the Click To Install button again I was surprised at the failure message. It said that I already had the runtime. Of course, closing the browser and reopening it did the trick and I could see the site like this.

image

 

For those who will just need to install the runtime, the screens below show what will happen (Except for the “Finished” screen, which I did not capture):

image

image

 

image

Posted By Néstor Sánchez on Thursday, May 21, 2009 6:18 PM

Touching too many pieces at once almost always causes errors and that became evident when I began to see the error of this post’s title. My VS2008 install was missing the asp.net templates and I could not understand why -later on I realized it was because I had not selected a component during the original install-, and tried several suggestions like running devenv.exe /installvstemplates from the command prompt and resetting VS settings in the Import and Export Settings menu.

Long story short, those brought more problems. I just needed to add the component, but now the VS installer would not run. Avoiding a longer delay I attempted to work on an existing project, but then I could not load the Controls Toolbox without facing three more errors now related to SQL components. Running the SQL Repair halted mentioning a VS problem.

I was doomed. OK, I am being dramatic, but it was a drag!

I decided to re-install VS. And what do you know, I couldn’t run the installer. A forced unsinstall was required now. A short search and Aaron Stebner’s blog post came to the rescue.

After uninstalling VS, I re-installed it, ran SP1 and repaired SQL. I am safe again, so I thought I’d save someone else the effort of finding VS Product GUID and post the command to uninstall Visual Studio Team System 2008.

msiexec /x {80C06CCD-7D07-3DB6-86CD-B57B3F0614D8}

If you have a different version, you’ll need to find it. Just read Aaron’s post and follow the steps to get the msiinv tool and obtain a list of installed applications according to msi.

Note: this is not always what you need to do. It was my last resource, so use it when the re-installation of templates does not work, and causes Packages registration to go awry.

Posted By Néstor Sánchez on Saturday, May 16, 2009 9:08 PM

Last week, I noticed Dynamics CRM had become slower and my DB had grown too large for the amount of real records I expected it to have. After some investigation I realized it was a combination of things.

The symptoms of a problem
There were way too many Matchcode Update records with a Waiting status. The normal System Jobs report can’t show more than 250 records at once and I had gone through several pages already. This simple SQL query showed that there were more than 100.000 records.

Select COUNT(*) As TotalWaitingTasks from dbo.AsyncOperationBase where StatusCode=10

This was going to take a long time to solve. (It took me about 8 hours to have the DB back to a normal size, because its server is not specially powerful).

I found several posts that suggested changing the status, the posts offered code to do it programmatically, but due to the number of records I’d have to modify them to be able to do it in chunks, avoiding a prolonged database lockout. The console utilities were too involved and after doing some investigation I realized that the fields I needed to change were two in a single table. Another simple SQL Query took care of it in a few hours.

Update dbo.AsyncOperationBase
Set StatusCode = 32, StateCode = 3
where OperationType = 12 and StatusCode=10

The OperationType value is for MatchCode Update, later on I found a few other workflows, so I just changed this the corresponding value. The value of 10 in StateCode is for “Waiting” and setting it to 3 is equivalent to “Completed”

I could’ve wrapped this one to do it chunks, but the day was over and nobody would be using the DB until the next day so I left it running.

Day 2
Early next day the update had finished. All System Jobs involved had been canceled. Next steps, delete the records and then shrink the DB.

However before I set out to delete them I needed to find the cause while the data was still there. Another simple query was needed:

Select Top 5 [Message] from dbo.AsyncOperationBase where StateCode = 3

I just get the first five, because obviously the result set would be way to big. In the field the reason was clear, it was a communication problem. The Message field showed an error stack trace:

System.Net.WebException: The request failed with HTTP status 400: Bad Request.
     at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, _ 
WebResponse response, Stream responseStream, Boolean asyncCall)
     at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
     at Microsoft.Crm.SdkTypeProxy.CrmService.RetrieveMultiple(QueryBase query)
     at Microsoft.Crm.Asynchronous.SdkTypeProxyCrmServiceWrapper.RetrieveMultiple(QueryBase query)
     at Microsoft.Crm.Asynchronous.UpdateContractStatesOperation.ExpireContracts()
     at Microsoft.Crm.Asynchronous.UpdateContractStatesOperation.InternalExecute(AsyncEvent asyncEvent)
     at Microsoft.Crm.Asynchronous.AsyncOperationCommand.Execute(AsyncEvent asyncEvent)
     at Microsoft.Crm.Asynchronous.AsyncHostHandler.Handle(AsyncEvent asyncEvent)
     at Microsoft.Crm.Asynchronous.QueueManager.PoolHandler.ProcessAsyncEvent(AsyncEvent asyncEvent)

 

 

A quick look around and I found that this was due to an incorrect value for AsyncSdkRootDomain in the DeploymentProperties  table. Yet another simple query.

SELECT [ColumnName],[NVarCharColumn]
  FROM [MSCRM_CONFIG].[dbo].[DeploymentProperties]
  Where [ColumnName] = 'AsyncSdkRootDomain' 

The value in this field has to be like where “server” matches the name of the host where Dynamics CRM is installed, and port the port used when installing it. The standard default port is 5555. Therefor, for a host called BIGSERVER with a standard install it would be “BIGSERVER:5555”.

After changing the value to the correct one, and verifying that connection was successful I used a query I used this query from Microsoft Support to delete the Cancelled jobs. The query is originally intended to fix a problem with all completed jobs, which includes cancelled and successful ones. When used, some history for workflows will be lost. This was not an issue for me and I ran it with confidence.

The query also took a long time to run, but in the end it did its job. If you inspect it you will see that it appropriately does the job in steps limited to 2000 records and also uses transactions in case any errors happen.

I repeated this steps for other Testing organizations and I went to bed happy with the results of the day.

Posted By Néstor Sánchez on Tuesday, March 17, 2009 3:37 PM

I worked in broadcasting and journalism long before I got involved in technology and it is another passion of mine. While my love for DNN progressively increased, I would devour as much information as I could find. In the DNN 2.X days, most of the available information was at the asp.net forums where at first I was a lurker, then a question flooder and finally even became a moderator (I still am). I always wanted to get involved with DNN and my

Sources of information have been sprouting (and also dwindling) around. One of my favorites was Seablick’s DNN Friday, but it is lagging behind. The problem is that a set deadline for your publication will almost surely be missed when business endeavors that pay the bills get in the way. Arguably, a huge number of community members are blogging about DNN and there’s no single comprehensive resource. Fortunately, that is bound to change and to start the path I am getting my DNN paws trained again to write read and write about DotNetNuke.

As a self-trained IT/Dev pro I have learnt that setting too high a goal will only doom my commitment. Therefore I’ve made a compromise with myself. I will only publish this round up when material is enough to make it worthwhile reading. Obviously, I have chosen the easiest and most informal way to publish it. It may transmogrify into a whole new animal in time, but I am satisfied to do it in this way, for now. Without any further ado, You can find DNN Round Up #1 at the DotNetnuke Blogs.

Posted By Néstor Sánchez on Thursday, October 18, 2007 2:28 PM

After releasing a module, sometimes a reorganization of files is performed in the development environment. Regardless of the method used to place the files in the corect locations, some locations will still contain the original files.

For some time DNN has been able to perform a clean up (deletion) of files. This is achieved by including a text file in the PA with the version number in the  ##.##.##.txt format and it should list the paths and filenames that should be deleted.

For example to delete the MyFile.ascx file, just include its name in the .txt file. If the file is within a directory like /DesktopModules/MyModule/MySubDirectory/MyFile.ascx, remove the DesktopModules/MyModule path to obtain only a path relative to the module folder: MySubDirectory/MyFile.ascx.

Posted By Néstor Sánchez on Thursday, October 18, 2007 2:28 PM

 

 

After enabling AJAX, it's pretty easy to declaratively add an animated image using the UpdateProgress control from the Toolkit controls and an animated gif image. This post assumes you already know how to enable AJAX in your module, if not refere to this previous post.

After enabling AJAX in DNN in any of the two ways detailed in the mentioned post, add an Update panel with a Label and a button control.

<asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate>

<asp:Label ID="Label1" runat="server" Text="Label">asp:Label><br /><asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />ContentTemplate>asp:UpdatePanel>

Add the UpdateProgress control to your .ascx file and set the AssociatedUpdatePanel property value to the Update Panel ID of the UpdatePanel you want it to be associated  to:

<asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">asp:UpdateProgress>

In the Progress Template element add an Image control with its ImageUrl property value pointing to your animated image.

 <ProgressTemplate><asp:image id="updating1" Imageurl="~/DesktopModules/MyModule/Images/LoadingIcon.gif" runat="server"/>ProgressTemplate>

The final markup should look like this:

<asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1"><ProgressTemplate><asp:image id="updating1" Imageurl="~/DesktopModules/MyModule/Images/LoadingIcon.gif" runat="server"/>ProgressTemplate>asp:UpdateProgress>

 

<asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate>

<asp:Label ID="Label1" runat="server" Text="Label">asp:Label><br /><asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />ContentTemplate>asp:UpdatePanel>

The best part about working with declarative programming is that you will not need to recompile your code.

 

 

 

Posted By Néstor Sánchez on Thursday, October 18, 2007 2:27 PM

I faced this error while updating a module I had recently moved from a DNN3 environment to a DNN4 WAP one. I received all sorts of advice including this post filled bits and pieces but nothing was a solution. After a few frustrating hours I decided to go back to basics and review what I had done to move the module. The module was working OK in my development but not in my test install.

After going through the web.config file, project configuration, dll naming setup, namespaces, references and everything inside the DNN VS Solution it was clear I was looking in the wrong place. Fianlly, I opened the nAnt build file and there it was. I had been compiling against a different dotnetnuke.dll. I was pointing to the wrong virtual directory, a previous DNN version install. The compiler never complained and I could get my module dlls. The module raised the error only at run-time in the test site. I just pointed the reference to the correct site and I was in the game again.

I hope this helps someone else not to lose so many hours with something so obvious.

Posted By Néstor Sánchez on Thursday, October 18, 2007 2:27 PM

It's incredibly easy to use AJAX in the DNN 4.5.X versions. In this post I describe the two ways in which you may use AJAX in a DNN module.

Use Control Definitions
Assuming AJAX is already installed in the web server that runs DNN, a module will be dynamically wrapped in an Update Module by doing one of two things:

1) Adding the line below to the control node of a control in the .dnn manifest:

<supportspartialrendering>truesupportspartialrendering>

 2) Select de checkbox for Supports Partial Rendering in the control definition for the control that will use AJAX. Control definitions are reached after selecting a control to edit in a specific Module Definition in Host>Module Definitions>.

When the Partial rendering is enabled, the Microsoft Ajax Library can be used as well as the popular Control Toolkit.

Try this simple example to test a module that has been AJAX-enabled through module definitions. Add a Label and an UpdatePanel to the view control of a module. The put a second Label and a Button inside the UpdatePanel.

Add an empty click event for the Button to create a postback. Then in the Page_Load event  add a timer and assign the current datetime value to the labels.

System.Threading.Thread.Sleep(3000)

Label1.Text = DateTime.Now()

Label2.Text = DateTime.Now()

Clicking on the button shpould only update the datetime value of the label inside the update panel while the first one is unchanged.

Developer control
Remember that there can exist one and only one ScriptManager object in a page and since Dotnetnuke uses a single page, it's only logical that the framework and not the modules should be responsible of adding it dynamically. That is exactly what the Dotnetnuke.Framework.Ajax class does. The class has 8 methods besides its constructor:

Taken from the class documentation:

  1. AddScriptManager:

    AddScriptManager is used internally by the framework to add a ScriptManager control to the page

  2. ContentTemplateContainerControl

    ContentTemplateContainerControl gets a reference to the ContentTemplateContainer control within an UpdatePanel

  3. CreateUpdatePanelControl:

    UpdatePanelControl dynamically creates an instance of an UpdatePanel control

  4. IsInstalled:

    IsInstalled can be used to determine if AJAX is installed on the server

  5. RegisterScriptManager:

    RegisterScriptManager must be used by developers to instruct the framework that AJAX is required on the page

  6. RemoveScriptManager:

    RemoveScriptManager will remove the ScriptManager control during Page Render if the RegisterScriptManager has not been called

  7. ScriptManagerControl:

    ScriptManagerControl provides a reference to the ScriptManager control on the page

  8. SetScriptManagerProperty:

    SetScriptManagerProperty uses reflection to set properties on the dynamically generated ScriptManager control

It is possible to use IsInstalled() to determine if AJAX is installed in the web server, and couple dwith RegisterScriptManager Dotnetnuke will add the ScriptManager control to the page so that the module can use Ajax. The result of the previous example will be the same, but without enabling partial rendering in the module.

If DotNetNuke.Framework.AJAX.IsInstalled() Then

DotNetNuke.Framework.AJAX.RegisterScriptManager()

'Do some stuff

End If

Posted By Néstor Sánchez on Tuesday, September 04, 2007 2:57 PM

In the next few weeks I will be merging the content from DNNLA into this site. I am still trying to define the final structure and process to publish those resources. Some DNN articles are in english and I haven't received requests to have them in spanish, which is surprising. But I am sure some will be presented in both languages.

I am envisioning the creation of a Forum using the next release of the core version Chris Paterra is working on. In the meantime if anyone's got any suggestions for the site, feel free to post them.

Posted By Néstor Sánchez on Tuesday, July 10, 2007 5:12 PM

Dave M Bush published recently a tutorial that is kind of an hybrid between having a PA and using the Codebeside model from dynamic compilation. It's interesting to see the use of the MSBuild tool and compare it to the way it is used to build the PA. I have been using nAnt to build and create my PAs (Both source and install) reusing build files from the core modules. I have not used Bush's method but I will study it to see if something can come up for an improved development environment.ç

The article can be found here: http://www.dmbcllc.com/Articles/WebDevelopment/DotNetNukePAwASPNET20/tabid/260/Default.aspx

Posted By Néstor Sánchez on Friday, April 27, 2007 7:42 PM

I will start merging content from this Blog and the dnnla site in the next months. I am still trying to figure out what the structure should be, stay tuned...