Last 50 Comments

re: UNC Drive Mapping Failures: Network name cannot be found
Yesterday @ 1:07pm | by jtlodi

Wonderful Rick. Obviously you've more than VFP in your toolbox!
MadFox says "Hello"
re: Updated ASP.NET Database Resource Provider
Wednesday @ 3:08am | by Mike

Could you please le us know where to start in order to change to a mySQL database? Thanks
re: HttpWebRequest and Ignoring SSL Certificate Errors
Tuesday @ 8:24am | by Michael Bray

FYI this can now be set per-connection on HttpWebRequest in .NET 4.5
re: A jquery-watch Plug-in for watching CSS styles and Attributes
Monday @ 12:18pm | by Rick Strahl

@Richard - Thanks for catching this and also for entering the issue on Github. Fixed.
re: Using FiddlerCore to capture HTTP Requests with .NET
Monday @ 12:14pm | by Rick Strahl

@Solomon - did you actually read the post??? You can obviously capture output from other domains but you can capture localhost traffic. You can also capture SSL traffic but you have to enable it - see the bottom section of the post.
re: Help with working with multiple Unicode Locales in a VFP ANSI application
Monday @ 11:49am | by Rick Strahl

@Marlo - the Codepage has to be the same both on the input end and the output end. So the database has to be in the right code page, the client that created the record had to be using the same codepage and the user on the other end reading the data has to use the same codepage. If anywhere in there the codepage doesn't match you get the ???? character translation issue.
re: A jquery-watch Plug-in for watching CSS styles and Attributes
Monday @ 6:52am | by Richard

If I'm reading this right, there's a problem with reading the initial value of attributes:
$.each(data.props, function (i) { data.vals[i] = el$.css(data.props[i]); });

Shouldn't that be checking whether data.props[i] starts with "attr_", and calling el$.attr if it does?
re: Using FiddlerCore to capture HTTP Requests with .NET
Monday @ 2:47am | by Solomon

Great work -request to server normally come from client anywhere not localhost. Hostname is confiured to this regards.Am I missing anything here please - do this program decrypt SSL from incoming request from another machine even though certificates was created in the code?. I can see this in code // Ignore HTTPS connect requests
if (sess.RequestMethod == "CONNECT")
return;
re: Help with working with multiple Unicode Locales in a VFP ANSI application
October 18, 2014 @ 10:04pm | by MARLO

hi is anybody can help me regarding the russian characters for example in the entry form or if you upload to foxpro 9 dbf files it became scrats ?????...
I already change the settings of my computer to russian but the same...if you type in foxpro dbf file russian character p the system will change it to b i dont understand why....
re: West Wind WebSurge - an easy way to Load Test Web Applications
October 17, 2014 @ 7:02pm | by Rick Strahl

@Joe - What would you like to see and which parts do you want open for automation?

Currently you have command line operation so you can fire off tests from a build process or test harness.

If you have a focused idea for a feature you're looking for you can open an issue on Github (https://github.com/RickStrahl/WestWindWebSurge/issues), or if you want to have a more interactive discussion you can leave a message here or on our message board (http://west-wind.com/wwThreads/default.asp?forum=West+Wind+WebSurge). I'd be happy to explore what you're thinking about...
re: West Wind WebSurge - an easy way to Load Test Web Applications
October 17, 2014 @ 5:46pm | by Joe

This tool seems very thorough. Can this tool be adapted to automate testing?

Thanks for the free tools and reasonably priced products your offer.
re: DataTable JSON Serialization in JSON.NET and JavaScriptSerializer
October 17, 2014 @ 8:49am | by Jacob

This might help someone in the future, maybe me after I forget what I did.

