The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 2,979 other subscribers

Archive for December 25th, 2013’s present: “Press Now” button inserts a backslash (\) before every quote! @wordpressdotcom

Posted by jpluimers on 2013/12/25 had a nice end-of-year present too: inserting a backslash (\) before every single (‘) or double (“) quote on various sites:

It\’s not your fault. Code rots. We don\’t hold entropy against you, but we expect you to give a damn. This story is about code that brings new meaning to the word \’legacy\’. The accidental discovery of this body of code provoked a moral crisis. I wanted to pretend I hadn\’t seen it, yet I couldn\’t justify tiptoeing quietly away. This talk examines the dilemmas we face when balancing our choices today with their cost tomorrow. It\’s not your fault. Even so, it is your responsibility.

Clearly they haven’t watched this video:

Since don’t seem to bother reacting on their payed customer support forum within reasonable amounts for a long while, I’ll be publicly posting about their issues from now on.

Merry X-mas!


via: ▶ Baruco 2013: Here Be Dragons, by Katrina Owen – YouTube.

Posted in Power User, SocialMedia, WordPress | Tagged: | Leave a Comment »

.net – xcopy ASP.NET / WinForms deployment: find common location to access relative files to it (via: Stack Overflow)

Posted by jpluimers on 2013/12/25

StackOverflow user Joe (sorry, no last name) helped me big time by answering my question on Business logic shared by ASP.NET / WinForms: find the location of the assembly to access relative files to it.

Before showing the code at the bottom of this blog post, let me explain the question in more detail:

Basically I was in the midst of refactoring some ‘inherited’ business logic code that – before refactoring – for the ASP.NET side needs to be initialized with an absolute path, but on the WinForms / WPF side only with a relative path to a GetExecutingAssembly directory.

To ease xcopy deployment, I wanted all configuration settings to be relative. But I hadn’t found a common means for these platforms to obtain a directory usable as a root for accessing relative files.

That way I could put identical settings in both the Web.config and App.config, heck even generate them based on a common fragment, whithout having to hard-code absolute path names.

I knew about Assembly.GetExecutingAssembly, but in ASP.NET that location is not where the web site is (both IIS and the WebDevelopment server make use of temporary locations to store the assemblies).

ASP.NET does have Server.MapPath and HostingEnvironment.MapPath, but I didn’t want to make the business logic depend on ASP.NET.

Joe came up with this solution, which works dandy: Read the rest of this entry »

Posted in .NET, .NET 1.x, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, ASP.NET, C#, C# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Development, F#, Prism, Software Development, VB.NET, VB.NET 10.0, VB.NET 11.0, VB.NET 7.0, VB.NET 7.1, VB.NET 8.0, VB.NET 9.0, Web Development | Leave a Comment »

%d bloggers like this: