Monday, January 21, 2008

Microsoft's new agile pace is just killing me.  I'm glad that sp1 will be out some time in the foreseeable future but.  I don't want thing about upgrading to vs 10 in another 18 months. 

C# Debugging Improvements for VS 2008 SP1- Part 1

 

posted by Aaron Fischer on Monday, January 21, 2008 5:18:07 PM (Pacific Standard Time, UTC-08:00)   #    Comments [0]
 Monday, November 19, 2007

You might receive the "The debugger does not support debugging managed and native code at the same time on this platform." error message in Visual studio 2005/2008 if you have a 32bit native/mixed mode dll linked to your x64bit assembly.  If you change the project properties so that Platform target is x86 you should be able to debug both assemblies.

posted by Aaron Fischer on Monday, November 19, 2007 7:55:13 AM (Pacific Standard Time, UTC-08:00)   #    Comments [0]
 Monday, November 05, 2007

According to CNN Money Microsoft has committed to an end of November release date.

Full story here.

posted by Aaron Fischer on Monday, November 05, 2007 6:34:34 AM (Pacific Standard Time, UTC-08:00)   #    Comments [0]
 Saturday, October 27, 2007

Brad Abrams is taking a poll, Allowing .NET EXEs to run off a network share.  There are a lot of useful solutions that are blocked by the current .NET policy.  I would like to see it go the way of the dodo.  It doesn't really offer protection since unmanaged code will execute from a network share.  Removing this default limitation would allow for true xcopy deployment.

Please vote early and often!

posted by Aaron Fischer on Saturday, October 27, 2007 11:43:28 AM (Pacific Standard Time, UTC-08:00)   #    Comments [0]
 Friday, October 19, 2007

If you have not seen it yet Patrick Smacchia is showing off his free library to handle common and complex file path operations.  Its on CodePlex NDepend.Helpers.FilePathDirectory

Here is Patrick's class diagram

image

It nicely done some thing that MS should have offered in the DotNet Base Class Library.

posted by Aaron Fischer on Friday, October 19, 2007 5:29:23 AM (Pacific Standard Time, UTC-08:00)   #    Comments [0]
 Thursday, October 11, 2007

Over on Carlo's blog(Gacutil not supported in production?) there is a small discussion about how to register an assembly into the GAC.  Microsoft Recomends using Windows Installer 2.  Gacutil is not really supported on production ( explains why its part of the sdk) but with the proper command line args /i and /r it can be used to register an assembly in to the GAC, however the license for Gacutil, only allows internal redeployment.  So an ISV would need a windows installer.  In the past I have seen System.EnterpriseServices.Internal.Publish.GacInstall used to foster GAC registration in an install shield ( install script). Not sure if it works the same as windows installer but it get the job done. Also of intrest System.EnterpriseServices.Internal.Publish.GacRemove

posted by Aaron Fischer on Thursday, October 11, 2007 5:47:18 PM (Pacific Standard Time, UTC-08:00)   #    Comments [0]
 Wednesday, October 03, 2007

Scott Gu announced the releasing of .Net framework libraries (Microsoft Reference License).  This is good news its some thing that i miss very much when not working with the MFC libraries.  Truth be told you could already view and to some extent debug the .NET Framework with reflector but first class support in VS 2008 is defiantly great news.  Scott Hanselman appears to already have a Hansel Minutes relating to this announcement.

posted by Aaron Fischer on Wednesday, October 03, 2007 8:55:29 AM (Pacific Standard Time, UTC-08:00)   #    Comments [0]
 Monday, October 01, 2007

In July Microsoft released Security Bulletin MS07-040-Critical Vulnerabilities in .NET Framework Could Allow Remote Code Execution (931212) 

A Security Update for Microsoft.net Framework 2.0 (KB928365) was released for  windows server 2003

this updates System.web.dll

I have found this security update to crash IIS and any asp.net 2.0 web site/web service w3wp.exe to be restarted on every web request.

It looks like this is only a problem when this security patch is automatically installed via windows updates.  Once I uninstalled the security update the crashing issue went away.  When I manually reinstalled the security update and rebooted IIS and ASP.NET continued to function correctly with out error.

 

