Sunday, August 16, 2009

Windows 7 Ultimate on my XPS m1710

Downloaded Windows 7 Ultimate last night and now I'm about happy. Had a hard time with the BlueTooth module in my m1710 laptop, but finally got past that. Had to turn the BT on and off a couple times, then on my BT mouse I needed to hit the little BT button, then I was home free!

This is an upgrade from Vista Ultimate to Windows 7 Ultimate. My experience with Vista was poor as I'd get a blue screen at least once every couple weeks. Sometimes more often, sometimes less. But now that I've been running Windows 7 I'm much happier. It starts up very quickly vs Vista and it has a whole new crop of desktop images that are very nice. My first experiences with IE 8 have been quite painful, as I had to install Mozilla Firefox to get some of the updates needed.

Under Vista my Performance Score was 4.7. Under Windows 7 it is up to 5.4. The bottleneck was RAM in Vista, now it is Processor and RAM. To effect a better world for my Windows 7 install I upgraded my hard drive HD from 100gb 7200rpm to 320gb 7200rpm. Seems to be working great. Here are my results:

So there you go, my jumbled comments on an upgrade from Vista to Windows 7, enjoy!

Thursday, May 7, 2009

Unable to download following files from asmx?wsdl

Problem:
Got another issue today. When a developer using VS.Net in another part of our organization calls our webservice the user gets a fun:

Unable to download following files from .
http://urlofwebservice/TestVD/WebService.asmx?wsdl
Do you want to skip these files and continue?
Yes No

Reproduction
:
The developer who is trying to resolve this issue needs access to another webserver.

  1. RDP into the webserver that is your test environment

  2. Copy the code (asmx, bin, config, wsdl, xsds, etc) in http://urlofwebservice/TestVD/ to a new directory called TestVD2.

  3. Create a new virtual directory called TestVD2 pointing to the new directory

  4. Now from your local machine in your vs.net project add a web reference to the http://urlOfWebservice/TestVDTest/WebService.asmx

  5. You'll get the error as stated above now. For some reason it can't resolve the wsdl.


Research:
First I did a search on how the WebService.asmx?wsdl page is created as it is not something we can see at design time. Found a blurb that said that this page is created using reflection at runtime based off the WebService.asmx page.

Resolution:

To resolve this issue:

  1. Open up the Webservice.asmx.cs page

  2. Change the WebServiceBinding at the top from:

  3. [WebServiceBinding("WebService1", "http://someurl/WSDL/WebService/v1_0_1", "http://localhost/TestVD/WebService.wsdl")]
    to
    [WebServiceBinding("WebService1", "http://someurl/WSDL/WebService/v1_0_1", "http://urlofwebservice/TestVD/WebService.wsdl")]
    Kinda weird here as the test we'll do later will be to TestVDTest which will have code that points to the wsdl on TestVD.
  4. Recompile

  5. Publish to a directory

  6. Copy new bin and asmx page out to test server in both the TestVD and TestVDTest.

  7. Follow steps in the reproduction section above to verify it picks up the wsdl and xsd's if you have'em.


Voila! You should be good now. The reflection of the asmx page picks up the localhost entry. Then when other developers out there don't have the locahost/TestVD directory the wsdl doesn't resolve. Change the localhost url to a url that others can resolve to and that fixes the problem.

Wednesday, March 18, 2009

System.TypeLoadException: Could not load type

Problem:
Got a wonderful little error yesterday that had me pulling out my hair of which I have less and less each day. It starts with "System.TypeLoadException: Could not load type" and ends only after a good 4 or 5 hours of trying to deduce the problem through my code.
Here's a little background:
  1. VS.net 2008 Desktop Application (2.0 framework, 9.0.21022.8 RTM)
  2. Class library for container objects sent
  3. Class library for data layer which pulls information, creates the container objects, then returns the container objects to the caller.
Reproduction:
Simple enough. Here is how I reproduce the error:
  1. Have a container class library project with one class in it.
  2. Have a desktop app project with a datasource associated to that container project's single class.
  3. Recompile
  4. Close solution
  5. Open solution
  6. Recompile
  7. Add a new container class in the container Class library called Test.
  8. Rebuild your desktop app which should already have a project reference to the container class library.
  9. Add a new datasource pointing to that new object called Test.
  10. Create a new User Control called ctlTestControl
  11. Drag the datasource item 'Test' to the ctlTestControl. You should now have a datagrid with the container class's public fields as columns in said grid.
  12. Recompile
  13. Now attempt to add the control from your toolbox in your desktop apps Components section of the Toolbox.
  14. This is where I get the fun error:
Failed to create component: 'ctlTestControl'. The error message follows:
'System.TypeLoadException: Could not load type '.......

Research:
Here is where I got the answer to my problem: http://support.microsoft.com/kb/873267
The title of this kb article is:

You may receive a System.TypeLoadException exception when you try to preview a report in Report Designer after you install SQL Server 2000 Reporting Services Service Pack 1 (SP1)

This directed me to C:\Document
s and Settings\username\Local Settings\Application Data\Microsoft\VisualStudio\9.0\ProjectAssemblies .
What I noticed from looking at the files in the directories under ProjectAssemblies is that every time I rebuild my app it adds more directories and leaves the older compiled dll directories. So every time you rebuild the app, a new directory will appear in ProjectAssemblies, at least when you are developing a desktop app(haven't checked web apps, etc).

Resolution:
To resolve this issue:
  1. Closed solution (which happenned to delete all the associated subdirectories of ProjectAssemblies as described above)
  2. Openned solution
  3. Recompiled
  4. Successfully added control to form
Why work now? The app was caching an older version dll in the ProjectAssemblies directory. Closing the solution and reopenning the solution resolved it for me. Lol? could have saved myself by just closing the solution and reopenning it. :)

Perhaps my install is out of date, perhaps I have a setting out of whack, don't really care. All I care is that my...

Fury is contained...