Recent Comments



Rick Strahl
Yesterday

re: WCF WS-Security and WSE Nonce Authentication

@Remesh - You need to add a reference to System.IdentityModel...


Ramesh
Yesterday

re: WCF WS-Security and WSE Nonce Authentication

Hi Rick, thanks for providing this detailed solution as I am running into a similar issue where my WCF client need to send nonce to Java WS. However, this solution doesn't work for .NET 4.5.x because 'IdentityModel' does not exist in the namespace 'System'. Any suggestions on how to make it work? Thanks in advance.


Pete Wilson
Tuesday

re: Creating a Dynamic DataRow for easier DataRow Syntax

After using this for a while in LINQPad, I think a few extensions are useful. I added indexers for column names that aren't proper C# identifier syntax, and implicit conversions to/from DataRow as well as a member implementation of the DataRowExtensions Field<>() function.


Mike Caldera
Sunday

re: Using Let's Encrypt with IIS on Windows

Thank you for the Information. I had previously given up trying to install these certificates and converting them to IIS7. The Easy Way: LetsEncrypt-Win-Simple was actually the fastest and easiest for me.

Thank you 1000x time.

Mike


roy
Sunday

re: Using Let's Encrypt with IIS on Windows

Xiao, did you fix the issue you had with the renewals ? if so, what did you do to fix it ?


Richard L
Sunday

re: Use Powershell to bind SSL Certificates to an IIS Host Header Site

Given that you've done this in PowerShell, a better option than MakeCert which needs to be installed is the cmdlet New-SelfSignedCertificate:

$cert = New-SelfSignedCertificate -DnsName $hostname -CertStoreLocation Cert:\LocalMachine\My -NotAfter 2020-01-01

This can be combined with retrieving the existing certificate to make your script generate a cert if needed...

$cert = Get-ChildItem Cert:\LocalMachine\My | Where-Object { $_.Subject -eq "CN=$bindinghostname" }
if (!$cert) {
    $cert = New-SelfSignedCertificate -DnsName $bindinghostname -CertStoreLocation Cert:\LocalMachine\My
}

Dave
Sunday

re: IIS Default Documents vs. ASP.NET MVC Routes

Rick, I know this is old but any chance you know how to achieve the same with ASP.NET Core, which use the RouteBuilder rather than the RouteCollection to configure routes. Cheers, Dave


To-mos
February 17, 2017

re: Replacing jQuery.live() with jQuery.on()

Interesting read on the differences between bind, live, delegate, and on. As it turns out bind, live and delegate all pass their inputs to the on function anyway.

http://elijahmanor.com/differences-between-jquery-bind-vs-live-vs-delegate-vs-on/


Rick Strahl
February 17, 2017

re: New CODE Magazine Article: Getting down to Business with ASP.NET Core

Working on it now. It missed the current issue but we're shooting for the next one.


Ross
February 17, 2017

re: New CODE Magazine Article: Getting down to Business with ASP.NET Core

Great article. Was wondering when we can expect the next article featuring the Angular 2.0 front end discussion?


Tom Robinson
February 14, 2017

re: Video Rendering Issues for WPF Windows

Good write up, and thanks for taking the time to fix it.

It's worth adding that I've also experienced a similar issue with Visual Studio 2015 (also WPF based), particularly with the Find/Replace dialog. Dragging it around to another monitor or forcing a redraw by resizing it usually helps.

I've found this too which is another variation on the above: https://connect.microsoft.com/VisualStudio/feedback/details/1652598/visual-studio-window-turns-black-after-dragging-a-window-to-a-different-monitor-then-maximizing-windows-10


Robert Muehsig
February 14, 2017

re: Video Rendering Issues for WPF Windows

We are facing similar problems with our own WPF app and it is not tied to MahApps. We have seen this problem on different laptops. It does also occure with a Geforce 750m + Intel HD integrated, so it is not only the mentioned video card. I'm not sure what the root cause is, maybe the Nvidia optimus stuff or the actual Intel HD drivers.

In the end we also used the software rendering approach, which is sub optimal, but works quite well.


Sejal Panchal
February 13, 2017

re: Smoothing out <div> scrolling in Mobile WebKit Browsers

Hi, I am using ionic for my mobile appl, I have one template which gets 500 records and lists each item using ng-repeat on tag with input boxes. My issue is when I start entering inputs to input boxes initially, the scrolling and focus on input box is really fast. But after I reach entering input to near about 150 records, there is 4-5 seconds of delay to focus in each input box and can't scroll the page at all, which then freezes my app completely. NOTE: This issue only happens in iOS devices and not on Android or browser. Please help! Its really urgent for me to fix. Thanks!


AlexB
February 13, 2017

re: Using Let's Encrypt with IIS on Windows

Thanks, I can't believe how easy that was... all those years of struggling.


