Category: .Net

HowTo: Save a file from Silverlight using the SaveFileDialog

Saving a file from Silverlight using the SaveFileDialog, added in Silverlight 3, is easy. If you’re used to desktop development however, you might find yourself getting a SecurityException with the message ‘File operation not permitted. Access to path ‘xxx’ is denied.’. Here’s why: In desktop development, you’re used to getting a filename from a SaveFileDialog. …

Read More “HowTo: Save a file from Silverlight using the SaveFileDialog”

‘Cannot find entry to delete’ deleting files from a Zip with (SL) SharpZipLib

For a project I’ll probably dedicate a post on this blog to in the future, I needed a ZIP library for Silverlight. After asking around on twitter (@rickvdbosch) I was pointed towards the SharpZipLib port on Codeplex, found on http://slsharpziplib.codeplex.com. Basically what I wanted to do was replace a file inside the ZIP file with …

Read More “‘Cannot find entry to delete’ deleting files from a Zip with (SL) SharpZipLib”

Using Crystal Reports in ASP.NET on a 64 bit machine

The above scenario gave me the well-known could not load file or assembly error message. The assembly that couldn’t be found was  ‘log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304’. Or one of its dependencies of course… The situation in which I was getting this error message: using the CrystalReportViewer in an ASP.NET application having the ASP.NET application hosted …

Read More “Using Crystal Reports in ASP.NET on a 64 bit machine”

Little-heard-of ASP.NET feature: app_offline.htm

Although the feature has been around since ASP.NET 2.0, I still meet people that don’t know and/or use app_offline.htm. Do you know (and use) the feature…? When working on an ASP.NET web application, you should notify your visitors in a decent way that your application is down. There’s a nice default feature available for these …

Read More “Little-heard-of ASP.NET feature: app_offline.htm”

“AjaxControlToolkit is undefined”

Because we were still using an old Visual Studio 2005 solution which included a Web Site project, it was time to upgrade. We upgraded our Visual Studio 2005 solution to Visual Studio 2010 (and .NET 4.0), converted the Web Site Project to a Web Application Project and then, of course, the AjaxControlToolkit had to follow. …

Read More ““AjaxControlToolkit is undefined””

“The project location is not trusted”

After installing Windows 7 and Visual Studio 2010 on my laptop, I ran into the well-known message “The project location is not trusted”. I thought all I had to do was follow the instructions in this MSDN article to get my development share to be trusted again, but this doesn’t seem to work. I already …

Read More ““The project location is not trusted””

Fix available for IE8 asp:menu problem

I just read an interesting article on Bertrand Le Roy’s blog. The most important information: It so happens that the menu control is making a bad assumption on what the default value for z-index should be. We debated this at length with the IE team, but it became clear as we did so that they …

Read More “Fix available for IE8 asp:menu problem”

In this mode, command line arguments will not be passed to the executable

When trying to pass some command line arguments to a Console Application, I got the following message: “The current project settings specify that the project will be debugged with specific security permissions. In this mode, command line arguments will not be passed to the executable. Do you want to continue debugging anyway?” (see image) I …

Read More “In this mode, command line arguments will not be passed to the executable”

HowTo: Add a body onload script to a page that uses a MasterPage

When you use a MasterPage to define the design of your website, you might come across the problem that there is no body element in a web content form. This can be a problem when you want to add an onload script to a specific page. You could of course add the onload on the …

Read More “HowTo: Add a body onload script to a page that uses a MasterPage”

Nice new addition to ASP.NET

Scott Guthrie posted about a cool new ASP.NET server control: Chart. It can be used for free with ASP.NET 3.5 to enable rich browser-based charting scenarios. Read more over here: http://weblogs.asp.net/scottgu/archive/2008/11/24/new-asp-net-charting-control-lt-asp-chart-runat-quot-server-quot-gt.aspx

Inline wrappers & Response.Redirect() == Error

While developing a page that was to be used through an inline wrapper, I got an error: “Validation of viewstate MAC failed”. This error can usually be resolved by disabling event validation, viewstate encryption or viewstate for the MAC. In my case these solutions did not resolve the issue. After some testing Response.Redirect appeared to …

Read More “Inline wrappers & Response.Redirect() == Error”

An inline wrapper and having too much on your head

We developed an ASP.NET page (A) to be wrapped in an existing PHP page (B) using an inline wrapper. After a few days in which both pages displayed nicely, our page (A) suddenly got displayed twice inside the existing page (B).  And even weirder was that the postbacks of the first occurrence didn’t work, and …

Read More “An inline wrapper and having too much on your head”

StyleCop v4.3 now available

StyleCop version 4.3 was released last tuesday. A short summary of what version 4.3 brings us:  Various bugfixes, including fixes for VS integration issues Rules documentation is included and integrated into VS “Show Error Help” New rules, see blogpost for the rules Branding change from Source Analysis to StyleCop LinksStyleCop blog: http://blogs.msdn.com/sourceanalysis/Release announcement on the …

Read More “StyleCop v4.3 now available”

Running code analysis on a custom stsadm command gives errors CA0052 and CA0055

When you want to implement a custom stsadm for SharePoint, all you realy have to do is implement the Microsoft.SharePoint.StsAdmin.ISPStsadmCommand interface. Because I develop on a machine with no SharePoint installed, I (only) copy the assemblies I need to develop locally. For the stsadm command I was working on recently (more on this in a …

Read More “Running code analysis on a custom stsadm command gives errors CA0052 and CA0055”

A not so clear Visual Studio code analysis message (CA1308)

While writing a custom stsadm command for SharePoint (more on that in a future post) and having to do something based on the command the user typed in, I used ToLower(CultureInfo.InvariantCulture) on the command string to be able to check without the hassle of differences in casing. When I ran code analysis on my project, …

Read More “A not so clear Visual Studio code analysis message (CA1308)”