Wednesday, December 16, 2015

Error ITMS-90047: Disallowed paths ("iTunesArtwork,"iTunesMetadata.plist") found at: App Name

Problem:

I upgraded to dev environment to the latest versions of XCode 7.2 and Xamarin iOS 9.2.  
I have been unable to build a production ipa file in Visual Studio or Xamarin Studio.  

I am focusing on getting the Xamarin Studio solution to work before proceeding to Visual Studio.   

XS will build in simulator or deploy to local phone.  It will compile and build the ipa for release but when I go to the application loader.  The ipa fails to load to the store.


Build Case to get the error:
  1. XS right-click and build on iPhone project.
  2. Dig the ipa out of the bin directory.
  3. Launch Application Loader
  4. Load ipa into loader
  5. Click Send    

Solution:

What I have been able to do successfully is to follow the directions provided by Xamarin here Xamarin Studio: http://developer.xamarin.com/releases/studio/xamarin.studio_5.9/xamarin.studio_5.9/#Publishing_Workflow

The publish to archive option will build an ipa file which the application loader will accept.  This is a workaround until I can determine what is going on.

Source:
  1. https://forums.xamarin.com/discussion/comment/123046#Comment_123046
  2. https://forums.xamarin.com/discussion/40388/disallowed-paths-itunesmetadata-plist-found-at-when-submitting-to-app-store/p1
  3. http://forums.xamarin.com/discussion/50979/error-itms-90475-invalid-bundle-ipad-multitasking-support-requires-launch-story-board-in-bundle
  4. https://forums.xamarin.com/discussion/40338/ios-archive-submissions-failed-with-errors-disallowed-paths-itunesmetadata-plist

Kill a running iPhone App

Problem:

We had a situation in an app where the user should not be able to proceed without accepting a condition.  We had the view prompt them when they chose to exit.  The method called Thread.Abort() which lead to an error report.

Solution:

Using the System library, call the CloseMainWindow().  This will gracefully kill the app and return control back to the base OS.

system.diagnostics.process.getcurrentprocess().CloseMainWindow()

Source:

http://forums.xamarin.com/discussion/12026/close-an-application-programmatically
http://stackoverflow.com/questions/3622120/monotouch-reuse-uialertview

Monday, December 14, 2015

Cricket phone for Travel to US

Problem:

We are traveling to the US this week.  I wanted to be able to use my Lumia 730
while I am there.  This is the dual sim phone and so I thought I would just slip in
a US SIM and go.   I looked around and located cricket as an option.  They offer
"reasonable" priced plans for the US Market.  We are spoiled by all the options
here in European market.

Solution:

I ordered my card from US amazon and they shipped within a week.
Once I had the sim here is what I did.
1.) Go to their website: https://www.cricketwireless.com/shop/cart.html
2.) Get the ICCID off the card
3.) Get the IMEI number off your phone.  How? Dial
*#006# and dial
4.) The website will ask you for a stateside address which you will have to provide.

Or you can call 1-855-619-6021

IIS 8.5 - Unable to make the session state request to the session state server.

Problem: 


Got this jewel of an error message after coming in from a great weekend


Solution:

As the error message mentions,  I checked the asp.net service


And yes, the service was disabled and set to manual.  I set it to active and automatic.  But this issue was still there.

Next I checked the registry setting.


Set the value to 1 and rebooted.

Problem Solved!

Thursday, December 3, 2015

The SQL Server Service Broker for the current database is not enabled, and as a result query notifications are not supported. Please enable the Service Broker for this database if you wish to use notifications.

Problem:

Loading the web application and received the following error:

The SQL Server Service Broker for the current database is not enabled, and as a result query notifications are not supported.  Please enable the Service Broker for this database if you wish to use notifications.

The database is installed and running but having issues bringing up the website.


Solution:

Option 1
ALTER DATABASE [DBNAME] SET ENABLE_BROKER WITH ROLLBACK IMMEDIATE
  
Option 2




Source:
http://stackoverflow.com/questions/2758976/enabling-service-broker-in-sql-server-2008

An unhandled exception of type 'SQLite.Net.SQLiteException' occurred in SQLite.Net.Platform.WinRT.DLL

Problem:
My app was trying to read a local copy of SQLite db.  I kept getting this error. It was crazy since the file is present in the project.  Each time I would try to open the file with the connection string I would get this error

