Error 1 Unable to open module Version=v4.0.AssemblyAttributes.vb

Wow, it has been months since my last post. I have a ton of drafts to finish as soon as I can spare some time, but here is a quick one.

Recently I used CCleaner to touch up my registry and clean my Temp folder. That resulted in the error “Error 1 Unable to open module Version=v4.0.AssemblyAttributes.vb” when publishing my Visual Studio project. The simple solution is to rebuild, which re-populates the Temp folder.

I hope that helps.

Classic ASP Locale and Localization Sample

So many people assume that ASP is dead. After all, at the time of this post little brother ASP.NET is almost 10 years old. That is like 32 human years, which makes ASP 56 and counting. It is true that ASP’s family at Microsoft has favored his younger brother for his depth and resourcefulness. They have all but cut off support for ASP, and most have turned their back on him. If you are one of those individuals I have news for you. 56 is far from dead and ASP does not need Microsoft’s support. He is mature, stable, and has a world of experience. Many articles have been written and ASP is rich in resources. As long as Microsoft does not shut the doors to IIS for ASP, then he will be there to run your code.

All joking aside, the fact is that ASP is a great scripting language.  ASP.NET is just bit too cumbersome for some of our simple projects. I can write an ASP app in notepad and it will handle about 95% the projects that come across my desk. There are still plenty of happy and productive ASP developers around today that just do not feel the need to switch yet. You can do just about anything with ASP. In fact, everyone did do anything with ASP for a decade before ASP.NET was ready for prime time.

If you are like me and still have some love for ASP this post is for you.

Here is an example of ASP Localization. It uses the “SetLocale” method and works in much the same way as ASP.NET, but far more simple.

As a bonus this application allows for a separate currency than the default Locale (In case you want to sell World Cup T-Shirts in EUROs, instead of Pounds). This application has a drop-down to change locale and currency.  There is a function to display the correct formatting and a function to normalize the data back to US format so it can be saved to the database.  It will also put that currency symbol on the correct side of the number (for those of you in France).

Enjoy!

SQL – Select and Update at the same time

Did you ever design a project that required a Queue?

It comes up from time to time that it makes sense to build a queue.

  • Batch Processing
    • Emails
    • Payments
  • 3rd Party Integrations
    • Keeping a Communication Log
    • Asynchronous Communication

Well, recently I was working on such a project and had to ask myself the question:

What if new items are being added to the queue at the same time I am selecting (e.g. running the Queue)?

In other words, how can I grab information from the queue and ensure I don’t grab the same thing twice?

Here are some options:

  • Use “No Count” to lock the table while you process the queue.  After you process the queue update each items status to “Processed”.
  • Select and Update all at once.  That way the queue is not locked, but there is no overlap.

I knew right away that the first option would not work for me.  It did not want that queue locked up because items were being added constantly.  I also did not even know if the second option was possible, but luckily it is.

So without further a due..  Here it is:

UPDATE Queue
SET Queue.QueueStatus=1
OUTPUT INSERTED.*
WHERE Queue.QueueStatus=0

The code above selects all items in the queue with a status of 0 and simultaneously updates them to a status of 1 using “OUTPUT” command.

Test Email button greyed out in SQL Server Agent

Well, I have to admit I have been a pretty lazy blogger recently. I have been really busy fixing problems at work, but haven’t had time to share the solutions. Over the weekend I am going to try to get some of those solutions online.

Here is a good one for you.

You have setup all of Database Mail for SQL Server Agent and get the following error in your Job “Note: Failed to notify via email“. It is because you did not make your profile the default. SQL Server Agent automatically uses the default profile.

Go to the database mail configuration wizard (Management > Database Mail) and right-click > Configure Database Mail. Select the option for “Manage Profile Security” and make sure your mail profile has Default Profile set to “Yes”.

Keep in mind that with Database Mail the test button will always be grey in SQL Server Agent. However, you will now be able to send emails properly from your Job.

Treasure Lake Homesite – Lot 104, Section 7A

I have placed my lot at Treasure Lake, Dubois, PA for sale. I am offering a 4%
commission for a referral that leads to a sale.

Here are some of the features:

* Seasonal Lake View
* Professionally Surveyed
* Ready to Build Homesite
* Borders State Game Lands
* Short Walk to Beach
* Coveted Culdesac Road
* 100% Clear of Liens
* Private, Gated Community
* Tons of Amenities

Click here to view my Treasure Lake Lot.

ASP.NET 4.0 WCF – XML Parsing Error: no element found

I recently upgraded our WCF services to ASP.NET 4.0.

For whatever reason you are receiving this error, I can help.

First off, this simply means there is an error somewhere in the WCF service that is preventing any data from being returned. In Firefox when no data exists it shows you the error message above.

There are many causes for this error so the first thing is to get a meaningful error message. So add the following code to your Global.asax in the “Application_Error” section:

Server.GetLastError().GetBaseException()

Now when you run the service you should find a meaningful error message that you can Google. Here are some of most common problems:

1. You do not have a handler in Web.config file for the “.svc” extension. If your service works locally, but not on the host (e.g. GoDaddy), then this is probably the cause. I have another post specifically on this httphandler issue.

2. You are updating to ASP.NET 4.0 and started to get this error. You need to remove the element aspNetCompatibilityEnabled=”true” from the Web.config.

Medrano-Irazu

Medrano-Irazu 2006

Rioja Crianza (Wood Aged Red Wine)

Summary

It has been awhile since my last wine review.  Initially, when life was far simpler, I had envisioned a grand gallery of wines and would indulge myself frequently.  Alas, now we have two.  Let’s not beat myself up about it though.  There will be many more to come.  What you need to know about the wine I will tell you.  I am not going to confuse you with subjective notes about blueberries, aromas, and peppers.  My review will stick to the basic things I want to know when I buy wine (acidity, complexity, and bitterness).  You should know that I look for complex, smooth wines, with little acidity, and no bitterness.   That said, this wine is OK, but did not blow me away.   I enjoyed it, but not enough to go back again.  Though… I think this wine is good enough to justify trying their reserve.

Spanish red wine aged in American and French Oak Barrels for 12 months

Decant: Recommended

Sweetness: Dry, semi tart

Complex: Yes, but it not mind blowing

Character: Somewhat Smooth, Oaky, Slight Acidity

Rating

Stars: 6