Hansson
February 10, 2017

re: I can’t find my Find Dialog in Visual Studio

The "Window -> Dock"-tips made my day. Possibly because I don't have english layout on the keyboard. Of course I wouldn't have find it if it wasn't for this website :)


Erik
February 09, 2017

re: Accepting Raw Request Body Content with ASP.NET Web API

Hello @RickStrahl nice post, I'm new in the .NET world. I can't read the body content from a Request(System.Web...) object. always is null. I've been trying different ways, is an MVC Project created in Xamarin. The thing is that the JSON sended in the POST request may has differents properties.


Rick Strahl
February 09, 2017

re: An easy way to create Side by Side registrationless COM Manifests with Visual Studio

Web Applications running under IIS work very differently due to permissions and profile information that IIS is running over. Last I checked you need a third party library or some custom loader code for this to work that basically creates a few custom forwarding events. It's complicated to set up especially if you need to register multiple COM objects.

You can probably find by searching for ActivationContextModule/ActivationContextHelper.

Just be aware it's a pain to do this and get this right.


OFir
February 09, 2017

re: An easy way to create Side by Side registrationless COM Manifests with Visual Studio

Hi Rick, thanks for a great artical, i really need your advice here, i have an wpf application referanced to a manifest file and everything is working great, when i am trying to referance the same manifest file in a web application it doesn't work.

What am i missing here? is there a different between referancing a dll file using manifest (SxS) when using .exe and web application (WebAPI2 or WCF service) ?

Thanks, Ofir


simon
February 08, 2017

re: Passing multiple simple POST Values to ASP.NET Web API

How do Passing multiple simple POST Values IN ASP.NET Core? Thanks!


Amit
February 05, 2017

re: Using FiddlerCore to capture HTTP Requests with .NET

In fiddler core's new versions (4.6.3.50306) i can't able to get all the preferences (especially "fiddler.certmaker.bc.cert" & "fiddler.certmaker.bc.key") but in the old version (i.e. 4.5.1) its working fine.

Code: FiddlerApplication.Prefs.GetStringPref("fiddler.certmaker.bc.cert", null));

FiddlerApplication.Prefs.GetStringPref("fiddler.certmaker.bc.key", null));

What might be the problem?


Jeremiah
February 04, 2017

re: New CODE Magazine Article: Getting down to Business with ASP.NET Core

Good stuff Rick. Curious whether you'd recommend for/against attempting to use this same architecture (.Net Core EF/API/Angular) with one exception: tying into an existing and much more complex MSSQL database with hundreds of stored procedures? Thanks!


Alan
February 04, 2017

re: Windows Update Hell

My Win 7 Professional desktop has become impossible to update since the November 2016 update.

I have run a Linux OS machine for fun on old hardware since 2004 initially Red Hat finally settling for Linux Mint - currently 18LTS. Despite running Linux, my Win 7 Professional machine has been my main computer running SQL Server 2008 RT and the Visual Studio Stack. I have extensive VBA programming skills built up over 15 years and have developed many complex programs in VBA some professionally at work some for home projects.

Now I find myself forced to abandon the OS and software of choice and which should be usable for at lease another three years and will migrate my last Windows computer to Linux Mint 18 LTS. Currently I am learning Python to replace my VBA skill set (should have done it years ago) and will import my databases into Postgresql.

Microsoft have lost the plot and are badly treated licensees enforcing these broken updates on them and will loose many more faithful users over the coming months. Note, I have been advocating Linux Mint for several years for casual home users who mainly use their computers for web browsing plus typing the odd letter.

Disgusted with MS

Alan


Xiao
February 03, 2017

re: Using Let's Encrypt with IIS on Windows

Hi

I am trying to do my first renewal but when I use LetsEncrypt --renew it tells me that my cert can't be renewed as it is still valid but when I go to my website my cert has expired.

Any else have this issue? I have 2 sites that are using ssl on my site. I checked Require server name identification.


Web API call does not work on IIS Net.Core Angular 2 (works fine under IIS Express), got 404 error!
February 03, 2017

re: Publishing and Running ASP.NET Core Applications with IIS

I got this error when calling the Wep API from Angular 2 client:

Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:80/api/SampleData/AuditLogTableName/?tableName=CENTITYNAME

This is the code:

constructor(private http: Http, private pagerService: PagerService) {
            var res =  this.http.get('/api/SampleData/NTLogTableName/?tableName=' +'CTBL_NAME')
            .subscribe(result => {
                this.tableNames = result.json();
                this.tableNameStr = this.tableNames[0];
                this.onTableNameChange(this.tableNameStr);

    });

This is the Controller: [Route("api/[controller]")] public class SampleDataController : Controller {

    [HttpGet("[action]")]

    public async Task<List<string>> NTLogTableName(string tableName)
    {

}

It works fine in IIS Express!

(BTW I tried combination of '/api' './api' 'api' without any luck)

Thanks much!

Reinhard Sual


Wal
February 03, 2017

re: Publishing and Running ASP.NET Core Applications with IIS

Rick it appears a 'normal' reverse proxy in IIS is straight-forward. I used this article1 and got it working. stoked! So for anyone else who chances upon this you set up an empty website in IIS that uses URL Rewrite to forward everything to your dotnet-core app running as a windows service which listens on localhost only.


Michael Vinther
February 03, 2017

re: Watch out for XmlDocument.PreserveWhitespace when dealing with Digital Signatures

Unfortunately this doens't handle all whitespace issues. A tag like will still be changed to


Rick Strahl
February 03, 2017

re: Publishing and Running ASP.NET Core Applications with IIS

Not sure, but if that's what you want to do you really just want a true reverse proxy. Maybe look into nginx on Windows to just do straight up proxy forwarding.


wal
February 02, 2017

re: Publishing and Running ASP.NET Core Applications with IIS

Rick, is it possible for IIS just to proxy the requests to the dotnet-core app and not manage its lifetime? the reason for asking is that I have an application with threads that I want to run as a windows service (that also listens for requests from IIS on port 5000). When i run my dotnet-core app as a service IIS simply ignores it and spawns another process for my dotnet-core. What i want AspNetCoreModule to do is go 'oh its already running and i speak to it on port x'


Gary
February 02, 2017

re: IIS Default Documents vs. ASP.NET MVC Routes

Thank you so much for this. I spent nearly two days trying to fix this problem with a webapi app. This is the only article I found that was of any help.


Hunter
February 01, 2017

re: Adding Files to Visual Studio Projects

Hi Rick

Thanks for the blog post. I thought the new csproj files solved this problem but maybe I am all wrong on this.

Thanks


Justin Braun
February 01, 2017

re: Using Let's Encrypt with IIS on Windows

Great article, Rick. Been looking for the best way to do this with IIS going forward. This appears to be the best method at this point. Thanks for digging into it and sharing.


Rick Strahl
January 31, 2017

re: External JavaScript dependencies in Typescript and Angular 2

@Vincent - if you're not getting any errors that means the code is actually compiling and most likely actually running. If the assignments/casting isn't working you would most definitely get errors - either a typescript compile error or a runtime error with the missing $ reference.

Best thing to do is set a breakpoint and step into the code and see if the methods are fired.

The other thing you have to watch out for are timing issues. You're loading jQuery via dyanamic loading but you're loading the cron library via script link. It's actually quite likely that the cron lib will load when jQuery has not yet loaded and that will cause problems.

Base libraries that other things depend on I prefer to load explicitly so I would load jQuery as a script rather than let Webpack pull it in. The other alternative is to load both via WebPack and make sure the reference order is right.


Rick Strahl
January 31, 2017

re: Web Browser Control & Specifying the IE Version

Harshith, the registry keys should most definitely work. Make sure you are specifying the right EXE process that is hosting your control. For example, when running from Visual Studio you maybe hosting inside the Debug Host container rather than your EXE. Check task manager if in doubt.


Vincent
January 27, 2017

re: External JavaScript dependencies in Typescript and Angular 2

I followed your tutorial to use jquery cron (http://shawnchin.github.io/jquery-cron/) with jquery inside my ionic 2 / angular 2 mobile app.

import $ from 'jquery';

window["$"] = $;
window["jQuery"] = $;

export class CronPage implements OnInit {

  ngOnInit() {
      (<any> $("#selector")).cron();
  }
}

And added the plugin in the index.html after the main.js

<script src="build/main.js"></script>
<script src="assets/jquery-cron/cron/jquery-cron.js"></script>

Result:

It showed NO ERROR whatsoever, but it did not work! The cron select controls did not appear at all.

What is still going wrong?


Andrew
January 26, 2017

re: Flexbox Containers, PRE tags and managing Overflow

I too needed this fix as an injected article layout was destroying my flex pages. Thanks for publicizing the technique.


Kirk
January 25, 2017

re: An easy way to create Side by Side registrationless COM Manifests with Visual Studio

Your post was very useful. Microsoft must of fixed the auto adding of a manifest in Visual Studios because I did not have to do any kind of removal. I just changed the property and compiled. I am using 2013. Saved me a great big headache.


Harshith
January 25, 2017

re: Web Browser Control & Specifying the IE Version

Hello Rick,

Thanks for your reply.

Yes, the problem is because of browser version. Till May 2016 we had mete tag as and jquery version 1.4.2 ,jquerry-ui version 1.8.4 and we used to load the maps there we had no pronlem at all!!

But after Google Maps API version updated to 3.25 we are getting popup error poly.js(only for Google maps customized with polylines)

I tried changing meta tag to 10/11 or Edge it was showing access denied error because of oudated jquery version 1.4.2 so i update to latest 3.1.0 or 3.1.1. I was not getting Access denied error but map wasn't loading just a WHITE BLANK SCREEN!!

2.I added the DWORD at HKCU/HKLM with same EXE name as displayed in task manager.But i did not see any effect of this.


Harshith
January 25, 2017

re: Web Browser Control & Specifying the IE Version

Hi Rick,

We have a 32 Bit MFC(MDI) application developed from Visual Studio. It runs on 64 Bit Windows 7.

We have a Web Browser control derived from CHTMLView, which used to load google maps.

As we by default Browser control has IE 7 settings I used to get a pop up error called poly.js (https://code.google.com/p/gmaps-api-issues/issues/detail?id=10310) in order to resolve this we had two options

  1. Registry hacks using FEATURE_BROWSER_EMULATION which did not work for me.

  2. this used to give access denied error because i had jquery version 1.4.2 which is very old.

The problem come here , after this access denied error i updated the jquery version to latest 3.1.0 and i dont get any error but i see WHITE BLANK SCREEN!!! this is the issue i am facing when i load googles maps through the MFC Browser.

How to resolve this issue?? i have tried many workarounds but no luck.

Is there any way to update browser control default rendering version from IE7 to IE 10/11 or Edge?

This has become a nightmare for us!! please help to resolve this issue.


Shoaib
January 24, 2017

re: Publishing and Running ASP.NET Core Applications with IIS

Hi,

I am trying to deploy my ASP.Net core web application on shared server but I am getting 500 error.I have tried everything I can.Do we need ASP.Net Core sdk to be installed on shared server for application to run.


Rick Strahl
January 23, 2017

re: Web Browser Control & Specifying the IE Version

Harshith, are you sure the issue is the browser version and not an issue with your javascript code potentially? The best way to check is to add some HTML5/CSS3 code to the page you're testing and see if it renders those pieces. Also make very sure that your EXE file matches what you are running and make sure it goes into the right registry location. I prefer using the HKCU because it'll work regardless whether it's 32 or 64 bit.


Harshith
January 23, 2017

re: Web Browser Control & Specifying the IE Version

Hello Rick,

I have a 32 bit MFC application running on 64 bit Windows 7. Application has web browser in which we view Google maps(poly.js error Issue 10310 at google developer forum), After changing in the registry or meta tag it does not work for me.

Any suggestion??


Rick Strahl
January 18, 2017

re: Using Let's Encrypt with IIS on Windows

Walt - I use https redirects and it seems to work. I think for the first registration it has to be http, but for renewal https requests seem to work for me.


Walt
January 18, 2017

re: Using Let's Encrypt with IIS on Windows

Hi.

Thanks much for the post on Let's Encrypt. I am now using LE for a company home page. However, I want to redirect all HTTP traffic to the HTTPS protected web site, and from what I understand, LE uses HTTP to request renewals? Will such a redirection cause issues with the automatic renewal?

Thanks much for any suggestions / help! Walt


Gunther
January 17, 2017

re: New CODE Magazine Article: Getting down to Business with ASP.NET Core

A timely article for me, working on my first Asp.NET Core app.
I'd be interested in a "How To..." article on deploying an Asp.NET Core app to an IIS server -- if you're looking for future topic ideas. :)


Damon Allison
January 17, 2017

re: .NET Standard 2.0 - Making Sense of .NET Again

Great article. It gave me a "real world" state of the .NET Core platform. From my limited usage of .NET Core, I completely agree with Rick. The current state of tooling, standards, direction is confusing at best. Microsoft desperately needs to simplify their messaging to developers.


Rick Strahl
January 14, 2017

re: Faking out the .NET Runtime Version

Thanks Knaģis. I have to experiment to see how this works, but adding a 4.6.2 launcher project and leaving the main project as a 4.5.2 project seems like a great way to go. Just have to get the naming right... thanks for the inspiration.


Kenan
January 14, 2017

Knaģis
January 14, 2017

re: Faking out the .NET Runtime Version

A second project targeting 4.5.2 would enable compile time checks verifying that all framework methods are supported both in 4.6.2 and 4.5.2.

I think that the IDE actually understands when a file belongs to multiple projects because I have seen it hinting in the Intellisense when a certain framework method is only available in one of the projects.

In CommonMark.NET I did manage to set up the projects so that I have only one that shows the files in Visual Studio (so that is the one where I would add/remove files etc.) but there are others that import this project but then compile it against a different target framework.


Mark
January 13, 2017

re: New CODE Magazine Article: Getting down to Business with ASP.NET Core

My CODE subscription lapsed years ago. I just renewed it :)