Showing posts with label Error. Show all posts
Showing posts with label Error. Show all posts

Friday, April 11, 2008

Silverlight: Image tag not working

If you are using Silverlight 2.0 Beta 1 and are trying to simply display an image that is a resource in your project, in lets say the Resources resource folder it seems like a simple task. Unfortunately Silverlight wont tell you if you make the most basic mistake in this beta version.

image

In the example above you must reference the image in the resource folder by using a forward slash in the XAML Source property of your <image> tag, not a backslash! Use the backlash and nothing will display.

Its a simple, armature mistake but it can cost you a lot of time. Here is the proper syntaxes example:

image

I am sure in the future this will get easier and provide more information for such simple mistakes.

Silverlight 2.0 Beta 1 Error - Creating a new project

Silverlight 2.0 Beta 1 - Error

clip_image002

Error: You need to install the 2.0 versions of the Silverlight runtime and the Silverlight SDK before creating a Silverlight project.

Reproducing Error

image

To cause this error to happen I simply tried to create a new Silverlight 2.0 Beta 1 Application Project. (Library project did not cause error)

Odd Note and Workaround

One odd thing is that existing projects on my computer (like the digg sample) opened and ran in debug without issue. This is actually a potential work around if the resolution below does not help you. Simply use another computer to create your project and use your machine to develop it by opening the pre-made project.

Resolution

To resolve the errors I had to take the following steps:

  1. Restart my PC to make sure nothing was locked in memory
  2. Uninstalled all installed Silverlight components (Tools, Runtime, SDK, Hot-Fixes from Chainer, etc)
  3. Manually removed all Silverlight files and registry keys that were not cleaned up for some reason by the uninstall step above
  4. Uninstalled 3 different versions of Blend Beta/Alpha versions
  5. Opened Visual Studio 2008, verified no Silverlight project exists and that dig sample does not open
  6. Reinstalled all tools directly from the getting started site:
    1. http://silverlight.net/GetStarted/ (Tools Install Chainer and runtime for Beta 1)

Honestly the list of fixes above is fairly "wide" but I am not sure what helped me resolve the issue.

Wednesday, April 2, 2008

Can't read Compiled Help (.chm files) after Vista sp1

The other day I installed Vista Service Pack 1 on my machine and had no real issues until today. While the problem I just had is not serious it is worth documenting.

Opening CHM file

Today I needed to read some parts of a CHM file I downloaded directly from MSDN and the content would not display, here is a screenshot:

image

The address is not valid

The error in the sceenshot puzzled me, so I started to think what had changed as not too long ago this same CHM file opened for me just fine. I then realized I had installed SP1 since then and perhaps something had changed.

A quick search revealed a knowledge base article with the following suggestion that resolved the issue for me:

Method 2

1. Right-click the CHM file, and then click Properties.
2. Click Unblock.
3. Double-click the .chm file to open the file.

My best theory is that Vista SP1 added this new "block/unblock" security enhancement for CHM files downloaded from untrusted sources such as the Internet.

I hope this post helps save someone time in the future, good luck friends.

Sunday, February 24, 2008

Server Error: Posting to Blogger using Live Writer

Today while Posting to blogger using Live Writer I got this annoying error:

blogger error postingThis seemed very odd as I did not think I was doing anything different, perhaps Blogger was down?

I invested a Little and found no known or obvious issues with Blogger. I then decided to restart Live Writer, and yet again no luck

Finally It hit me, if I scroll down in the error box it had one very important piece of information (see bold below):

The server reported an error with the following URL:

http://www.blogger.com/feeds/6464718258414775904/posts/default

400 Bad Request

Invalid category term

It seems that my choice of Q&A in the Categories option was not valid for blogger, it did not support the &. Changing it to QA instead worked and my post went through.

This is a good lesson to everyone: when you get a message box with an error scroll down and read everything!

smile_sarcastic

Tuesday, February 12, 2008

%1 is not a valid win32 application - SSIS Error

Today I had another first with SQL Server Integration Services, I had to execute a batch file.

To accomplish this I placed an Execute Process Task on my design surface and set its WorkingDirectory and Executable properties to form a valid pointer to my test.bat file. This was an empty batch file meant as a placeholder until i made the real one.

Right-clicking on tasks at the Control Flow level lets you run them individual (As a test), and this was perfect for my goal: to see if this approach individual task worked.

Upon execution though my output had the following error "%1 is not a valid win32 application".

Problem: %1 is not a valid win32 application

This error can occur for a few reasons, many times because you are providing a path to a folder that contains spaces, but does not have quotes around it. Example: C:\My Development Env\MyProject\RunMe.Bat.

I assumed this was the case and proceeded to place quotes around the WorkingDirectory value. This did not work as the new error told me this directory did not exist.

Frustrated I started to Google for a solution. After some time I did not find anything that solved my particular problem. I was stuck.

Solution

