Showing posts with label Visual Studio 2010. Show all posts
Showing posts with label Visual Studio 2010. Show all posts

Thursday, October 17, 2013

Microsoft officially releases Visual Studio 2013...

Microsoft officially releases Visual Studio 2013

 
Personally still haven't installed it myself but planning soon. Here are few highlights as read on MSDN forums and blogs on the new VS 2013 released:
  •   
New MVC 5 web application template and SharePointContext for SharePoint apps -
MVC web application template for app for SharePoint has been introduced since Office Developer Tools for Visual Studio 2013 Preview. In this Visual Studio 2013 RTM release, the MVC web application template in app for SharePoint has been updated based on the latest one for MVC 5.
 
SharePointContext is a set of classes (in SharePointContext.cs/SharePointContext.vb) that provides a set of APIs to relieve you from the tedious steps of dealing with communication between SharePoint and web application.

Need to decide whether your app be authenticated with Windows Azure Control Services or a certificate (high-trust)? SharePointContext makes it possible for you to use the same snippet of code no matter which way you go.

Need efficient but safe strategy to cache the access tokens? APIs in SharePointContext provide a good pattern and the default implementation for you.

Which APIs can you use for hosting web and which ones for app web? API naming convention carefully designed in SharePointContext gives you an explicit view what you can use in which case. You can also easily extend the SharePointContext helper by subclassing to provide more advanced features to fulfill your scenarios.

Apart from the Visual Studio 2013 in-box release, the new SharePointContext helper is also included in
App for SharePoint Web Toolkit - NuGet package, which means you can install the package and leverage the helper APIs in any VS 2013 or VS 2012 project that you want to communicate with SharePoint. For the app for SharePoint projects that you’ve created with VS 2013 Preview, you can simply upgrade the SharePointContext helper to the latest by updating the App for SharePoint Web Toolkit NuGet package (which is installed in the web project when you created the app for SharePoint).
 
  •   
 
Support for Windows 8.1 app development: Visual Studio 2013 provides the ideal toolset for building modern applications that leverage the next wave in Windows platform innovation (Windows 8.1), while supporting devices and services across all Microsoft platforms. Support for Windows Store app development in Windows 8.1 includes updates to the tools, controls and templates, new Coded UI test support for XAML apps, UI Responsiveness Analyzer and Energy Consumption profiler for XAML & HTML apps, enhanced memory profiling tools for HTML apps, and improved integration with the Windows Store.
 
  •   
Web development advances: Creating websites or services on the Microsoft platform provides you with many options, including ASP.NET WebForms, ASP.NET MVC, WCF or Web API services, and more. Previously, working with each of these approaches meant working with separate project types and tooling isolated to that project’s capabilities. The One ASP.NET vision unifies your web project experience in Visual Studio 2013 so that you can create ASP.NET web applications using your preference of ASP.NET component frameworks in a single project. Now you can mix and match the right tools for the job within your web projects, giving you increased flexibility and productivity.


You can download Visual Studio 2013 here - http://go.microsoft.com/fwlink/p/?LinkId=306566 
 
 
-D

Monday, March 19, 2012

Knockout js for MVVM and MVC web applications

Assisting Ryan, I learned how cool Knockout java script library is! :) It really seems to be easy in adopting and faster UX development esp. for MVVM and MVC web applications.

http://channel9.msdn.com/posts/ASPNET-MVC-With-Community-Tools-Part-11-KnockoutJS (MVVM, knockout session 20 minute video on ASP.NET MVC With Community Tools Part 11: KnockoutJS)


Practice here if you dont have it installed - http://www.knockoutjs.com// (tons on step by step instructions and tutorials)


Cheers - DJ

Sunday, September 25, 2011

WCF Interview questions and answers (reference only, uuber level)

The intent to draft this list of questions is for learning purpose only and at very high level understanding of WCF services. This is not a dump :)

