BUILD 2016: .NET Roadmap

image

image

Move Umbraco 7.x from root website to virtual directory

Common issues:

1. Images stored in media folder is not loading.

2. CSS is not loading

3. JS is not loading

Resolution:

1. Open umbracoSettings.config in Config folder, add “<ResolveUrlsFromTextString>true</ResolveUrlsFromTextString>” in “<content>” section.

e.g.

<content>

<UmbracoLibraryCacheDuration>1</UmbracoLibraryCacheDuration>

<ResolveUrlsFromTextString>true</ResolveUrlsFromTextString>

</content>

2. Open umbraco CMS database, update table “cmsPropertyData” to fix the media path.

UPDATE cmsPropertyData set dataNvarchar = replace(dataNvarchar, ‘/media/’,’/<virdir>/media/’)

where dataNvarchar like ‘/media/%’

3. Re-published entire website to refresh the umbraco.config cache.

clip_image002

4. Re-publish each pages if point 3 does not work.

5. Update necessary template/ layout files.

Update JS & CSS path from "/js/*" to "~/js/*" and "/css/*" to "~/css/*"

image

6. IISRESET

Change Umbraco back-office URL

1. Rename Umbraco folder to desired name e.g. back-office

2. Open Web.config and find “umbracoReservedPaths” & “umbracoPath” tags and change the value accordingly.

e.g.

<add key=”umbracoReservedPaths” value=”~/back-office,~/install/” />

<add key=”umbracoPath” value=”~/back-office” />

Make bootstrap compatible with Internet Explorer 11 & Edge

Add the following tag in <head></head> section.

<meta http-equiv="X-UA-Compatible" content="IE=edge">

e.g.

image

C#, Export binary data to file from MS Sql Server Database Table

 

SqlConnection connection = new SqlConnection("server=x1;uid=x2;pwd=x3;database=x4;");
connection.Open();
// Select binary data from db
SqlCommand command = new
  SqlCommand("select Filename, Attachment, Convert(nvarchar(5), ID) + ‘_’ + Filename as NewFilename   from MyAttachments", connection);
SqlDataReader sqlDr = command.ExecuteReader();
while (sqlDr.Read())
{
    string filename = sqlDr.GetString(0);
    byte[] attachment = (byte[])sqlDr.GetValue(1);
    string newFilename = sqlDr.GetString(2);
    FileStream fs = new FileStream(@"D:\B2F\" + newFilename, FileMode.Create);
    fs.Write(attachment, 0, attachment.Length);
    fs.Close();

}

connection.Close();

Build 2013 and Visual Studio 2013 Preview, What’s new?

http://blogs.msdn.com/b/somasegar/archive/2013/06/26/visual-studio-2013-preview.aspx

Future directions for C# and Visual Basic

image

imageimage

Summary:
• C# and VB deeply support the Windows Runtime (Developing Metro Style App)
• C# and VB make asynchronous programming easy
• You can create hybrid C#/VB and JavaScript apps
• Visual Studio Roslyn CTP will be available soon (Oct 2011)
    – Copy in C# Paste in VB, Copy in VB Paste in C#
    – Execute code runtime, compile & run dynamically