When I hit a wall like this I typically try to take a step back, look at the basics. In this case doing so brought a realization to me, what if this error can mean something else? What if the batch file being empty (yes totally empty) was the issue? I opened up the batch file, added one basic DOS command(DIR in this case) and executed the task again. Doing so worked perfectly resolving my issue.

So here is a lesson, don't try to execute empty batch files using SSIS. I hope this saves someone else 15 minutes of their life.

DelayValidation Option in SSIS

As most of my "loyal" audience already know I am currently working on a project using SSIS for ETL. I have never worked with SSIS before this project so it is definitely a learning experience.

Problem

One recent problem I encountered was a difference in how my package behaved when executed using a C# driver application instead of the Development IDE (Visual Studio).

While using Visual Studio SSIS packages can be executed in a debug mode, and my package was working perfectly. The steps (slightly simplified) involved:

  • Executing an FTP task to download a file
  • Running a DataFlow series of tasks that read the contents of the downloaded file and uploaded it into SQL Server
This is a fairly simple sequence, but it did not work once I would execute the package from my C# driver. (Basically using the Object Model exposed by SSIS to run the package from custom code, in this case my Unit Test scripts)

The error would occur on the second step, the DataFlow would fail because the file was missing. This made perfect sense since in my analysis of the package I noticed no FTP commends were sent to my development FTP server, meaning the file was not being downloaded. (Now again, everything worked perfectly when executing the same package using Visual Studio).

Solution

Thanks to an idea I had and some direction from the forum (see special thanks below) i was able to figure out that the DelayValidation option by default was set to False, which attempted to validate that the file existed before ever running the FTP Task.

To resolve this I simply set the DelayValidation setting at the DataFlow level to True. This resolved my issue and now the package works from both my driver and the IDE.

My only frustration is why did this even work from the IDE? One would expect things to work the same in debug as it does at run-time but i guess this is not the case. I really dont have a full understanding of SSIS so that could definitely be the problem here.

Special Thanks

I want to thank jwelch for pointing me in the right direction on the SSIS forum. It feels really good to know the community is there to help me through this learning experience

My Post: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2827234&SiteID=1

Monday, February 4, 2008

IIS 5.1: Unexpected error 0x8ffe2740 occurred

errorToday for the first time since I had rebuilt my home machine something I was developing accessed my local IIS 5.1 instance (running in Windows XP sp2). Normally I would use IIS very often but recent events have kept me away from web development.

In this particular case I was not even doing real web development, instead I was experimenting with the Publish feature for ClickOnce publishing options of Windows Applications. Something seemed odd as trying to publish would lock up Visual Studio, so I decided to investigate if IIS was even working properly.

I entered Internet Information Services MMC and noticed IIS was not started. I attempt to do so manually and got this error:

Unexpected error 0x8ffe2740 occurred.

My gut told me, something must be running in Port 80. From experience strange errors in IIS tend to be related to such a problem (as two applications cannot run on the same local port due to binding issues).

As my next step to confirm this I entered the event log viewer and found the following problem reporting by W3SVC (W3SVC is IIS), here is a screenshot:

error in event log

Notice the words "service could not bind instance 1", this confirmed what I had suspected. I immediately went into web site properties and changed port 80 to 81. The service now started just fine.

To be thorough with my assumptions I also Googled the original message and found the following KB article that supports my thoughts behind this problem, here is a link:

http://support.microsoft.com/kb/816944

Tomorrow I will spend a few minutes and figure out what has taken over port 80 as id like it back for IIS.

smile_teeth

Monday, January 28, 2008

SQL-CLR Stored Procedures - Cannot talk to Visual Studio Output Window?

Today while debugging a SQL-CLR stored procedure written in C# (using VS 2005) I came upon a frustrating issue. It seems I cannot do things like:

  • Debug.Print
  • Debug.WriteLine
  • Debug.Write
  • Console.WriteLine
  • Console.Write

Scenario #1: Starting Debug with Console.WriteLine statement in code I immediately get this error

The protected resources (only available with full trust) were: All

The demanded resources were: UI

Scenario #2: While running debug I hit debug.print line and get this error

The protected resources (only available with full trust) were: All

The demanded resources were: Synchronization

This sort of makes sense to me as these statements are trying to use library api's that are purely visual and would not work without an attached debugger. (There is no Console or Debug window when running this purely in SQL Server 2005)

Alternatives?

SqlContext.Pipe.Send is another way to communicate out to the output window but I am fairly new to this statement and it seems to send output in bulks.

Honestly I am not sure of another work around at the moment but I hope this information at least helps.

I am all open to ideas and workaround so please send them to me or post them as comments.

Saturday, January 26, 2008

.NET CLR Profiler: Waiting for application to start common language runtime

Today I decided to try a tool called CLR Profiler. If you never heard of this tool before, here is what MSDN says about it:

The CLR Profiler includes a number of very useful views of the allocation profile, including a histogram of allocated types, allocation and call graphs, a time line showing GCs of various generations and the resulting state of the managed heap after those collections, and a call tree showing per-method allocations and assembly loads.