Solution:
It was simple enough.  I have forgot to set my Build Action properties on the SQLite db file.  It set to none when it should be set to Content.
Build Action = Content.

Monday, November 30, 2015

Error 1068 failed to start when trying to start services

Issue:
Trying to stand up a new IIS server and could not get the app pools to spin up.  I went to services and activated World Wide Web Publishing Service.  Then I went to start the service and it issued error 1068!

Solution:

Take a look at the properties for the service.  Click on the dependencies tab.  This will list all of the underlying services you need.  Turns out that the Windows Process Activation Service was disabled.  I enabled and then I was able to start the WWW Publishing service.

Friday, November 20, 2015

AD FS Sign in customization

Problem:


Have a CRM application which uses client certs to grant access via AD FS 2.0.  This work great
and sends our customer's through no issue.  We had an edge case which exposed some issues.  If the user was not in the CRM issue then ADFS should failover to the error page.  This however, was not the case and the user simply was staring at a blank html page on the ADFS server.

Solution:

I wracked my brain on this and read some great info on ADFS IIS settings at microsoft.  Lots of information on this configuration but not a lot of help for my particular problem.  Then I ran across a reference to the AD FS Admin Log.  This is a separate log file from System logs.  These System logs did not show anything helpful.  The AD FS Admin logs were very clear we were having issues with the FIPS compliance.  I blogged this several years ago (http://fetchmytip.blogspot.com/2013/06/an-unexpected-error-has-occurred-moss.html).  Once I kicked the registry and set the FIPS bit to 0, ADFS kicked over and started working.

Source:

  1. https://msdn.microsoft.com/en-us/library/hh202806%28v=vs.110%29.aspx
  2. https://msdn.microsoft.com/en-us/library/hh599321.aspx
  3. https://support.microsoft.com/en-us/kb/3044976
  4. http://fetchmytip.blogspot.com/2013/06/an-unexpected-error-has-occurred-moss.html

  • You are continually prompted for credentials.
  • Event 111 is logged in the AD FS Admin log, as follows:

    Log Name:  AD FS 2.0/Admin
    Event ID: 111
    Level: Error  
    Keywords: AD FS  
    Description:
    The Federation Service encountered an error while processing the WS-Trust request. 
    Request type: http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue 
    Exception details: 
    Microsoft.IdentityModel.SecurityTokenService.FailedAuthenticationException: MSIS3019: 

Thursday, November 19, 2015

Take IIS offline for Mainx

If you need to take an IIS server down then all you need to do is park an html page.,
app_offline.htm at the IIS root.  This will block all requests coming to that server.


The app_offline.htm File


So now that we've decided we want to take an application offline, how do we do it? If we've got access to the server we could stop the web site via the IIS management console, but in most shared hosting scenarios you don't have that kind of access to the server. The other shortcoming of that approach is that many developers publish via FrontPage Server Extensions or WebDAV, both of which need the web site to be running in order to make changes.
Enter the app_offline.htm file. The app_offline.htm file is a special file that ASP.NET 2.0 watches for in the root of an application. If the file exists, then ASP.NET shuts down the application and sends the contents of the file back to the user's browser for any new requests to dynamic pages in the application. This means that users are basically locked out of the application and you're free to make any changes that need to be made before removing the file and letting them back in.

Source

http://stackoverflow.com/questions/300416/iis-redirect-all-requests-to-one-page

Permanently redirect web traffic on IIS.

Problem


Handed a task to redirect user's from an old site to the new site.  Getting reports of site outage due to fact user's are trying to access server we have decommissioned.  They need to be using new server url but are using old bookmarks.  IIS has a couple of ways to do it but easiest is to use built in support.

  1. Open IIS Manager and navigate to the level you want to manage. For information about opening IIS Manager, see Open IIS Manager (IIS 7). For information about navigating to locations in the UI based on your IIS administrative role, see Navigation in IIS Manager (IIS 7).
  2. In Features View, double-click HTTP Redirect.


  3. On the HTTP Redirect page, under Redirect Behavior, select one of the following values from the Status code list:


    • Found (302) - to tell the Web client to issue a new request to the location specified in the Location HTTP header.
    • Permanent (301) - to tell the Web client that the location for the requested resource has permanently changed.
    • Temporary (307) - to tell the Web client to resend the POST data, which prevents a Web browser from losing data when the browser issues an HTTP POST request.
  4.  Click OK.


Source

https://technet.microsoft.com/en-us/library/cc770393%28v=ws.10%29.aspx

Tuesday, November 17, 2015

Sharing a vhd with your friends!

Problem:


Today, I was attempting to set up another dev with a vhd which contained our dev enviroment.  I could not get him to boot into the vhd.  I had it working on my box but could not get him up and running.  I was stumped.  I found a technet article by Chris Avis.  Chris does a great job explaining the whole process.  It was good review material but not really anything new until I hit the part about reusing your vhd with other users.  The key was running sysprep.  This takes out machine/profile specific information from the the vhd.  It gives the new user the OOBE (Out of the Box Experience) when they start the vhd the first time.  It also allows the vhd to make specific changes required for the box where it is now running.

Solution:


Now that we have a completely built Windows OS with everything we want installed, we are going to sun SYSPREP to create a distributable package that can be used for Boot to VHD.

1 ) On the virtual machine, run SYSPREP with administrative privileges
Windows 8.1/10/2012 R2 – Click Start, type CMD, right click CMD, select Run as Administrator
Windows 12/2012R2 – From the Start screen, type CMD, right click Command Prompt, select Run as Administrator (bottom of screen)
This will open a CMD prompt window and drop you at the c:\windows\system32 directory