Question 1: What is the difference WCF and Web services?
Answer: -
Web services can only be invoked by HTTP. While Service or a WCF component can be invoked by any protocol and any transport type. Second web services are not flexible. However, Services are flexible. If you make a new version of the service then you need to just expose a new end. Therefore, services are agile and which is a very practical approach looking at the current business trends.
Question 2: What are different bindings supported by WCF?
Answer: -
WCF includes predefined bindings. They cover most of bindings widely needed in day-to-day application. However, just incase you find that you need to define something custom WCF does not stop you. So let us try to understand what each binding provides.
BasicHttpBinding: - This binding is used when we need to use SOAP over HTTP. This binding can also be configured to be used as HTTPS. It can be also configured to send data in plain text or in optimized form like MTOM.
WsHttpBinding: - It is same like BasicHttpBinding. In short, it uses SOAP over HTTP. But with it also supports reliable message transfer, security and transaction. WS-Reliable Messaging, security with WS-Security, and transactions with WS-Atomic Transaction supports reliable message.
NetTcpBinding: - This binding sends binary-encoded SOAP, including support for reliable message transfer, security, and transactions, directly over TCP. The biggest disadvantage of NetTcpBinding is that both server and client should be also made in .NET language.
NetMsmqBinding: - This binding sends binary-encoded SOAP over MSMQ. This binding can only be used for WCF-to-WCF communication.
NetNamedPipesBinding:-Ths binding Sends binary-encoded SOAP over named pipes. This binding is only usable for WCF-to-WCF communication between processes on the same Windows-based machine.

Note: - An interprocess control (IPC) protocol is used for exchanging information between two applications, possibly running on different computers in a network. The difference between Named pipes and TCP is that named pipes have good performance in terms of communication with in processes. But when it comes to communicate across network TCP holds the best choice. So if you are using WCF to communicate with process it’s the best choice to use in terms for performance. Named pipes do not perform when the traffic is heavy as compared to TCPIP.

Question 3: What are the main components of WCF?
Answer: -
We need to define three main components in WCF:-
• Service class. • Hosting environment • End point

Question 4: What are the various ways of hosting a WCF service?
Answer: -
There are three major ways to host a WCF service:-
• Self-hosting the service in his own application domain. This we have already covered in the first section. The service comes in to existence when you create the object of Service Host class and the service closes when you call the Close of the Service Host class.
• Host in application domain or process provided by IIS Server.
• Host in Application domain and process provided by WAS (Windows Activation Service) Server.

Question 5: What is a service level message and transport level message?
Answer: -
You can log WCF message at two levels one is service level and the other is transport level. Service level:-In this the messages are logged as they enter the user code or leave the user code. Transport level: - In this the messages are logged as they are ready to be encoded / decoded. All transport level, infrastructure messages and also reliable messaging is logged. You specify the message levels in the diagnostics node as shown in the below code snippet.

Question 6: For which bindings are transport, message and mixed mode supported?
Answer: -
Below is a table which shows for which binding which mode is supported. We did not discuss the mixed mode. It’s nothing but combination of transport and mixed mode. For instance data encrypted and passed over WsHttp using HTTPS is a mixed mode of security. Encryption is nothing but message security and HTTPS is a transport mode. In a combination they form mixed mode.

Question 7: Which bindings in WCF support the message streaming?
Answer: -
Following bindings supports the streaming in WCF:
1. basicHttpBinding 2. netTcpBinding 3. netNamedPipeBinding

Question 8: What are the various ways of hosting a WCF Service?
Answer: - 1.IIS 2.Self Hosting 3.WAS (Windows Activation Service)

Question 9: What is the use of ServiceBehavior attribute in WCF ?
Answer: -
ServiceBehaviour attribute is used to specify the InstanceContextMode for the WCF Service class (This can be used to maintained a state of the service or a client too).

There are three instance Context Mode in the WFC PerSession : This is used to create a new instance for a service and the same instance is used for all method for a particular client. (eg: State can be maintained per session by declaring a variable) PerCall : This is used to create a new instance for every call from the client whether same client or different. (eg: No state can be maintained as every time a new instance of the service is created) Single : This is used to create only one instance of the service and the same instance is used for all the client request. (eg: Global state can be maintained but this will be applicable for all clients)