Made a change to the DataRowConverter to handle rows that are sub-tables. Note that the method uses the newer parameterization, passing the root JsonSerializer.

        public override void WriteJson(JsonWriter writer, object dataRow, JsonSerializer serializer)
        {
            DataRow row = dataRow as DataRow;
 
            //JsonSerializer ser = new JsonSerializer();
 
            writer.WriteStartObject();
            foreach (DataColumn column in row.Table.Columns)
            {
                if (column.GetType() == typeof(DataTable))
                {
                    DataTableConverter converter = new DataTableConverter(json);
                    converter.WriteJson(writer, column, json);
                }
                writer.WritePropertyName(column.ColumnName);
                //ser.Serialize(writer, row[column]);
                json.Serialize(writer, row[column]);
            }
            writer.WriteEndObject();
        }

re: Capturing Performance Counter Data for a Process by Process Id
October 14, 2014 @ 12:54pm | by Rick Strahl

Thanks for the reference, Andrei. I've run into the 'process goes away' problem with long running process monitoring myself so I can relate to that.

OTOH, in cases when you are monitoring specific processes it seems that you are likely profiling a longer running process or service so this is probably much less of an issue than with just a desktop application that might come and go frequently.
re: Capturing Performance Counter Data for a Process by Process Id
October 14, 2014 @ 8:28am | by Andrei

Good article! One thing to mention related to windows process instance names is that they change dynamically when one of the processes exits.

For example if chrome#8 exits, chrome#9 will become chrome#8 and chrome#10 will become chrome#9. At this point getting the value of the counter previously created for chrome#10 will throw an exception.
This is really annoying if you want to to monitor multiple instances of multiple processes as it gets down to monitoring process exits and recreating all the counters (really ugly).

One way would be to change the way process instance names are generated (see http://support.microsoft.com/kb/281884) but this has the potential of affecting other apps using the perfmon api.
re: Error on 64 Bit Install of IIS – LoadLibraryEx failed on aspnet_filter.dll
October 13, 2014 @ 6:21am | by Vlad

Thank you for posting this, helped me a lot. While searching for answers I saw that everyone else was happy with just enabling 32 bit apps on the application pool, you were among the few that were concerned about the root problem.

Cheers!
re: Self-Hosting SignalR in a Windows Service
October 10, 2014 @ 8:11am | by Matthew Nichols

Thanks for this Rick...I have had a hard time finding an example of calling into a Hub from an outside source to publish data to connected SignalR clients...this gets me started.
re: Chrome DevTools Debugging Issues
October 09, 2014 @ 1:16pm | by Rick Strahl

@Miki - For me opening the file doesn't work properly either. The code simply doesn't step the display. As you say the debugger seems to work - I can step and see the next stop in the call stack, but the file display doesn't keep in sync. Even if the same file worked with most apps these days my code steps through many source files. I'll check Canary again but last I checked a few days ago this didn't work.

What's frustrating is that it's intermittent. With some code it works just fine. With other code it simply doesn't work at all.
re: Westwind Application Configuration Updates
October 09, 2014 @ 1:05pm | by Rick Strahl

@Dirk - List encryption works only if you encrypt the entire list in the .config provider. IOW, the top level list property on the object. It'll encrypt/decrypt the encoded list string. There's no support for individual list values.

JSON storage in the database is not directly supported, but you can use the string provider to generate the JSON and store and retrieve that from the db manually. You can open an issue on Github and add it as a suggestion. Would be easy enough to add this functionality as another provider.
re: Chrome DevTools Debugging Issues
October 09, 2014 @ 11:48am | by PilotBob

I would suggest turning off source map support in the debugger. See if that helps.

There is always the IE debugger, visual studio, firebug, yea, I know... not helpful. ;)
re: Chrome DevTools Debugging Issues
October 09, 2014 @ 6:14am | by Miki

If your source file is already visible, try F10 to step over and force a scroll to the next line. From my experience, the actual debugging works fine, the problem is the UI not showing the current line.
Where is the logged issue? I'd like to +1 and track it.
re: Chrome DevTools Debugging Issues
October 09, 2014 @ 5:49am | by Jeremy

Ran into this as well. Is a known bug and only happens if you have the rev tools window up when the page is loaded. I switched to the dev version and it seems to be fixed there. Haven't run into it for a while.
re: Westwind Application Configuration Updates
October 09, 2014 @ 5:40am | by Dirk Beckmann

