Quantcast
Channel: JPHellemons
Viewing all 132 articles
Browse latest View live

Compare ad-networks for Windows Phone

$
0
0

I have developed several small apps for Windows Phone. Most of the time it is just to test how publishing an app works. I have developed an app for wp7, wp8.0, wp8.1 and universal apps and they are all free in the windows (phone) store. I try to earn back my developer fee of 19 euro by adding some small ads to it. I have used the adrotator version 1 and version 2 plugin and Microsoft's  own admediator.

You can download that visual studio extension of the visualstudio gallery website.

and you can read how to use admediator on msdn.

my three ad networks are:

  • mobfox
  • smaato
  • pubcenter

My conclusion: pubcenter has the best revenue and smaato serves the most ads. Please let me know if you disagree or have some advice. You can download my excel report here.

 

p.s. here is a 27 minute video of the admediator control on channel 9.

p.p.s. more info on the windows blog http://blogs.windows.com/buildingapps/2014/11/07/how-to-maximize-the-impact-of-windows-ad-mediation-for-windows-phone/


Skip dualboot menu Windows 8

$
0
0

Hyper-V disables the fastboot option. One of the main advantages of the surface pro is having the fastboot option, which disappears after having hyper-v enabled. Hyper-V is enabled if you install the windows phone dev tools and if you want to run vhd files. Hanselman made a blogpost about adding an extra bootoption to switch between with and without hyper-v

 

But after installing the january firmware update, it gave me the blue screen with both boot entries, each time I boot.

This can be disabled in Windows. Press the windows key + pause/break and go to the ‘advanced system settings’. in tab ‘advanced’ click the button ‘settings’ next to “boot- and recoverysettings”

image

remove the checkbox to disable the list of operating systems and hit ok and that’s it. Enjoy the speed of the fastboot with the surface pro 3.

SqlCommands in a transaction

$
0
0

Lazy productive I as a developer am, I did not want to write a stored procedure. So I ended up with a lot of SQL statements which needed to be combined and executed only if the previous one succeeds.

However there was a timeout during the execution. It was strange because when I copy pasted the SQL statement in SMSS it worked perfectly and fast too. My mistake was to use a new SqlCommand object which was not part of the transaction. I needed to re-use the same sqlcommand. Here is some working code:

using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["myConString"].ToString()))
{
    con.Open();

    SqlCommand cmd = con.CreateCommand();
    SqlTransaction transaction = con.BeginTransaction();

    cmd.Connection = con;
    cmd.Transaction = transaction;

    try{
    
        cmd.CommandText = "SELECT productcode FROM products WHERE productid = " + productid;
        string code = cmd.ExecuteScalar().ToString();
    
        cmd.CommandText = "SELECT ProductID, ProductWeight, ProductEuroPrice, OrderID FROM ORDERPICKINGPRODUCTS WHERE orderid = " + orderid + " AND productid = " + productid;
        SqlDataReader sdr = cmd.ExecuteReader();
        DataTable dt = new DataTable();
        dt.Load(sdr);
    
        cmd.CommandText = "DELETE FROM ORDERPICKINGPRODUCTS WHERE orderid = " + orderid + " AND productid = " + productid;
        cmd.ExecuteNonQuery();
        transaction.Commit();
    }
    catch(Exception e)
    {
        transaction.Rollback();
    }
}
I know that it is better to use parameters https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.parameters%28v=vs.110%29.aspx

And the AddWithValue method… But this is just pseudo code and not in production. So don’t worry!

This is just a small sample to help people with a strange timeout which you can encounter if you use an sqlcommand outside the transaction.

 

Good luck!

Surface 3 vs. Surface pro 3 vs iPad air 2 costs (in the Netherlands)

$
0
0

Surface 3 vs Surface Pro 3 costs

As a proud Surface Pro 3 user, I would like to point out why the Surface 3 (not pro) won’t make it in the Netherlands. There has been a dutch review on tweakers.net http://tweakers.net/reviews/4001/microsoft-surface-3-review-degelijke-tablet-met-een-hoge-prijs.html and they gave the device a 6 (on a scale from 1 to 10) and after over 300 comments, they changed it to a 7.

The Surface 3 is 499 in the USA. In the Netherlands, that is 599 euros inc VAT (btw) a typecover is 149 and a pen is also 49. That makes a total of 797 euro. It is 609 euro at the microsoft store (without pen and cover)