Question 10: How the concurrency mode is specified in WCF service?
Answer: - The concurrency mode is specified using the ServiceBehavior attribute on the class that implements the service. Ex. [ServiceBehavior(ConcurrencyMode=ConcurrencyMode.Single)] Public class ServiceClass : IServiceInterface{ //Implementation Code } There are 3 possible values of ConcurrencyMode enumeration Single Reentrant Multiple.

Question 11: hat the different transaction options ?
Answer:-

We can specify transaction in 3 ways in WCF:-
TransactionFlowOption.NotAllowed This is a default option. Using this option no transaction will be propagated across the binding. If any client attempts to call the WCF service in a transaction it will be ignored for this option. This option specifies that client can call this WCF service in a transaction. It’s not compulsory that the service needs to be called in a transaction. You can call without the transaction also. TransactionFlowOption.Mandatory This option specifies that client must call the WCF service in a transaction mode. If the WCF service is called without transaction, ‘FaultException’ will be raised.

Question 12: Wat are the advantages of hosting WCF Services in IIS as compared to self-hosting?
Answer: - There are two main advantages of using IIS over self-hosting:-


Automatic activation IIS provides automatic activation that means the service is not necessary to be running in advance. When any message is received by the service it then launches and fulfills the request. But in case of self hosting the service should always be running.
Process recycling If IIS finds that a service is not healthy that means if it has memory leaks etc, IIS recycles the process. Ok let us try to understand what is recycling in IIS process. For every browser instance, a worker process is spawned and the request is serviced. When the browser disconnects the worker, process stops and you loose all information. IIS also restarts the worker process. By default, the worker process is recycled at around 120 minutes. So why does IIS recycle. By restarting the worker process it ensures any bad code or memory leak do not cause issue to the whole system. In case of self-hosting both the above features, you will need to code yourself.

Question 13: What is trace listener?

Answer - ‘Tracelistener’ are objects that get tracing information from the trace class and they output the data to some medium. For instance you can see from the figure ‘TraceListener’ how it listens to the trace object and outputs the same to UI, File or a windows event log. There are three different types of ‘tracelistener’ first is the ‘defaulttracelistener’ (this outputs the data to UI), second is ‘textwritertracelistener’ (this outputs to a file) and the final one is ‘Eventlogtracelistener’ which outputs the same to a windows event log.

Question 14: What is service host factory in WCF?
Answer-

1. Service host factory is the mechanism by which we can create the instances of service host dynamically as the request comes in.
2. This is useful when we need to implement the event handlers for opening and closing the service.
3. WCF provides ServiceFactory class for this purpose.

Question 15: What are the advantages of hosting WCF service in WAS?

Answer- WAS (Windows Activation Service) is a component of IIS 7.0. Following are few advantages : 1. We are not only limited to HTTP protocol. We can also use supported protocols like TCP, named pipes and MSMQ 2. No need to completely install IIS. We can only install WAS component and keep away the WebServer.

Question 16: In WCF which bindings supports the reliable session?

Answer- In WCF, following bindings supports the reliable session - 1. wsHttpBinding 2. wsDualHttpBinding 3. wsFederationHttpBinding 4. netTcpBinding

Reference - Prasham on dotnetfunda.com and Pro WCF: Practical Microsoft SOA Implementation -- Chris and Denis Mulder – Apress 2007.

- DJ

Friday, September 23, 2011

Asp.net migration to Sharepoint

ASP.NET web developers who are moving to SharePoint site creation. This article will explain in detail how an ASP.NET webpage developed in Visual Studio can be converted into a SharePoint site. If there is a requirement for a website created in Visual Studio, just the old fashioned way with the code-behind logic and other layers like Data Access and Business Logic, to be converted into a SharePoint site, and still make it work the same way with the same code-behind, you are in the right place. The article here along with the code explains 3 core steps that will help you to transform your ASP.NET Web Application into a SharePoint site. Step1: Add a Web Deployment Project to your website solution that will create a single DLL for the website. This step will give us the code-behind DLL and other dependency DLLs for the website. Step2: Copy the bin folder items (DLLs) into the SharePoint site, and tweak the web configuration file of the SharePoint site to use the copied DLLs. Step3: Open your created SharePoint site in SharePoint Designer and import the web pages from our web application and link it to the appropriate DLLs. Code and detail step by step instructions on code project - http://www.codeproject.com/KB/sharepoint/ASPNET_to_Sharepoint.aspx There are more instructions @ http://aspnet2sp.codeplex.com/ http://weblogs.asp.net/bsimser/pages/spsmigration.aspx

Wednesday, September 21, 2011

Build 2011 microsoft @ Anaheim

Build day 1 Key notes and Session videos here -
http://channel9.msdn.com/events/BUILD/BUILD2011/KEY-0001

Speakers: Chris Jones , Steven Sinofsky , Antoine Leblonde , Mike Angiulo , Julie Larson-Green

Build day 2 Key notes and Session videos here -
http://channel9.msdn.com/events/BUILD/BUILD2011/KEY-0002
Speakers: Scott Guthrie , Jeff Sandquist , John Shewchuk , Steve Ballmer , Jason Zander , Bryon Surace , Satya Nadella , Dan Fernandez

Covered topics include -
o Windows Server 8, Azure,
o Virtualization & Cloud
o Identity & secure access
o VS 2011 Developer Preview, Windows Azure SDK, Windows Azure Toolkit 1.5 available
• Application lifecycle management
• Visual Studio TFS on Azure as SAAS

Device + Cloud
• Advance debugging in windows azure - (ability to do performance profiling on code deployed)
• Feature: Find Matching Clones(find copies of source code)
o Alpha blending etc

Web and Mobile Reach - ASP.Net MVC 4 Preview
• Page Inspector/DOM Explorer/Source View
• Unification/Bunding feature, folder reference
• jQuery.Mobile.MVC
• Shipping jquery as part of ASP.Net/Visual Studio 11

Windows Server 8
• High availability built into win8
• Ability to move private network to cloud along with IP infrastructure
More on Channel9 videos here - http://channel9.msdn.com/events/BUILD/BUILD2011

Tuesday, September 20, 2011

Vipersmart with Microsoft Azure and Visual Studio for car application tracking and automation

Viper smart start with new Windows 8 and connected with Cloud/Azure - building live tracking applications and alert systems with Microsoft Visual Studio = good for police and justice departments :) http://www.viper.com/smartstart/ key note @ timeframe - 1:10 http://channel9.msdn.com/Events/BUILD/BUILD2011/KEY-0002