Also updated was,

 940521 (http://support.microsoft.com/kb/940521/) The behavior of UTF8Encoding, Unicode Encoding, and UTF32Encoding changes to comply to the Unicode 5.0 requirements for Unicode encodings after you install the security update for the .NET Framework 2.0 that is described in security bulletin MS07-040

this seems to affect how ASP.NET generates its web control names.

posted by Aaron Fischer on Monday, October 01, 2007 9:27:40 AM (Pacific Standard Time, UTC-08:00)   #    Comments [0]
 Friday, September 28, 2007

There just doesn't seem to be any love for the Visual Studio 2005 Web Sit Project.  I know I have none.  I' am  sure its fine for an internally developed web sites, but who cares about those.  For an ISV we need dll's.  It's simpler and your customer can't make unauthorized edits to your code.  So if like me your looking for a simple way to update some of your older asp.net projects Peter Bromberg just posted a nifty trick to get your visual studio 2003 class library project to convert to a visual studio 2005 web application project.  I recommend you take a look and save your self a migraine.

posted by Aaron Fischer on Friday, September 28, 2007 6:07:40 AM (Pacific Standard Time, UTC-08:00)   #    Comments [0]
 Thursday, September 06, 2007

Doug Stewart has posted an extensive list of CRL 2.0 bug (hot)fixes.  Its worth a look if your Dot Net 2.0 app is having issues.  Thanks for putting together such a comprehensive list Doug. 

I have seen this issue on a QA server The managed heap becomes corrupted when you run a program that is built by using the Microsoft .NET Framework 2.0 good to see its not my code and that there is a fix for it.

Some of the Hot fix support articles do leave a little something to be desired though I would like to see Microsoft spend the time to detail the cause for each issue so I can better evaluate my need for a given fix.

posted by Aaron Fischer on Thursday, September 06, 2007 6:27:40 AM (Pacific Standard Time, UTC-08:00)   #    Comments [0]
 Thursday, August 02, 2007

Is it a Memory leak or a Resource leak.

It would seem that if you take a c++ managed extensions gc class containing a native pointer to dot net 2.0.  The classes finalization does not happen correctly.  Ie the destructor is no longer invoked.

further more if you migrate said c++ code to c++/cli then your destructor will not get called when the managed object is disposed of via garbage collection.  You will need to either explicitly call the destructor or add a finalize to your reference class.

 

Not the most obvious memory leak in the world to say the least.

posted by Aaron Fischer on Thursday, August 02, 2007 9:39:54 AM (Pacific Standard Time, UTC-08:00)   #    Comments [0]
 Thursday, July 26, 2007

In your quest to down load all the visual studio 2008 goodness you may find this new ctp tool from Microsoft very useful

Microsoft Secure Content Downloader July 2007 Community Technology Preview

Overview

The Microsoft Secure Content Downloader (MSCD) is a peer-assisted download manager capable of securely downloading specific files. MSCD is intended for consumers who are downloading from a home PC, or business users whose computers are not behind a corporate firewall. If you use MSCD from behind a corporate firewall, you may be unable to download content, and may adversely affect other clients' ability to download content.
Main features of the MSCD are:

  • Secure content description
    • Each file available for download has a secure description, ensuring the content you download is exactly what the publisher published.
  • Scalable performance
    • MCSD is a peer-assisted technology. Each client downloads content by exchanging parts of the file they’re interested in with other clients, in addition to downloading parts from the server.
      • No matter how great the internet’s demand for the file, you will always be able to make progress downloading.
      • MSCD lets you download content more quickly than possible without peer assistance.


Some MSCD clients may be connected to each other via peer connections, forming a ‘cloud’ of clients. Pieces of the file you are downloading are sent through these peer connections between clients, as well as through connections with the file server. As a member of the cloud, your computer both serves as a client and server to other members of the cloud. Data destined for the cloud may be routed through your computer and sent to other cloud members. The other cloud members connected to you will be able to access only pieces of the file you are downloading via MSCD – they have no access to any other data on your computer.
You are only connected to other clients while you are downloading a file via MSCD. When the file has finished downloading – or when you pause or cancel the download, or exit the application – you disconnect from the cloud. Once you disconnect from the cloud, you will no longer have any connections to any other members in the cloud and no data will be routed through your computer.
This version of MSCD is a Community Technology Preview, and will only allow you to obtain current Visual Studio 2008 Beta 2. Since it is a Community Technology Preview, additional information related to MSCD’s performance and network transactions -- including your machine name and IP addresses -- may be logged to help evaluate and improve MSCD performance.

Just incase you have been under a rock here are the links to detailed information about today's release of Visual studio via Scott Gu and Somasegar respective blog posts.

posted by Aaron Fischer on Thursday, July 26, 2007 9:52:06 PM (Pacific Standard Time, UTC-08:00)   #    Comments [0]
 Wednesday, July 25, 2007

I was looking for a way to pass a parameter by reference today.  More specifically the setter.

I found a couple interesting blog posts

http://geekswithblogs.net/akraus1/archive/2006/02/10/69047.aspx

notice the comment by Tedesco.

He offers a nice way to do this via an anonymous delegate.

public delegate void InsertString( System.String param ); public partial class Bird { public void FileToDb( int x) { FillEntityColumn(delegate( System.String value) {tExtra.Text = value; }); } }

So we actual pass the FillEntityColumn method an anonymous delegate which then sets the property.

Now in vb you can write
Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        testme(TextBox1.Text)
    End Sub
    Sub testme(ByRef s As String)
        s = "hello"
    End Sub
End Class

which a commenter on http://musingmarc.blogspot.com/2006/04/tale-of-two-implementations.html eluded to.  But in vb you still cannot pass a Property by reference, at least not really.  Take a look what vb generates into il.

Private Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs)
    Dim VB$t_ref$S0 As TextBox = Me.TextBox1
    Dim VB$t_string$S0 As String = VB$t_ref$S0.Text
    Me.testme((VB$t_string$S0))
    VB$t_ref$S0.Text = VB$t_string$S0