Hello I really love the Configuration Library. It's such a great tool!

I've got two questions. I'm using the SqlServerConfigurationProvider
#1. With support for Lists, how do I entrypt property in List objects? Is this possible?
#2. Is it possible to store the config data as JSON string in the database?

Best regards, Dirk
re: Chrome DevTools Debugging Issues
October 09, 2014 @ 2:07am | by FJ

Hi,

Discussed a little over on twitter, however a couple more you could try (long shots though!)

- Have you tried in-congito windows? If this works, it could be an extension you have installed (which is probably synced on your Google account, hence it manifests elsewhere)
- Turn off "Use hardware acceleration when available" in the settings - long shot I know, but I've had very strange behaviour fix itself after turning this off.

Sadly I think Chrome is becoming more unstable as the bloat increases, which is a shame as it's so nice to work with!

Good luck.
re: Chrome DevTools Debugging Issues
October 09, 2014 @ 1:22am | by Rik Hemsley

Yes, same here, and again clicking the top of the call stack is a workaround for me.
re: A WebAPI Basic Authentication MessageHandler
October 09, 2014 @ 1:03am | by Nick Gilbert

I have updated to WebAPI 2.2 from nuget and now I find this approach doesn't work. The code walks the same path but the service always returns unauthorized.

Is there a way to get this working again under the current version of WebAPI?
re: Use IIS Application Initialization for keeping ASP.NET Apps alive
October 08, 2014 @ 10:20pm | by Vetri

Hi Rick,

We have two IIS 7.5 web applications with below settings (2 different app pools),

1. Application 1 - Idletimeout = 0

2. Application 2 - Idletimeout = 20 (default value) - Application Initialization configured for this site.

Question 1

When we analyzed the performance of the both the sites, Application 1 is responding faster than Application 2 (After the new worker process generated due to idleness)

Question 2

For application 2, the new worker process gets generated after few minutes when the site is idle. What does this few minutes/ warm up period refer to? Where it can be configured? Is this based on Idletimeout?

Question 3

Assume like I have configured 'Application Initialization' for Application 1 as well (along with Idletimeout = 0)

Now if I recycle the app pool manually and assume no requests have reached the server yet, then will the Application Initialization sends the request after the warm up period?
re: Chrome DevTools Debugging Issues
October 08, 2014 @ 8:25pm | by Rick Strahl

@Matt - for me a refresh doesn't work. I have to quit. I'm going to give @Miki's not a try and see if that helps (can't check this very minute), but I don't think that'll work for me either as I can see the source file open, but still the line is not selected in the debugger.
re: Chrome DevTools Debugging Issues
October 08, 2014 @ 7:48pm | by Miki

Yes, I've seen it too. Hope it gets fixed soon. My workaround has been clicking on the top file of the Call Stack panel to make the source file visible, sometimes I have to hit F10 to force a scroll to the current line, actually next line.
re: Chrome DevTools Debugging Issues
October 08, 2014 @ 7:32pm | by Matt

Yes, I have experienced this too. I honestly haven't thought anything of it and just hit refresh then it started working correctly
re: Using JSON.NET for dynamic JSON parsing
October 08, 2014 @ 7:26pm | by Ryan

JSON.NET is fine for most JSON serializing when it comes to dynamic objects as long as ALL the properties on the object are dynamic.
If you have an object, say MyClass which implements a DynamicObject

    public class MyDynamicClass : DynamicObject 
    {
        public string MyStaticString { get; set; }
    }


then you try serialize this object you will notice weird behavior
var c = new MyDynamicClass();
c.MyStaticString = "foobar";
 
Console.WriteLine("JSON.NET: " + JsonConvert.SerializeObject(c));


Notice how the MyStaticString property is not there. Not ideal.
re: Resource Unloading in a custom ASP.NET Localization Resource Provider
October 06, 2014 @ 12:16pm | by Rick Strahl

@KA - You tell me. Why do you say the static is bad in this situation? Just because you've read somewhere that static is evil and not easily testable in some situations?