So 797 for 64gb entry level surface 3 and 729 + 149 + 49 = 927 for the 128gb variant.

The 64 gb variant has 2gb while the surface pro has an i3 and 4gb ram for 738 euro ex cover (867 inc cover and pen) that is a 70 euro difference.

When you compare the 128gb model: the pro has an i5 for 949 + 129 (cover) = 1078 euro vs the non-pro: 927 makes a 151 euro difference for an i5 cpu and both having 4gb ram.

 

iPad Air 2 costs

the 64gb version is 539 euro

the 128gb version is 664 euro

The keyboards from Logitech are around 90 euro and there is no real pen/stylus option. so the 64gb will be 629 inc cover and the 128gb will be 754 euro. compared to the surface 3, people will buy Apple products even though they cannot really multitask or use a pen/stylus.

 

Conclusion

I think that the Dutch consumer won’t buy the awesome device just because of the price difference and the current Apple hype. If the price drops, I would really recommend this device to people. Definitely because the upcoming release of Windows 10 and the free upgrade. I will stay a happy and proud Surface Pro 3 user and would not switch for a million. I hope this helps people make a decision purely based on prices. Would be great to see a surface 3 price drop in the Netherlands. That would change everything.


When you forget to set a column to auto increment in SQL Server

$
0
0

If you add a new table and mark the ID column as primary key, but you forgot to set the int or bigint to auto increment, you can not fix this in the SQL Management Studio.

image

There are several ways to do this, I ended up removing the primary key, dropping the column and re-creating it.

Dropping the column also gave me the error about dropping the whole table and re-creating it. So I had to do this with some SQL, so no GUI today but just these two small SQL statements. I hope it helps, otherwise it is just an online backup for when I forget how I fixed this.

alter table YOURTABLENAME add YOURCOLUMNNAME bigint IDENTITY(1,1) primary key
alter table YOURTABLENAME drop column YOURCOLUMNNAME 

Good luck!

 

ps. when you use select @@version you get to see what version of SQL server you are using. I had

Microsoft SQL Server 2008 (SP3) - 10.0.5520.0 (X64)
    Jul 11 2014 16:11:50
    Copyright (c) 1988-2008 Microsoft Corporation
    Standard Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) (VM)
This blogpost http://sqlserverbuilds.blogspot.nl/ has a nice list of different versions.

iPad pro thoughts

$
0
0

Yesterday 9 September 2015 a three year old comic became reality:

Jun 19, 2012 source http://hijinksensue.com/comic/surface-tension/ 

Hey, did you hear Microsoft made an iPad? Yeah, you can Google stuff on it with Bing.

Apple released the Ipad Pro. It is a larger screen similar to the surface dimensions and a keyboard in the cover like the surface and has pen input like the surface.

26 oktober 2012 Microsoft released the Surface RT. A tablet with pen input, keyboard cover etc. The OS is not the full Windows version (just like the iPad pro now)

The pro edition of the surface did have a full version.

This is not the first time that apple claims to have a new product. Back in 2000 Bill Gates had a Lenovo tablet with monochrome screen:

Bill Gates tablet 2000

two years later he had a Fujitsu tablet with a color screen and Windows XP (2002)

Bill Gates tablet 2002

Besides tablets, there were mobile devices. PDA’s running Windows Mobile The predecessor of Windows Phone as we know it today.

Pocket pc started around 2000 and became Windows Mobile in 2002. I have had devices with applications to send mail and browse the web. run games etc. before the launch of the first generation of iPhones.

Steve Jobs said back in 2007 when they released the very first iPhone:

“Who wants a stylus? You have to get em', put em' away. You lose them. Yuck.”

&ldquo;Who wants a stylus?&rdquo;

But back on topic: the iPad pro is less than I expected. I expected it to run full mac OS X el captain. But the OS is not optimized for touch input. So it seems that Apple will run iOs and OS X side by side for a few more years. Microsoft made the step when moved from Windows Phone 7 to 8 to run everything on the same kernel. It is a hard step. A lot of people fell over it. But it was necessary and really inevitable. But today all (or almost all) Windows Phone 8.x devices will have the Windows 10 update and will run the same apps on their phone as on their laptop/desktop as on their Xbox. This whole concept will be copied by Apple in a year or two maybe three and will be sold like they invented it.

