Using Transloadit for file uploading & processing on your website

by Cliff 2. November 2013
Over the years I have used a variety of custom solutions to resize images, encode video, etc.  Transloadit provides a really nice cloud based solution that you can use with any technology stack.  From rails, to php, to JavaScript, you can interface with their API to upload images and videos.  They offer some easy to use plugins to help get you started https://transloadit.com/docs#jquery-plugin

Visual Studio 2010 SP1 IIS will not start

by Cliff 4. July 2011

If you install Visual Studio 2010 SP1 and then you find that IIS will not start, you may have a port conflict issue.  SP1 includes a new service, the Web Deployment Agent Service.  This new service runs on port 80, the same default port that IIS uses for HTTP traffic.  If the Web Deployment Agent Service is running, IIS will not start if you are using port 80 in IIS.  On option is to modify the web deployment agent service.  For me, I stopped and disabled since I do not plan to use.  You may be able to change the port is uses by default.  Additional info can be found at the link below

http://superuser.com/questions/282519/change-the-port-of-iis-7-5-express

.Net | IIS

Debug WCF service IIS specified authentication schemes 'IntegratedWindowsAuthentication, Anonymous', but the binding only supports

by Cliff 3. July 2011

If you want to debug a WCF service you may encounter the following error in Visual Studio:

IIS specified authentication schemes 'IntegratedWindowsAuthentication, Anonymous', but the binding only supports specification of exactly one authentication scheme. Valid authentication schemes are Digest, Negotiate, NTLM, Basic, or Anonymous. Change the IIS settings so that only a single authentication scheme is used.. ---> System.InvalidOperationException: IIS specified authentication schemes 'IntegratedWindowsAuthentication, Anonymous', but the binding only supports specification of exactly one authentication scheme. Valid authentication schemes are Digest, Negotiate, NTLM, Basic, or Anonymous. Change the IIS settings so that only a single authentication scheme is used

This can occur if the virtual directory hosting the service in IIS has both the Intergrated Windows Authentication and Anonymous authentication schemes selected.  In order to get around this so that you can debug your service, you can do the following:

  1. In IIS, uncheck the Annonymous scheme
  2. In IIS, leave Integrated Windows Authentication checked - this is required to run the VS Debugger
  3. Start the debugger from VS
  4. Before you make a request to your service, go back into IIS and check the Annonymous scheme
  5. Make a request to your service and your break point will be hit

.Net | WCF

Passing Exam 70-523 Upgrade: Transition Your MCPD .NET Framework 3.5 Web Developer Skills to MCPD .NET Framework 4 Web Developer

by Cliff 2. July 2011

I recently passed exam 70-523 to earn my MCPD .NET Framework 4 certification.  The exam covers a fairly wide range of topics and the following provides an overview of the sections to expect on the exam.

There are 5 seperate tests that you will take during the exam and this includes one real world scenario statement follwed by 6 questions on the requirement statement.

The tests break down into the following:

  1. WCF with .NET 4 - approximately 20 questions
  2. Web Application development with .NET Framework 4 - approximately 20 - 30 questions including topics on MVC and Web Forms
  3. Accessing Data with Microsoft .NET framework 4 - approximately 20 questions including topics on EF, LINQ, and DataTables
  4. Designing and Developing Web apps - 20 questions + the real world scenario statement & quesitons

The exam was moderatly difficult but if you have about 1 years experience in .NET 4 including MVC, EF, LINQ, and WCF, and jQuery you should do OK and no need to get a vce or brain dump or anything like that.

Some additional resources I found helpful:

http://gregorsuttie.wordpress.com/2011/01/01/net-upgrade-exam-70-523/

http://www.microsoft.com/learning/en/us/exam.aspx?ID=70-523#tab2

 Good luck!

AspNetMembershipProvider for MySQL

by Cliff 13. February 2011
If you use ASP.NET (webforms or MVC) you may want to use MySQL as your database.  One nice feature of .NET is the Membership Provider which takes care of authentication and authorization.  You can use MySQL to store the necessary informaion for the membership and role providers.  The below article details how to do this:
 
 
If you run into issues, make sure you copy the MySQLMembershipProvider and MySQLProfileProvider sections from the machine.config to your local web.config.  Once you do this, you should be all set.

.Net | MVC | MySQL

IIS localhost System.Net.Mail.SmtpFailedRecipientsException Unable to relay for

by Cliff 30. December 2010