2) Change to the \sysprep directory and run SYSPREP.EXE

3) Select the following options for SYSPREP
System Cleanup Action:  Enter Out-of-Box Experience (OOBE)
Check the “Generalize” box
Shutdown Options:  Shutdown
When you click OK, SYSPREP will remove the current user profile, set Windows to run the Out-of-Box experience on startup (will ask for very basic information on startup), and best of all…..Stop the clock on the trial version!! How long SYSPREP takes is dependent on the speed of the host you are working on, and what applications you installed to Windows. Usually it takes no more than 5-10 minutes for SYSPREP to complete and shutdown the virtual machine.


Source:

1. ) http://blogs.technet.com/b/chrisavis/archive/2013/05/03/boot-to-vhd-configuring-creating-a-reusable-trial-version-image-and-more.aspx
2.)http://fetchmytip.blogspot.com/2015/10/how-to-enable-virtualization-on-hp.html

Thursday, October 29, 2015

IIS private key export as base64 cert.

Problem:

I was trying to export an SSL public/private key from IIS.  This will export only as a pfx.  I needed it as a base64 encoded file.  This often happens with proxy servers which host a front end.  They don't seem to like pfx since they all tend to run Linux.

Solution:

Create a console application and programmatically create the cert file.

  m_X509CertificateThumbprint = Regex.Replace(rawThumbprintString, @"[^\u0000-\u007F]", string.Empty);
            m_X509CertificateThumbprint = rawThumbprintString.Replace("\u200e", string.Empty).Replace("\u200f", string.Empty).Replace(" ", string.Empty);
            var store = new X509Store(StoreName.My, StoreLocation.LocalMachine);
            store.Open(OpenFlags.ReadOnly);

            //var certificate = store.Certificates.Find(X509FindType.FindByThumbprint,
            //    "‎69c04af8588ec65762de96ddd51d78fa6e47c692", false)[0]; // doesn't matter how you get the cert
            var cert = store.Certificates.Find(X509FindType.FindByThumbprint, m_X509CertificateThumbprint, true);
            if(cert.Count > 0)
            {
                X509Certificate2 full = cert[0];
                Console.WriteLine(full.FriendlyName);
                var exported = full.Export(X509ContentType.Pfx, "1qaz@WSX");
                var base64 = Convert.ToBase64String(exported);
                System.IO.File.WriteAllText(@"C:\viper\aeitt.cer.txt", base64);


            }

            store.Close();

Source:
http://stackoverflow.com/questions/8863785/how-to-get-the-base-64-encoded-value-of-a-certificate-with-private-key
http://stackoverflow.com/questions/11115511/how-to-find-certificate-by-its-thumbprint-in-c-sharp

Tuesday, October 27, 2015

Export SSL cert with private key from IIS 7.5

Problem:
Need to get the cert off of an old IIS box before it is decommissioned.