Project Management using new Visual Studio 2011 Rosyln

Project Management using new Visual Studio 2011 developer preview - raw notes from Build Session 2 - 1 Visual Team foundation server as a service instead of setting up servers 2 Sprint planning and tracking user stories, tasks 3 All productivity tools are now part of Visual studio 2011 4 jQuery bundled with Visual studio 5 Image editor - making game development interesting Also works with VS 2010 and onto the cloud. More here - http://channel9.msdn.com/Events/BUILD/BUILD2011/KEY-0002 Cheers -Dipesh

MSDeploy - How do I compare 2 websites sitting on different environments behaving differently?

Thinking how do I compare 2 websites sitting on different environments behaving differently and makes you scratch your head whats's going wrong? :)

Use MS Deploy to compare two web sites quickly and find the differences and help you troubleshoot - http://blogs.iis.net/msdeploy/archive/2008/02/02/using-ms-deploy-to-compare-sites-or-see-what-components-your-site-uses.aspx

Helps you also visualize and see the components that your web site uses.

Upload/download files from secured SSH FTP server

Upload or download files from secured SSH FTP server usign SharpSSH.

SSH (Secure Shell) is a protocol to log into another computer over a network, to execute commands in a remote machine, and to move files from one machine to another. It provides strong authentication and secure communications over unsecured channels. The JSch library is a pure Java implementation of the SSH2 protocol suite; It contains many features such as port forwarding, X11 forwarding, secure file transfer and supports numerous cipher and MAC algorithms. JSch is licensed under BSD style license.

SSH ensures - secure download and user authentication with supported features like -
•Host key type: ssh-rsa and partial ssh-dss.
•Userauth: password, publickey (RSA)
•Generating RSA key pairs.
•SCP and SFTP

Download the demo project here on codeproject - http://www.codeproject.com/KB/IP/sharpssh/sharpSsh_Demo.zip

More here - http://www.codeproject.com/KB/IP/sharpssh.aspx

Monday, September 19, 2011

Build event for Microsoft 2011 - Keynotes, sessions and excerpts

Keynotes and sessions from Build event day1 -
Speakers: Chris Jones , Steven Sinofsky , Antoine Leblonde , Mike Angiulo , Julie Larson-Green
http://channel9.msdn.com/events/BUILD/BUILD2011/KEY-0001

Keynotes and sessions from Build event day2 -

http://channel9.msdn.com/events/BUILD/BUILD2011/KEY-0002

o Windows Server 8 and Azure
o Virtualization & Cloud
o VS 2011 Developer Preview, Windows Azure SDK, Windows Azure Toolkit 1.5 available
o Visual Studio TFS on Azure

Mobile Device + Cloud
• Advance debugging in windows azure - (ability to do performance profiling on code deployed)
• Find Matching Clones(find copies of source code)
• Alpha blending

Demo by Scott Gutherie - Web and Mobile Reach - ASP.Net MVC 4 Preview
• Page Inspector/DOM Explorer/Source View
• Unification/Bunding feature, folder reference
• Shipping jquery as part of ASP.NET/visual studio Roslyn - jQuery.Mobile.MVC
• WebSocket API exposed with .NET 4.5 that allows connection to websocket from anywhere