Resources are one time loaded entities and that's exactly the problem a static is supposed to solve - it's a reliable way to have a singleton object that is shared across threads.

Loading resources happens once per resource set, so this is not a high impact operation since it only happens once (per set). After that initial load, they're just parked in memory. What's not scalable about that? That's exactly how the .NET resource managers work, precisely because it IS scalable and works for a multithreaded environment.
re: Resource Unloading in a custom ASP.NET Localization Resource Provider
October 06, 2014 @ 3:53am | by KA

Do you have any other idea how this can be solved.
I don't like it this way. Because all the ResourceProviders with a lots of resources already cached are kepth in memory.
This way the app doesn't scale.

internal static List<IwwResourceProvider> LoadedProviders this is the ugly part. The static property :)
re: WSDL Imports without WSDL.exe
October 03, 2014 @ 1:15pm | by Alexander

this code don't work with this:
http://www.onvif.org/onvif/ver10/device/wsdl/devicemgmt.wsdl
however it work with the wsdl.exe tool
I trying to solve this for several days. Please any help will be significant.
re: Project Navigation and File Nesting in ASP.NET MVC Projects
October 03, 2014 @ 8:53am | by Natan

I like the idea of removing the blockinghandler and using JS and CSS together in the views folder. But after a while, I noticed that I'm not even using MVC views anymore, as pure html files makes most of the templates nowadays, and they go to the "app" folder.

I leave MVC views for cases where I want to pre-process html views with server-generated content. It is not common, but sometimes makes your life easier and the app faster.

Also, I have been using bower instead of nuget for all javascript/css dependencies. This removes any need to care for Script/Contents folder mess and I can just delete those.
re: Updated ASP.NET Database Resource Provider
October 01, 2014 @ 5:33pm | by Rick Strahl

The provider was designed for SQL Server, but it'd be fairly easy to modify the db access code to work with MySql. The SQL is very standard so if you provide the MySql provider it might just work.

Next update will have better provider support (Mongo and other SQL dialects) but for now you'd have to customize the DB access code.
re: Updated ASP.NET Database Resource Provider
October 01, 2014 @ 12:58pm | by john

Would it be possible to use a MySQL database?
re: Assembly Loading across AppDomains
September 29, 2014 @ 12:08pm | by Michael Brown

CHOLAN.R is correct. The code loads all dependencies within the parent AppDomain, not in the domain that you created.

AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);

It does not appear possible to load the dependencies in the newly created domain which is rather pointless, and I have not found a workaround for this as of yet. It never fires events on the new app domain (try it):

this.LocalAppDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);
re: Web Browser Control – Specifying the IE Version
September 26, 2014 @ 6:57am | by Joe De Ville

Ahh! I see what I did now. It's javascript embedded in the content I used as a template.

Operator error, as usual. :-)

Thanks!

Joe
re: Web Browser Control – Specifying the IE Version
September 26, 2014 @ 3:36am | by Rick Strahl

@Joe - .innerText should always return text not HTML. If it's returning HTML you like had encoded HTML text in the element in the first place. Maybe the assignment was incorrect (ie. assigning HTML to .innerText).
re: Web Browser Control – Specifying the IE Version
September 26, 2014 @ 3:12am | by Joe De Ville

Rick,

Really appreciate all the tips and info over the years. This tip in particular has helped me with an issue that's plagued me for the last several years.

My application of the webbrowser control is not nearly as sophisticated as many of the posters here, but once I edited the registry, I was able to get correct rendering and other behavior in IE 11.

I do still have a problem, though.

The InnerText property of the document now contains (or at least now returns) HTML along with the text, where previously I was able to capture only the text.