My first step in using the tool was to download it, so I Googled the words "CLR Profiler" and the very first link took me to the download page for "CLR Profiler (v1.1)".

For about half a second I wondered "Does v1.1 mean its for Framework 1.1?", but that thought passed and I wrongly assumed it was merely a version number coincidence. That was a mistake on my part.

image

I started the tool and used the "Start Application" button with all the default settings to try and profile a very basic application I had built specifically for this purpose. Doing so though did not seem to work, the profile would get stuck on the message "Waiting for application to start common language runtime" and after I would exit my test application, CLR Profiler would crash.

image

image

Puzzled by this I went back to the download page for the profiler and quickly discovered the problem, my original thought should have been pursued, this really was the profiler for .NET Framework 1.1! A link at the bottom of the download page pointed to the correct version: CLR Profiler for the .NET Framework 2.0.

Now that I am using the correct version of the utility it works perfectly. It is worth noting though that the interface really looks the same between the two versions, so don't let that fool you either.

 CLR Profiler 2.0 CLR Profiler 1.1
image image

Friday, January 11, 2008

Object reference not set to an instance of an object. ... A C# story

Today I was writing a small console application and ran into an issue that wasted a good half hour of my time. The console application consisted of one class that I instantiated as MyObject and attempted to run two methods .LoadPackage(), followed by .Execute().

The detailed explanation of the actual object functionality is not necessary but lets talk about what I did inside from a technical perspective:

  • I added a private field of another object, basically saying ABCObject abc = null; I did not want it initialized until the LoadPackage() method was run
  • In the LoadPackage() method I wanted to say abc = new ABCObject(); but instead I wrote ABCObject abc = new ABCObject();
  • Due to this very basic mistake above when I executed .Execute() that tried to do abc.Run() it failed with a "Object reference not set to an instance of an object" error

smile_baringteethLooking back at this I of course realize what happened, by defining the variable again inside of the LoadPackage() function I made it a local variable in the scope of the method, so my field version of abc never got set and the Execute() method always had a null reference. My biggest frustrations with this whole situation are:

  • When setting a breakpoint inside of the LoadPackage() function I didnt see this problem right away since until the method exited the object looked just fine
  • Visual Studio 2005 does not warn me when I override a field in this fashion, perhaps there should be some sort of visual cue?

As my friend from DevBlog would say "this is a classic scope problem" and I know wasting time on this was all my fault, but I definitely feel the tool could be smarter in these kinds of scenarios.

Your thoughts?

Wednesday, December 12, 2007

IPhone Vibrate Alert bug during Dock

When the IPhone is set to vibrate and then connected to the USB PC connector it vibrates one time as an alert of a successful dock. During a normal day I dock the phone once or twice to update my podcasts and never had an issue until today.

When I connected the IPhone it vibrated once as normal.. then twice... then a third time. I soon realized it wouldn't stop, it was vibrating over and over, at a much quicker pace then even the vibration of an incoming phone call.

I tried to undock the phone, didn't help. I tried to re-dock the phone, didn't help. At this point my hand was getting a free but unwanted massage. I decided to reboot the phone which did stop the vibration. I then docked the phone and updated my podcasts without issue.

I have the latest firmware version (1.1.2) installed so this must be an active bug. Hopefully 1.1.3 will resolve the problem as anything that requires a reboot to resolve is in my opinion high priority.

Note: While this phone is NOT bug free, it really does a great job for what I need it to do. For me the IPhone has been a very worthwhile purchase.

Thursday, December 6, 2007

My First bug found in Visual Studio 2008 (well not really)

An error occurred while processing this command.

The file c:\... cannot be modified in the designer while building or debugging.

image

Today I was finally trying out Visual Studio 2008 RTM and discovered my first semi-bug (or really a bad way to communicate)

Steps that lead to "bug":

  1. Created a Windows Application (not WPF, regular)
  2. Added a Toolstrip and WebBrowser Control
  3. Started adding some .NET 3.5 code to test various new features, nothing major and not related to the error (As you will see)

Then I decided I really didn't need thee WebBrower control and tried to remove it by selecting it in the designed and hitting DELETE. This to my surprise caused the error above to appear.

The part of the error that really stood out was "An error occurred while processing this command" and then a long path to my class file. I was shocked that such a basic thing would error out but at the same time I have seen various similar errors in 2005 that really did mean something was broken.

A few minutes later it hit me, I should have read the entire message "cannot be modified in the designer while building or debugging" was at the end of the message and was the critical part that I missed! Now I understood the problem, I had my test application running, so I shut down debug mode and deleted the browser control without issue.

You can almost say that this was my fault, I should have read the message (and you're partially right). At the same time I think there could have been a better way to handle such an "error" other then a standard error dialog box. In reality this should have been an "Information" style box, perhaps even asking if I wanted to shut down my running application in order to complete this request.

I hope this posting helps the next person who gets this "Error" but does not bother to read the whole message.