Greg Robinson's Blog

I report it, you decide

Click Once

Custom Authentication in Windows Forms

DataBinding Stuff

Favorite Links

My book contribution

My Book Reviews

My Company

My favorite bloggers

My Personal Life

Richmond, VA .NET Users Group

Smart Client Stuff

What I am reading

March 2005 - Posts

No Touch Deployment and NetRun

In case you missed Rocky's NetRun utility (I did and coded all this myself) here it is:

http://www.lhotka.net/Articles.aspx?id=2f5a8115-b425-4aa1-bae2-b8f80766ecb3

Good new, my code looks almost identical to Rocky's.  The thing I had not figure out was how to get the config file to pull without touch IIS settings.  Duh, create a new app domain, set it's config file, away you go.

 

 

Contract to Hire in Richmond, VA

(1) .Net Design Analyst: experience with OO Design Documentation, understanding of UML and technical design specifications, ability to manage an offshore team, experience writing USE cases, all design work.  Skills: visual basic, asp.net, c#, UML, BizTalk2004, teamlead/management experience.

(2) Sr Web Developer: experience debugging and problem solving, 5 years of web-related experience, experience developing new web applications, MCSD certification desired.
Skills: vb.net, asp, asp.net, sql server 2000, javascript, visual basic, com+, xml.

Reg Free COM

Take a look at this feature in 2005:

http://msdn.microsoft.com/vbasic/default.aspx?pull=/msdnmag/issues/05/04/RegFreeCOM/default.aspx

Man do I look forward to this.  We use 3-4 3rd party com dlls in our app.  This may be a life saver for us.

 

 

Is there a decent .Net report writer out there?

We have painfully been going through the process of looking for a .Net report writer.  The original application was written in FoxPro.  My client has shone me how easy it is to create reports with FoxPro's report writer.  Sure enough, it's easy.

Ok, should be as easy with a .net report writer, right?  Well, I started with Crystal Reports XI.  

System.TypeInitializationException: The type initializer for "CrystalDecisions.CrystalReports.Engine.ReportDocument" threw an exception. ---> System.Runtime.InteropServices.COMException (0x80040154): COM object with CLSID {F0A36D7F-4068-44B5-809D-9E91AE74FBDB} is either not valid or not registered.

at CrystalDecisions.CrystalReports.Engine.ReportDocument..cctor()

Seems they are using a COM dll that gests registered during the install.  Not an option for us as we no touch deploy\click once our application from a web server over http. 

Active Reports and XtraReports do not provide a way in the IDE to create calculated columns. Both are also weak at bringing back a schema from a select sproc that has input params.  We have over 600 reports to build and 2 .Net developers. A non .net\support person needs to be able to build these reports, as easy as it is to build one in FoxPro or Access.  Drag, drop, set a property or two then Run.  Both of these products require a knowledge of a .net language and coding.

So, what does one do? 

 

 

 

Sql Server: "All I need is a little more time"

Our client is a windows form app.  Our DAL is hosted by IIS on the same box as the sql server database.  All select sprocs work perfect, no problems. The app connects to the DAL, which connects to Sql Server, Resultsets are passed back to the client through the remote type, no problems.

On the first call to do an insert or update sproc though we see this exception:

Index #0

Message: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

LineNumber: 0

Source: .Net SqlClient Data Provider

Procedure: ConnectionRead (recv()).

Severity Level: -2

So, we try to do a save from the client again, same thing. We try a 3rd time and all works well over and over and over. No more timeouts.  This happens every time, no matter the time of day or workload on the server, the first 2 times, then it always works fine.

This only happens on a sql server 2000 box.  Our development box is sql server 7 and we never get a timeout exception.

Bob Beauchemin suggest I increaded the command timeout.  So, rather than use the default 30, I explicitly set it to 60 right before the calls to Update on SqlDataAdapter. Know what?  No more timeout exceptions and it only takes 1-2 seconds.  This one baffles me as all I really did was explicitly set the CommandTimeout = 60 and no more exceptions on the fist 2 updates.

I would love to hear an explanation for this.  Not sure if the sql server 7 vs. 2000 is why though it is a difference in the 2 environements.

 

Roy and Scott look all too familiar

Wow, someone has captured my average day at work


http://techedbloggers.net/media/Video2.aspx

 

Versioning Assemblies

I posted a question on the DevelopMentor CLR Listserv about version numbers and a live release.