Please do not get me wrong, I like Apple and like their design, usability and the way that the hardware is sold together with the software. The way they update their mobile devices. I like that more then Androids by the way. But the thing that I dislike is that their marketing is so good that less tech aware people believe that Apple invented the wheel and those people share their view with even more tech aware people who assume they are right. But when the Apple fans encounter someone with more technical knowledge they often avoid a discussion.

Let me know your point of view in the comments below.

Calculate km distance between two latitude longitude points from two floats

$
0
0

latlngHaving a store locator on my to do list, I started months back with storing the latitude and longitude for the stores in a database. I forked this repository in 2012 https://github.com/bjorn2404/jQuery-Store-Locator-Plugin in order to have something like a store locator on our website. The downside to that store locator is that it is all client side and puts a copy of all your customer data on the internet. It is great data for your competition. So to disclose as little as possible and still serve your valued customers, I decided to do the calculation on the backend. Closest to the data. So that would be on the SQL server.

SQL Server has datatypes like points and geometry since 2008. With this SQL statement you can get the distance between my location

lat 51.69917 lng 5.30417 and the locations in the stores table.
SELECT top 10 StoreID
      ,StoreName
      ,StoreLatitude
      ,StoreLongitude
      ,StoreCity
      ,round((geography::Point(StoreLatitude, StoreLongitude, 4326).STDistance(geography::Point(51.69917, 5.30417, 4326))) / 1000, 1) as km
FROM STORES
  where StoreLongitude < 150 and StoreLongitude > -150 and StoreLatitude < 90 and StoreLatitude > -90
order by (geography::Point(StoreLatitude, StoreLongitude, 4326).STDistance(geography::Point(51.69917, 5.30417, 4326)))

The third parameter for the point data type is 4326 which is an enumeration:

And about 4326 SRID. It also called WSG84(http://en.wikipedia.org/wiki/World_Geodetic_System) system. It's the most common system to represent point on spherical(not flat) earth. It uses degree,minute,second notation and it's x and y coordinates are usually called latitude and longitude.

source http://stackoverflow.com/a/405256/169714

SRID (Spatial Reference System Identifier) : https://en.wikipedia.org/wiki/SRID

This post is more of a reference for me to lookup how to calculate distances on the Microsoft SQL server in SQL. But maybe it helps others too.

Good luck!

Manage users for webform auth missing option in Visual Studio

$
0
0

I have blogged about this in November 2013 which is almost 2 years ago.

run as admin (windows key + X) command prompt as admin

C:\Program Files (x86)\IIS Express\iisexpress.exe" /path:C:\Windows\Microsoft.NET\Framework\v4.0.30319\ASP.NETWebAdminFiles /vpath:"/webadmin" /port:12345 /clr:4.0 /ntlm

http://localhost:12345/webadmin/default.aspx?applicationPhysicalPath=C:\Path\to\your\webformcode\&applicationUrl=/

and then there was this stacktrace and error… I have not had this issue before. It was since the 4.6 framework was installed.

Thankfully I found this stackoverflow answer which resolves it:

open "C:\Windows\Microsoft.NET\Framework\v4.0.30319\ASP.NETWebAdminFiles\App_Code\WebAdminPage.cs"

in notepad++ and ctrl+g (go to) line 989 and give the string appId the value of “1” instead of the stringutil.blabla

save and reload the page.

No more error on:

StringUtil.GetNonRandomizedHashCode(String.Concat(appPath, appPhysPath)).ToString("x", CultureInfo.InvariantCulture);

Good luck!


Macbook air 13” 4mot/4/40000002: exhaust-0

$
0
0

Well the title is clear right? I ran the Apple Hardware Test (AHT) because our model was from 2012.

  • Switched off the macbook
  • power on macbook
  • press and hold ‘D’

I ran the extended and more advance test which takes a bit longer. But it gave me the message:

4mot/4/40000002: exhaust-0

it said that the fan was broken. It was exactly what I expected due to the noise of the fan.

Our model was an A1466 and the fan replacement would cost me 145 euro at an Apple care center, so I bought the part online for 26 euro.

Here is the step by step ifixit guide. Please note that you need a P5 pentalobe screwdriver which is Apple specific. I bought it online for 5 euro.

I have spend 38 euro inc shippingcosts. You can get the screwdriver really cheap from aliexpress, but the shipping takes a long time and I cannot live that long without my macbook. Same for the fan it seems. You can get both for 9 dollar without shipping costs but it will take a while to arrive.

 

WP_20151231_17_23_03_Pro_LI

On the left is the new one, right side is the old one.

The hardest part was opening the zif connector to reattach the data kabel for the new fan.

 

WP_20151231_17_35_05_Pro_LI

WP_20151231_17_35_05_Pro_LI

The zif connector is so small that it is hard to open.

Running the hardware diagnostics tool can confirm that replacing the fan is a succes. You will not get the 4mot/4/40000002 exhaust error again.

Good luck with the fan replacement!

Configure shared mailbox Office 365 on Mac OS X mail.app

$
0
0

We have recently moved from hosted mail (pop3/imap) to Office365. This works perfectly with Outlook 2016 on Windows. The 2016 mac version of Outlook is also really good. It just does not auto display the shared mailboxes. This can be easily solved

as found here: https://community.office365.com/en-us/f/158/p/287203/877055#877055

just a simple, file –> open –> other users folder. and select the shared mailbox.

It is a lot harder to add a shared mailbox to the default mail.app in Mac OS X. This manual configuration did not work. It suggests to use your main account and a slash and then the shared name or alias.

 

IMAP:

server: outlook.office365.com

username: my-personal-mailbox@my-domain.com/shared-folder-alias-name

password: personal-password

(if necessary: Port 993, SSL = ON and Password authentication)

SMTP:

server: smtp.office365.com

username: my-personal-mailbox@my-domain.com

password: personal-password

(if necessary: Port 587, SSL = ON and Password authentication)

 

I could not get it to work.

but this did work:

login as admin in office365 go to “users” and not the shared mailboxes.

 

snip_20160317163145

There are users for shared mailboxes, but no one uses the user account. It is just internally needed for the mailboxes. Click the one that is corresponding with the shared mailbox and reset the password.

You can now use the credentials as above. Just use the pseudo user from the user list and the new password and as mail address the one from the shared mailbox

and outlook.office365.com as server. You can use the default mail.app in Mac OS X (10.10 or 10.11)

It is a lot more work then with outlook, but if you are really fond of the default application, this is a solution to keep using it without moving to outlook.

 

Enjoy!

Nuget DocX tabledesign enum

$
0
0

There are various options to build a word document in your C# code, I choose the lightweight docx nuget package. There are some really good examples on the Codeplex website of docx http://docx.codeplex.com/ if you look at the “Advanced Examples”

The thing is that Office products tend to localize variables such as table designs:

image

I am dutch, but I cannot translate it to a value of the enum `TableDesign`

If I would translate it, it would be something like listtable 7 colorful accent 6. It is still (even after this test file) not a valid entry of the table design enumeration.

using (DocX document = DocX.Create("C:/Temp/tables.docx"))
{
    foreach (TableDesign td in (TableDesign[])Enum.GetValues(typeof(TableDesign)))
    {
        Table aTable = document.InsertTable(5, 5); // because office preview is also 5 x 5
        aTable.Design = td;
        aTable.Rows[0].Cells[0].Paragraphs.First().Append(td.ToString());
    }
    document.Save();
}

 

The “source” (all 6 lines of code, lol) is available on github https://github.com/jphellemons/DocxTables but perhaps more important is the output file. This might save you some time. https://github.com/jphellemons/DocxTables/raw/master/tables.docx

 

Good luck with this small, but awesome nuget package!

Bulk add contacts to public folder shared contacts Office365/Outlook 2016

$
0
0

We have a lot of customer data in our system and I wanted to have a shared contact list with all the customer data for my co-workers.

I looking into some Office365 docs and found this walkthrough to create the folder: https://www.cogmotive.com/blog/office-365-tips/create-a-company-shared-contacts-folder-in-office-365

snip_20160322100016

So afterwards you have an empty but shared contact folder. I thought that I needed the Microsoft Graph to access these contacts. Which would require my app to be in azure and it cannot have a command line only because of the authentication. More about that approach can be found here http://dev.office.com/getting-started/office365apis

But it seems that this is not needed for my simple one time import https://msdn.microsoft.com/en-us/office/office365/api/contacts-rest-operations

I thought that it might be a job for a PowerShell script and found this http://www.infinitconsulting.com/2015/01/bulk-import-contacts-to-office-365/

But there is an other option. Use Interop, because I as an Office365 user have Outlook 2016 on my Windows 10 machine and Visual Studio 2015. So create a new (console) application and add a reference to Outlook Interop:

I used this code to get to the “customers” address book:

using System;
using Outlook = Microsoft.Office.Interop.Outlook;

namespace UploadContactsToOffice365
{
    class Program
    {
        static void Main(string[] args)
        {
            var ap = new Outlook.Application();
            
            foreach(Outlook.Folder f in ap.Session.Folders)
            {
                if (f.Name.ToLower().Contains("openbare")) // jp openbare mappen (public folders)
                {
                    Console.WriteLine(f.FullFolderPath);
                    foreach (Outlook.Folder f2 in f.Folders)
                    {
                        if (f2.Name.ToLower().Contains("alle")) // alle openbare mappen (all public folders)
                        {
                            Console.WriteLine(f2.FullFolderPath);
                            foreach (Outlook.Folder f3 in f2.Folders)
                            {
                                if (f3.Name.ToLower().Contains("klanten")) // customers (folder name)
                                {
                                    Console.WriteLine(f3.FullFolderPath);
                                    foreach (Outlook.Folder f4 in f3.Folders)
                                    {
                                        if (f4.AddressBookName.ToLower().Contains("customers"))
                                        {
                                            Console.WriteLine(f4.FullFolderPath);
                                            Console.WriteLine("----------");

                                            /// display current items:
                                            //Outlook.Items oItems = f4.Items;
                                            //for (int i = 1; i <= oItems.Count; i++)
                                            //{
                                            //    Outlook._ContactItem oContact = (Outlook._ContactItem)oItems[i];
                                            //    Console.WriteLine(oContact.FullName);
                                            //    oContact = null;
                                            //}
                                            // add test item:

                                            Outlook.ContactItem newContact = (Outlook.ContactItem)ap.CreateItem(Outlook.OlItemType.olContactItem);
                                            try
                                            {
                                                newContact.FirstName = "Jo";
                                                newContact.LastName = "Berry";
                                                newContact.Email1Address = "somebody@example.com";
                                                newContact.CustomerID = "123456";
                                                newContact.PrimaryTelephoneNumber = "(425)555-0111";
                                                newContact.MailingAddressStreet = "123 Main St.";
                                                newContact.MailingAddressCity = "Redmond";
                                                newContact.MailingAddressState = "WA";
                                                newContact.Move(f4);
                                                newContact.Save();                                                
                                            }
                                            catch (Exception ex)
                                            {
                                                Console.WriteLine("The new contact was not saved. " + ex.Message);
                                            }
                                            
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }

            Console.ReadKey();
        }
    }
}

This is not the prettiest code I have written. So there must be a better way. But this is just a one time application to loop through some database records and add contacts. So I will just leave it like this. Please let me know in the comments if you have suggestions to improve readability. The code snippet will give this contact in your (and the rest of the companies) outlook:

If you are looking how to import a folder full with vcf cards you should take a look at this MSDN article.

This should give you enough pointers to bulk add contacts to a shared folder in Office365 (Outlook 2016)

Good luck!

Configure shared mailbox Office 365 on Mac OS X mail.app

$
0
0

We have recently moved from hosted mail (pop3/imap) to Office365. This works perfectly with Outlook 2016 on Windows. The 2016 mac version of Outlook is also really good. However it just does not auto display the shared mailboxes. This can be easily solved.

just a simple, file –> open –> other users folder. and select the shared mailbox.

Found https://community.office365.com/en-us/f/158/p/287203/877055#877055

No outlook

It is a lot harder to add a shared mailbox to the default mail.app in Mac OS X. This manual configuration did not work. It suggests to use your main account and a slash and then the shared name or alias.

Here are the configuration details (which did not work for me)

IMAP:

server: outlook.office365.com

username: my-personal-mailbox@my-domain.com/shared-folder-alias-name

password: personal-password

(if necessary: Port 993, SSL = ON and Password authentication)

SMTP:

server: smtp.office365.com

username: my-personal-mailbox@my-domain.com

password: personal-password

(if necessary: Port 587, SSL = ON and Password authentication)

 

I could not get it to work.

but this did work:

login as admin in office365 go to “users” and not the shared mailboxes.

 

snip_20160317163145

There are users for shared mailboxes, but no one uses the user account. It is just internally needed for the mailboxes. Click the one that is corresponding with the shared mailbox and reset the password.

You can now use the credentials as above. Just use the pseudo user from the user list and the new password and as mail address the one from the shared mailbox

and outlook.office365.com as server. You can use the default mail.app in Mac OS X (10.10 or 10.11) It is a lot more work then with outlook, but if you are really fond of the default application, this is a solution to keep using it without moving to outlook.

 

Enjoy and good luck!

Redirect traffic to other url in IIS with web.config

$
0
0

It has been a while since my last blog. But here is a small snippet to redirect traffic to an other place. I needed it because we have 2 domains on shared hosting. Both containing mail accounts. I could not simply add a hostheader for the 2nd domain, because it would remove all mail accounts. So I used this web.config file:

<?xml version="1.0" encoding="UTF-8"?><configuration><system.webServer><rewrite><rules><rule name="Domein doorsturen naar andere website" stopProcessing="true"><match url="(.*)" /><conditions><add input="{HTTP_HOST}" pattern="^(?:www.)olddomain\.com$" /></conditions><action type="Redirect" url="http://www.newdomain.com/{R:1}" /></rule></rules></rewrite></system.webServer></configuration>

 

ps. I used precode from codeplex to insert the xml code in an open live writer post. 0.6.0.0

Let’s encrypt setup for Windows Server

$
0
0

I have finished migrating from an “old” virtual private server (VPS) running Windows Server 2008 to a server running 2012 r2 which includes IIS 8.5

At this time the 1.9.1 is the latest https://github.com/Lone-Coder/letsencrypt-win-simple/releases

After extracting the zip you need to move the content to a permanent folder from where you can keep running the Automated Certificate Management Environment (ACME) which can renew the certificates

 

image

If you run it as admin, it will ask you for your e-mail. It will stay private, it’s just to notify if a renewal failed.

Will you agree on https://letsencrypt.org/documents/LE-SA-v1.1.1-August-1-2016.pdf

next is a list, not of the websites but the bindings. Mine was rather big (100 entries) and contained multiple pages. After the bindings there are more options:

image

 

After selecting a “website” number you can specify the user which will be used to run the renewal process.

The last step is to make an entry in your calendar to verify that the renewal succeeded.

I have also installed Certify to view the certificates http://certify.webprofusion.com/ 

I used version Alpha V0.9.85

All that was left was to test the website with https and if it succeeds, make an IIS redirect to route all traffic to the https version:

image

image

Good luck and enjoy the free SSL certificates!


My Surface Pro 3 is dead, long live the Surface Pro 3!

$
0
0

So my Surface pro 3 running the anniversary update and latest updates got hot. So hot that I got the white thermometer of death.

I borrowed this picture from this topic on Microsoft Community. I could not take my own picture, because I was too upset.

So I contacted the store where I bought the device and there has been a change with the return policy in the Netherlands. So I could not send it in for repair at the store. I had to contact Microsoft myself. After logging in with my Microsoft account I could register the issue without any issues. Microsoft mailed me an UPS label for the box and within a few days I got a mail with a trackingcode that a similar device was heading my way.

My SP3 was over 1,5 year old and like a lot of overheating sp3’s equiped with an i7 cpu.

Windows Store

Having a lot of applications in the store, made it easy for me to get back to work fast. Open live writer is now a store app too so that is nice! The only applications I had to download outside the store were:

  • Visual Studio
  • FileZilla
  • Skype (I know there is a preview uwp app in the anniversary update…)
  • Sql Server Management Studio
  • Office 365
  • Notepad++
  • Adobe cloud (and Photoshop)
  • Chrome
  • Firefox (and mozbackup)
  • Github for Windows
  • TeamViewer
  • Snip (office mix)

 

It would save me even more time if those were in the store. And if Visual Studio had some kind of installed extension restore option.

So I was supprised how fast and good the service for the surface is and how fast people can get back to work with all the latest software on Windows 10. Could be even faster if I would do a system restore. But I wanted a clean install with all the legacy sql, mvc, azure installers etc. Maybe it will be even faster in the future with using chocolatey or oneget and restore settings stored in the cloud (onedrive)

 

I hope this will cheer up people who have Surface heating issues. I was only a week without the surface.

Good luck!

MasterPageFile in web.config does not work

$
0
0

I have set a theme for this webform project in the web.config file and also a masterpagefile

<?xml version="1.0" encoding="utf-8"?><configuration><system.web><pages  theme="themeName" masterPageFile="~/mp1.master" /></system.web></configuration>

Unfortunatly this did not work. I have spend a long time searching why my application kept showing the old masterpagefile. I believe that it had to do with this checkbox:

snip_20161027144613

When you publish your webform application and click on configure, you should set the checkbox near the ‘allow precompiled site to be updatable’.

Otherwise it seems that during the compilation, it will bake in the configured masterpage file in your *.aspx files.

Please let me know if I am wrong, but this did fix it for me.

 

Good luck!

Use Apple USB to Ethernet adapter with Windows 10

$
0
0

I thought that USB to Ethernet adapters where a universal thing and I was wrong. It took me a 517MB download to get to a 503kb .exe containing the drivers.

I downloaded the Boot Camp Support Software 5.1.5769 from https://support.apple.com/kb/DL1837?viewlocale=en_US&locale=en_US

If you extract the zip and go to the folder “BootCamp\Drivers\Asix” you will find the AsixSetup64.exe which is just 503kb.

 

Alternative: download the 503kb file from mega.

 

snip_20161109112728

If it succeeds, it will show something similar to the picture below in the device manager

snip_20161109115008

 

Good luck!

CS0246 The type or namespace name 'XmlSerializer' could not be found in Visual Studio 2017 RC and dotnetcore 1.1

$
0
0

This is my solution explorer:

solution-explorer

and this is my nuget package manager:

nuget

So The XmlSerializer is installed. Somehow the Newtonsoft.Json gives a yellow icon in the solution explorer. But no errors from that lib in the output window.

I thought that the nuget packagemanager or visual studio would auto restore all packages for me. Somehow it was fixed by manually running dotnet restore from the cli.

The whole tooling for .net core is still work in progress and I really liked working with preview 2 (1.0.1) in vs code with the project.json files.

Switching back to the csproj file makes it imho harder to work with vs code and makes using Visual Studio 2017 (community) almost required.

I really enjoyed working through the jonhilton tutorial for dotnet core.

But that does not work anymore, because 1.1 is out and project.json is gone.

I have used dotnet migrate to move from project.json to projectname.csproj and it returned zero errors/issues. But did not launch. No project was found according to msbuild. And after changing task.json it gave a lot of reference issues. So I started over in Visual Studio 2017 RC and have a lot more setup by default and less issues.

I see that the whole development of dotnet core is moving forward fast. But I really enjoyed the development experience with vs code and the jonhilton tutorial. I hope that it will come back, or that someone will make a similar tutorial for vs code with dotnet 1.1 and mvc (and kestrel, because vs2017 has iis express as default webserver)

Looking forward to all the new bits and pieces and will keep updating vs code (insider) and dotnet core.

I hope the suggestion of the manual dotnet restore helped someone.

 

good luck!

Paste XML as Classes in Visual Studio 2017 Fix/workaround

$
0
0

As you might have noticed, there is no Paste as XML option under Edit –> Paste Special in the menu when you are working on .net Core applications.

The reason is actually very simple. The current project type has no build in serialization support for XML.

I only realized it after reading this post from codecalculated.com. But it has been mentioned in the Asp.Net Standup before. 

However, I have a workaround available for those who have Visual Studio Code installed. You should have it on your machine! It is so fast, responsive and lightweight (and free).

Fire up Visual Studio Code and hit Ctrl+P and type: ext install smartpaste

snip_20161130105646

if you have it installed and reloaded Visual Studio Code you can invoke it with: Cltr + Shift + P and type: smart paste.

Select “Paste XML as JSON” (since xml to classes is not finished yet)

Copy the JSON output and switch to Visual Studio 2017 RC.

snip_20161130105859

You can now paste your JSON as Classes Smile

 

Good luck!

Viewing all 132 articles
Browse latest View live