End Sub

 
As you can see vb is writing some code for you which is nice, but we are still not passing the property by ref.
   -Mike has also talked about the want of passing parameters. ( the same misguided comment that vb supports passing parameters by ref)
posted by Aaron Fischer on Wednesday, July 25, 2007 11:27:21 AM (Pacific Standard Time, UTC-08:00)   #    Comments [0]
 Tuesday, June 19, 2007

Microsoft KB article 894435

posted by Aaron Fischer on Tuesday, June 19, 2007 9:00:06 AM (Pacific Standard Time, UTC-08:00)   #    Comments [0]
 Friday, June 15, 2007

Scott posted a nice article Tip/Trick: Creating Packaged ASP.NET Setup Programs with VS 2005  for deploying your Visual Studio 2005 project.  While Scott's article is focused on deploying to a customer I have found those scenarios to be beyond what VS offers and requires Install shield.  I do this this post is a handy trick for moving your project from dev to QA to staging maybe even production.

posted by Aaron Fischer on Friday, June 15, 2007 2:02:29 PM (Pacific Standard Time, UTC-08:00)   #    Comments [0]

If your moving MFC or C++ extensions to dot net 2.0 here are a few items you might find useful

posted by Aaron Fischer on Friday, June 15, 2007 1:50:33 PM (Pacific Standard Time, UTC-08:00)   #    Comments [0]
 Friday, June 08, 2007
 Sunday, May 20, 2007
posted by Aaron Fischer on Sunday, May 20, 2007 7:44:55 PM (Pacific Standard Time, UTC-08:00)   #    Comments [0]
 Friday, May 18, 2007

start by having a solution with two projects.

In the solution exploder window right click the solution and choose add New or existing item.

 

For this how two we will add a new c# class

click add.  Visual studio will create a new suborder under the solution called "Solution Items" Class1.cs will be in this folder.

now select one of your projects and right click select add existing item.  Navigate to your solutions directory and select Class1.cs

click the drop down arrow next to the add button

select add as link

You will now have a shared link to a common solution file/class

repeat for each project you wish to add this file/class to.

posted by Aaron Fischer on Friday, May 18, 2007 12:41:40 PM (Pacific Standard Time, UTC-08:00)   #    Comments [0]
 Monday, April 30, 2007

It seems to have been under reported but Expression Studio was released today.  I don't see Blend on the MSDN Subscriber download yet.

posted by Aaron Fischer on Monday, April 30, 2007 8:29:09 PM (Pacific Standard Time, UTC-08:00)   #    Comments [0]

I am not at mix but I see the BCL team just announced

 

Silverlight 1.1 Alpha includes all the features available in Silverlight 1.0 Beta plus a number of new features focused primarily on improving developer productivity and power:

  • Managed code support
  • Support for dynamic languages including Managed JScript and Python
  • Rich UI control model based on WPF
  • Improved networking stack with support for REST, RSS, JSON, POX
  • Enhanced, 2-way HTML/AJAX Bridge
  • Comprehensive and consistent base class library
  • Support for LINQ (LINQ to Objects, LINQ to XML)

That's right.  Silverlight 1.1 Alpha includes support for managed code and a comprehensive base class library!  Now you know what we've been up to and why our blog has been relatively quiet these past several months :-)

Our partner .NET teams within Microsoft have been able to provide an amazing amount of additional functionality on top of the Silverlight 1.1 BCL.  There's a networking stack, XmlReader and XmlWriter, an HTML/AJAX Bridge, a WPF API subset, a safe OpenFileDialog control, LINQ, and the new Dynamic Language Runtime (DLR).  What's really exciting is that all of these APIs are cross platform and work consistently on both Mac OS X and Windows!

You can download Silverlight 1.1 Alpha today along with the SDK at http://msdn.microsoft.com/silverlight.  After you've downloaded the bits, check out the newly launched Silverlight community site.  It's a great resource for getting started with Silverlight.

This will indeed be an interesting year.  BCL on Mac I doubt Linux could be to far off.

Now we know why many Developers were left with the impression that Silverlight was a little lacking, Microsoft was just hiding their real work.