If you do development on your localhost and you want to test email, you can update your web.config as per below.  Note that you will need a directory of D:\Maildrop on your machine.  Doing this will result in emaills being delivered to the directory you specify.

You may receive Unable to relay for... errors and if you do, you can specify a from in the smtp element.

 <mailSettings> <smtp deliveryMethod="SpecifiedPickupDirectory" from="local@localhost">

<specifiedPickupDirectory pickupDirectoryLocation="D:\Maildrop"/> </smtp></mailSettings>

Generating a valid RSS feed using SyndicationFeed and Rss20FeedFormatter

by Cliff 12. January 2010

If you are using the .NET Rss20FeedFormatter and SyndicationFeed classes to generate an RSS feed, you may run into an issue of needing to include a link attribute to the channel element.  If you validate the default RSS generated the validation will fail since the channel element does not contain a link attribute.

You can test this by going to http://beta.feedvalidator.org and entering your feed Url.  If you recieve the error

Missing channel element: link

you can modify your code as follows:

 

SyndicationFeed syndicationFeed = new SyndicationFeed(synicationItems);
syndicationFeed.AttributeExtensions.Add(new XmlQualifiedName("link"), "http://yoursite.com");

 

This will produce a valid RSS feed with a channel that contains a link attribute.

.Net | RSS

.NET how to set the background color of a bitmap

by Cliff 3. September 2009

I was struggling with this for a while...how to set the background of a bitmap.  I read a few suggestions, but none worked for me. 

My need was to set the background of the image to white, crop it, with the end result that after cropping, the background be set to white.

To do this, I used the Clear method on the Graphics class...essentially this sets the background.

 

Graphics grPhoto = Graphics.FromImage(bmpImage);

grPhoto.Clear(Color.White);

grPhoto.InterpolationMode = InterpolationMode.HighQualityBicubic;

grPhoto.DrawImage(imgPhoto,
                new Rectangle(destX, destY, destWidth, destHeight),
                new Rectangle(sourceX, sourceY, sourceWidth, sourceHeight),
                GraphicsUnit.Pixel);

            grPhoto.Dispose();

System.ServiceModel.CommunicationException: An error occurred while receiving the HTTP response to

by Cliff 2. September 2009

We were gettign an error with one of our WCF services "System.ServiceModel.CommunicationException: An error occurred while receiving the HTTP response to..." and needed to get additional information on the problem.  Below are steps to use the built in diagnostics with WCF to find out more info for the error above as well as the overall health of your service.

  1. Add to your web.config:

     <system.diagnostics>
        <sources>
          <source name="System.ServiceModel.MessageLogging">
            <listeners>
              <add name="messages"
              type="System.Diagnostics.XmlWriterTraceListener"
              initializeData="D:\LogFiles\SalesOrderTrackingService\messages.svclog" />
            </listeners>
          </source>
        </sources>
      </system.diagnostics>

    <system.serviceModel>
        <diagnostics>
          <messageLogging
               logEntireMessage="true"
               logMalformedMessages="false"
               logMessagesAtServiceLevel="true"
               logMessagesAtTransportLevel="false"
               maxMessagesToLog="3000"
               maxSizeOfMessageToLog="2000"/>
        </diagnostics>
    ...
  2. Create the necessary folder and ensure the security is set so IIS/ASP.NET can write to the log file
  3. Use the SvcTraceViewer.exe application to view your log file

    This tool can be found in the SDK directory...for me, this was C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin

.Net | WCF

System.ServiceModel.ProtocolException: The remote server returned an unexpected response: (400) Bad Request

by Cliff 27. August 2009

Recently I had a WCF service call that was returning the error System.ServiceModel.ProtocolException: The remote server returned an unexpected response: (400) Bad Request.

Looking into this, I discivered that the messages we were sending were increasing in size.  We were using the basic http binding and it turns out the default readerQuotas were too small and were causing the"Bad Request" error.

I increased the readerQuotas to the values below and that resolved the error.

 

<basicHttpBinding>
        ...
          <readerQuotas maxDepth="2000000" maxStringContentLength="2000000" maxArrayLength="2000000"
            maxBytesPerRead="2000000" maxNameTableCharCount="2000000" />

       ...

Tags: wcf

.Net | WCF

Cliff Gray's Info

Cliff Gray
Developer/Founder GrayTechnology.com.

E-mail me Send mail

Authors

Calendar

<<  June 2017  >>
MoTuWeThFrSaSu
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789

View posts in large calendar

Blogroll

Download BlogEngine.NET

Download at CodePlex

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2017

Subscribe