Solution: You will export the certificate and private key using the MMC console
1. Click start > run
2. Type MMC and click OK
3. Click on File > Add/Remove Snap-in…
4. Select Certificates and click Add
5. Select Computer Account, click Next
6. Leave Local Computer selected, click Finish
7. Click Ok / Close
8. You will be back at the MMC console and it will show the Certificates Snap-In
9. Expand Certificates, expand Personal, click Certificates
10. Right click your certificate > All Tasks > Export
11. Certificate Export Wizard will appear, click Next
12. Select “Yes, export the private key” > Next
13. Select “Personal Information Exchange – PKCS #12 (.PFX)”
14. Leave the checkboxes below unchecked.
Note: If you select “include all certificates…” then it will export the intermediate certificates as well, the problem is when you import them it will import the intermediate certificates into the personal store and not the intermediate store. So it’s best to manually import your intermediate certs following the steps from your cert provider.
15. Make up a password to secure the exported .pfx certificate file
16. Pick a location to save the exported .pfx certificate file > Save > Finish




Source:
http://enterpriseit.co/windows-server/exporting-ssl-certificate-pfx-from-windows-server-iis/

Wednesday, October 21, 2015

HTTP Client PostAsync Fails in MonoTouch/iPhone

Problem:
Running tests on our cross platform solution and encountered an issue. 

I get an exception thrown on my call to postasjsonasync(). The exception says "A type load exception occured"

One step in our app sends an email out of the app using the HTTPClient libraries from MS.  This is known to cause issues.  I hit the boards stackoverflow, Xamarin, etc..  This is a fairly common problem.  The crazy thing is that we are using this call in our pcl. It works with no issues on Android and Windows Phone.  It is a problem on iOS.  It appears to be a mapping issue in the PCL.

Solution:
James Montemagno did come up with a solution. The issue with the error was assembly binding error.  The iOS version was binding to the native Windows System.Net.Http for .Net 4.5. 

We should be binding to the Xamarin version which is at

C:\Program Files(x86)\Reference Assemblies\Microsoft\Framework\Xamain.iOS\v1.0

Why?
"The reason for the redirect is that the Microsoft.Net.HttpClient packages contains the System.Net.HttpClient namespace but that already exists on iOS and Android (with slightly different features even). At runtime it will resolve to the wrong assembly and not use the (Xamarin-)native iOS one." (Thanks James!)


You can fix this problem by modifying the app.config in the Touch project.
 
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <dependentAssembly>
            <assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="2.0.5.0" />
        </dependentAssembly>
    </assemblyBinding>



Source:
http://stackoverflow.com/questions/27521738/httpclient-failing
https://github.com/Krumelur/HttpClientTest/blob/master/HttpClientTest_iOS/app.config

Monday, October 12, 2015

No exports were found that match the constraint: ContractName

Hit this today trying to load a project.  Every project I fired up would throw this error when I tried to open any file! 
 

Turns out that the issue is a corrupted cache.  You just need to remove this directory

%AppData%\..\Local\Microsoft\VisualStudio\12.0\ComponentModelCache


Source
http://stackoverflow.com/questions/17596543/error-message-no-exports-were-found-that-match-the-constraint-contract-name

Friday, October 2, 2015

How to enable virtualization on HP Probook 6565 B



Step 1:
Get CRM.vhd 

Step 2:
Put file on your c drive recommend c:\vm\crm.vhd

Step 3:
Tweak your boot menu
a.       Make a boot copy record
·          bcdedit /copy {default} /d "New Name"
b.      Get the GUID of the new boot record
·         Bcdedit
·         Read the GUID of your new record
c.       Change the boot record to point at your vhd file
·         bcdedit /set {GUID} osdevice vhd=[C:]\folder\filename.vhd  
·         bcdedit /set {GUID} device vhd=[C:]\folder\filename.vhd
·         bcdedit /set description "Windows 10 VHD"
Step 4:
 
  • Enable virtualization on your HP 6565
  • Reboot your system and press F10
  • Go to System Configuration Tab
  • Scroll down to Virtualization Technology and check the box
  • change BIOS Security Settings from View to Change for virtualization. 
  • Save changes to BIOS and exit
  • Reboot

Step 5
When you reboot your will be presented with the option of os to load.