Do you know of a simple way to extract only the text (i.e. remove any superfluous HTML?

Thanks for any help.

Joe
re: ASP.NET MVC Postbacks and HtmlHelper Controls ignoring Model Changes
September 25, 2014 @ 5:24pm | by Bill Larkin

I puzzled and fought this for a whole afternoon. I didn't even know how to describe the problem and search the Internet for it. But then I stumbled on your write up that explained the problem. Thank you very much for a solution to a problem that was ruining my day!
re: Forcing an ASP.NET Application to 'stay alive'
September 24, 2014 @ 9:34am | by Rick Strahl

@Ron - you get 404 errors from what exactly? There's no reason that the response from an HTTP client wouldn't be same as from a browser unless the URL is incorrect. You may have to hardcode the URL explicitly rather than using relative or virtual paths to specify the URL.
re: Forcing an ASP.NET Application to 'stay alive'
September 23, 2014 @ 3:51pm | by Ron

I tried this in my WebAPI application and it works perfect when I run the app from visual studio, but when I deploy it to QA or PROD I'm getting 404 errors. If I take the same url and run it from the browser it is fine.

How can I fix this?
re: Rendering ASP.NET MVC Razor Views outside of MVC revisited
September 23, 2014 @ 1:11pm | by Rick Strahl

Rodrigo - no this particular code does not work outside of ASP.NET as mentioned in the article. If you need to run completely outside of ASP.NET you can use the Razor Hosting Library:

https://github.com/RickStrahl/Westwind.RazorHosting

Takes a little more work to set this up, but you can do most Razor operations easily.
re: A Small Utility to Delete Files recursively by Date
September 23, 2014 @ 1:09pm | by Rick Strahl

Aaron - yes it does normal command prompt wildcards for file selection. And of course you can run it multiple times for varying combinations of deletions if necessary.
re: Rendering ASP.NET MVC Razor Views outside of MVC revisited
September 23, 2014 @ 11:11am | by Rodrigo Pires

Hello Rick,

What if I'm running this code outside an ASP.NET app (meaning no HttpContext available), is it still possible to render the view?

Thank you!
re: A Small Utility to Delete Files recursively by Date
September 23, 2014 @ 9:50am | by Aaron

I haven't downloaded the utility yet, but will it accept various wildcards? I have some people doing massive amounts of testing against a server I've built, creating thousands of files and very strangely named folders each day. Currently I have a dummy script using question marks as wildcards to delete the oddly named folders. They now want the ability to run a script at will that will delete all (specific) files that are older than 2 hours (though I told them I can probably only do days). Hoping your tool will work for me, I'm really not a scripting guy :)
re: A Small Utility to Delete Files recursively by Date
September 22, 2014 @ 1:55pm | by Kenneth Spark

This utility worked great. I needed something to clean up lots of old text files on a regular basis. I tried the forfiles .. but that performed much slower. So slow in fact that the windows scheduler killed the job.
re: UNC Drive Mapping Failures: Network name cannot be found
September 21, 2014 @ 3:51pm | by Struggler

Thanks alot.

I was abaout to throw my computer away and go buy an mac...
re: Accepting Raw Request Body Content with ASP.NET Web API
September 21, 2014 @ 2:53pm | by Highdown

I have been reading your posts on Web API, and they have been very helpful in solving some of my client/server communication issues. Here are two other sites that I have garnered information to deal with uploading/downloading byte[]'s.

http://byterot.blogspot.com/2012/04/aspnet-web-api-series-part-5.html

http://stackoverflow.com/questions/9541351/returning-binary-file-from-controller-in-asp-net-web-api

I am using TypeScript/AngularJS on the client, and there wasn't much information readily available for something as simple as a byte[] upload/download with Web API. I was used to Silverlight and WCF RIA Services where you could easily upload strings, numbers, and multiple byte arrays in a single server upload.

I have finally been able to get a working client/server setup to upload/download a single byte[]. However, what I was hoping to achieve was to be able to upload more than one byte array at the same time. I do not think the Web API technology is designed to support this, but I could be wrong. Any thoughts?

What I may do is to merge my byte arrays on the client and then break them apart on the server. This is a little messier, but so far it is the only option that I have come up with.

Anyway, thanks for all your posts.

Regards...


West Wind  © Rick Strahl, West Wind Technologies, 2005 - 2014