Web and Mobile Reach/Web TFS
• SaaS for TFS and Windows Server 8 infrastructure

Tools for building Metro style applications

Video on channel 9 as part of Build event for Microsoft 2011 here on tools to build Metro style applications quickly.

http://channel9.msdn.com/events/BUILD/BUILD2011/BPS-1006

Platform for understanding Metro style apps here -
http://channel9.msdn.com/events/BUILD/BUILD2011/BPS-1005

Wednesday, September 14, 2011

Windows 8 Preview download and steps on how to install the bits from ISO file.

Windows 8 Preview download here on MSDN -
http://msdn.microsoft.com/en-us/windows/apps/br229516


How do I install the Windows Developer Preview from a disk image file?
http://social.msdn.microsoft.com/Forums/en-US/windowsdeveloperpreviewgeneral/thread/ee1551b7-2508-413e-a1ff-cf00a97b80a5

How do I convert an html page to MHTML (Web Archive) format using .net code?

How do I convert an html page to MHTML (Web Archive) format using .net code?

MHTML format is the web archive option that bundles the web page and all of its references into a single compact .MHT file. It's a lot easier to distribute a single self-contained file than it is to distribute a HTML file with a subfolder full of image/CSS/Flash/XML files referenced by that HTML file.
If you are using a Document Management System to check HTML reports or something then you the system would expect only 1 file as INPUT. In that scenario, web archive options (MHTML) works well. Here is the code that can be referenced on codeplex that can help achieve this.

http://www.codeproject.com/KB/files/MhtBuilder.aspx

Friday, September 09, 2011

How to build Content management web sites quickly in days without spending much?

One of our client requested that they want to build an intranet CMS site in days without spending much? They were tighly constrained by budget and wanted someone to build them a quick CMS (Content Management Site) without spending much. The way to go was - Umbraco...we did it! :)

How? Watch a five minute introduction video -



Walkthrough detail tutorials and videos here -
http://umbraco.com/help-and-support/video-tutorials.aspx

Detailed free samples and code on codeplex -
http://umbraco.codeplex.com/

Cheers - DJ

How to generate Word/Office documents from server side in .net - Aspose?

How to generate Word or any Microsoft Office documents from server side in .net without installing Office on the server?

Aspose is definitely a choice if you want to generate word documents server side without installing Microsoft Office. Aspose.Words for .NET is a class library for generating, converting and rendering word processing documents. Aspose.Words supports DOC, OOXML, RTF, HTML, OpenDocument, PDF, XPS, EPUB and other file formats.

Codeplex project contains free sample source code that shows how to use Aspose.Words for .NET in your document processing applications.

However Aspose.Words itself for .NET is NOT free and not open source product and
need to be purchased if you intend to develop with them. You can seek evaluation/trial version from their site- http://www.aspose.com/ where they have included few demo projects as well.

Here is the free open source code on codeplex -
http://asposewords.codeplex.com/

-DJ

How to generate barcode from string in SSRS reports and PDF?

I stumbled upon this great article which I would like to point to you if you are looking for a solution on how to generate barcodes (Code 39 and 128) in SQL server reports with 2008 R2. There seems to be an existing issue with Code 128 testing in PDF (10v) but works fine in SSRS/reports.

There are free tools like Z Barcode reader (iphone) but can be used for testing the generated bar code.
Barcode reader free test Tool -

Here is the article in detail - http://www.ssrstips.com/free-reporting-services-barcodes

Also find John's blog useful here - http://www.jtbarton.com/Barcodes/Code39.aspx
You can also download the code demo here: Reporting Services Free Barcodes Demo

Here is the knowledge base article as well that explains how to install font files on your machine for the barcodes to read correctly - http://support.microsoft.com/kb/314960

Sweet, I am going to find some time to get my thumbs down on this pretty soon :) will share more learnings as I discover! - DJ

Tuesday, July 20, 2010

URL Rewrite Module 2.0 reloaded

Check the powerful features with URL Rewrite Module 2.0 reloaded. you can download the extension from Micorsoft site here -
http://www.microsoft.com/web/gallery/install.aspx?appid=urlrewrite2

Check the video and more articles here -
http://www.iis.net/download/URLRewrite

Download samples (with source code) on examples on how to -
Store the rewrite or redirect mappings in a SQL database;
Store the rewrite or redirect mappings in a text file;
Store the lookup substrings in a text file.

Source Code

Cheers - D