posted by Aaron Fischer on Monday, April 30, 2007 9:46:07 AM (Pacific Standard Time, UTC-08:00)   #    Comments [1]
 Tuesday, April 24, 2007

Check out SecureLM's FAQ

 

How SecureLM works?

1. The software that is going to be distributed should be integrated with SecureLM. If you protecting your software using SecureLM Code Protector, the integration is almost done. In order to enable or disable GUI elements related to licensed functionality of software SecureLM API can be used. However, licensed functionality of protected software will not be executed without a valid license even if an attacker eliminates API checks.

2. Protected program requires a valid license in order to run. The creation and installation of a license for specific machine or USB hardware key is called Activation. The activation can be done online, via e-mail or via phone. A license is usually locked to machine, USB hardware key or USB flash disk. Non locked licenses are also allowed. Usually end user receives an activation key that allows software activation. SecureLM provides friendly user interface for software activation.

3. SecureLM server provides Web interface that allows performing operations like:

· Issue licenses

· Reissue existing licenses

· Perform e-mail and phone activations

· Increase number of allowed activations per license key

· Track issued licenses and online activations

· Define system configuration

· Much more.

 

What kind of software can be distributed with SecureLM?

Any Windows application or library can be distributed with SecureLM.

· .NET 1.1 or 2.0 Windows applications, services, or components

· ASP.NET 1.1. or 2.0 applications or components

· VC++/VB6/Delphi applications

I am just stumbling around their site it sounds interesting and worth a try.  Its nice to see another Giant in this market.  At least there is an alternative to MacroVision

posted by Aaron Fischer on Tuesday, April 24, 2007 7:07:38 AM (Pacific Standard Time, UTC-08:00)   #    Comments [0]
 Saturday, April 21, 2007

Check out Microsoft's free .Net Framework 3.0 Virtual Labs and if you take part in any TechNet or MSDN virtual lab or labcast  you could win.

posted by Aaron Fischer on Saturday, April 21, 2007 1:42:23 PM (Pacific Standard Time, UTC-08:00)   #    Comments [0]

I was having some trouble figuring out how to use the new ado.net entity framework in the last March Orcas CTP, but leave it to Scott to have all the answers.  Scott has posted a nice video covering

  • new asp.net WYSIWYG HTML designer.
  • create classes's from the ORM designer.
  • Intellisense for LINQ.

full detailed blog post.  And you can find the video here.

posted by Aaron Fischer on Saturday, April 21, 2007 1:33:48 PM (Pacific Standard Time, UTC-08:00)   #    Comments [0]
 Friday, April 20, 2007

Incase you missed it yesterday Soma announced the release of Orcas Beta 1, it can be downloaded here.

posted by Aaron Fischer on Friday, April 20, 2007 1:43:03 PM (Pacific Standard Time, UTC-08:00)   #    Comments [0]
 Tuesday, April 03, 2007

I wanted to take a moment to point out my new favorite DotNet Function.  At VSLive in San Francisco I was introduced to System.IO.Path.Combine( path1, path2) as string.  I no longer have to deal with the logic of adding a trailing or leading slash when combing  file and directory locations.

posted by Aaron Fischer on Tuesday, April 03, 2007 8:27:05 AM (Pacific Standard Time, UTC-08:00)   #    Comments [0]
 Saturday, March 31, 2007

I was taking a look at Scott Guthrie's Developing Data-Driven Web Applications using LINQ.  This is going to make life a little less dreary.

I like the second to the  last line results.Skip(startRow).Take(10);

posted by Aaron Fischer on Saturday, March 31, 2007 2:03:28 PM (Pacific Standard Time, UTC-08:00)   #    Comments [0]
 Tuesday, March 27, 2007

The Ado and Data blogs have posted links for the screen casts from this mornings VSLive KeyNote.

Data

ADO.Net

posted by Aaron Fischer on Tuesday, March 27, 2007 8:48:58 PM (Pacific Standard Time, UTC-08:00)   #    Comments [0]
 Sunday, March 25, 2007

Here is my way of getting a DotNet DLL to load its app.config file.

AppDomain.CurrentDomain.SetData ("APP_CONFIG_FILE",ConfigFile);

Where ConfigFile is the full path to your application's app.config file.(c:\test\myapp.config)

posted by Aaron Fischer on Sunday, March 25, 2007 8:32:29 PM (Pacific Standard Time, UTC-08:00)   #    Comments [1]
 Thursday, March 22, 2007

Microsoft's XML Team just announced the release of XML Notepad 2007 2.3

You can find the change log here and down load here.

This is the new feature that caught my eye.

"better handling of XML documents containing illegal characters"

posted by Aaron Fischer on Thursday, March 22, 2007 8:27:02 PM (Pacific Standard Time, UTC-08:00)