Chris Tavares answered my question and I wanted to share this answer:

Every product essentially has two different version numbers.

The first is the marketing version. This is the "brand new version 1.5!"

that goes onto the advertising and into the press releases. This is

controlled by the marketing department.

The second is the actual build number. This correlates directly with the

build system, and lets you match up a particular compile with a particular

binary. This is also the number used by the loader to load referenced

assemblies. This is controlled by engineering.

Luckily, there are two different attributes for these two different

versions.

AssemblyVersionAttribute controls the build number.

AssemblyInformationVersionAttribute gives you a place to set the marketing

version #.

Leave the former alone, or do what your other developer suggested so that

you have a known version number for your release build.

Set the AssemblyInformationVersionAttribute to 1.0.0.0.

I had the NANT stuff worked out, but that was a while ago and I must admit

I've forgotten how to do it now.

-Chris

-----Original Message-----

From: Discussion of development on the .NET platform using any managed

language [mailto:DOTNET-CLR@DISCUSS.DEVELOP.COM] On Behalf Of Greg Robinson

Sent: Monday, March 14, 2005 7:08 AM

To: DOTNET-CLR@DISCUSS.DEVELOP.COM

Subject: [DOTNET-CLR] Versioning assemblies for 1st live release

We are very close to doing our first release.

We kept the default 1.0.*.* version number during development.

I want to set this to 1.0.0.0 for our first release.

Another developer disagrees and says we should use the last development

build number and increment that number for our first release, then set it

back to 1.0.*.* for ongoing development.

We use Nant to do a nightly server build. Nant currently does not build a

version # for us. This is on our to do list.

What's the best way to set our first live release version number? What's

the best way to set our ongoing development builds after that, and what do

we do when it's time for our first bug fix and then our next release?

 

 

 

Lesson learned with No Touch Deployment and IE

One of our 3rd party assemblies released a patch this week.  We installed it, did a build, all worked fine.  However, our app blew up in 2 areas.  OK, no problem we thought, uninstall the new, install the old, do a server build. 

We did this.  The server build was successful.

A little history about our app.  It's a WinForms client that is No Touch Deployed over http.  We store all the assemblies in a folder off wwwroot on a WAN web server.  At the end of a server build, Nant copies the assemblies to this folder.

Client's do a pull based on the Modified-Since date on each assembly.

When testing, some clients kept using the new 3rd party assembly.  We checked the folder on the web server for the assembly in question and it was the old one with the old Modified-Since date.  Why weren't clients pulling it down?  

We found one machine that was using the old dll though. OK, some machines use the old, some use the new even though the old is on the web server.  Well, problem solved.

On the machines that were using the new assembly, we had deleted their download cache.  So, .NET mad a request to the web server to see if the assembly had been modified.  IE handles this request, bingo.  IE looks in it's cache, sees the assembly and hands it back to .NET so it never makes the trip to the web server. The machines where we did not delete the download cache still had the old assembly in their cache. 

I knew about the IE layer with NTD though I never sat still long enough to put the pieces together.  Deleting the download cache in IE on these client machines fixed the problem. 

 

  

SqlException and SqlError

How many times have you seen something like this on a database trip:

"String or binary data would be truncated."

Or a conversion error like "Can't convert char to datetime."

If you use lots of sprocs and trigger like we do, this can be a debugging nightmare.

Well, starting catching the SqlException and inspect the SqlErrors:

Public Function GetSqlExceptionMessage(ByVal exSql As SqlClient.SqlException) As String

Dim errorMessages As String = String.Empty

If Not exSql Is Nothing Then

Dim i As Integer

For i = 0 To exSql.Errors.Count - 1

errorMessages += "Index #" & i.ToString() & ControlChars.NewLine _

& "Message: " & exSql.Errors(i).Message & ControlChars.NewLine _

& "LineNumber: " & exSql.Errors(i).LineNumber & ControlChars.NewLine _

& "Source: " & exSql.Errors(i).Source & ControlChars.NewLine _

& "Procedure: " & exSql.Errors(i).Procedure & ControlChars.NewLine _

& "Severity Level: " & exSql.Errors(i).Number & ControlChars.NewLine _

& vbCr & "Please contact your system administrator if this continues."

Next i

End If

Return errorMessages

End Function ' GetSqlExceptionMessage

 

Doing this has saved us hours, possibly days in debugging.

 

More Posts