Thursday, 20 December 2012

ASP.NET Interview Question Answers For Deployment questions



ASP.NET Deployment questions

  1. What do you know about .NET assemblies?
Assemblies are the smallest units of versioning and deployment in the .NET application. Assemblies are also the building blocks for programs such as Web services, Windows
services, serviced components, and .NET remoting applications.
  1. What’s the difference between private and shared assembly?
    Private assembly is used inside an application only and does not have to
    be identified by a strong name. Shared assembly can be used by multiple
    applications and has to have a strong name.
  2. What’s a strong name?
A strong name includes the
name of the assembly, version number, culture identity, and a public key
token.
  1. How can you tell the application to look for assemblies at the locations other than its own
    install?
Use the directive in the XML .config file for a given application.
<probing
privatePath="c:\mylibs; bin\debug” />
should
do the trick. Or you can add additional search paths in the Properties box of
the deployed application.
  1. How can you debug failed assembly binds?
    Use the Assembly Binding Log Viewer (fuslogvw.exe) to find out the paths
    searched.
  2. Where are shared assemblies stored? Global assembly cache.
  3. How can you create a strong name for a .NET assembly?
    With the help of Strong Name tool (sn.exe).
  4. Where’s global assembly cache located on the system?
    Usually C:\winnt\assembly or C:\windows\assembly.
  5. Can you have two files with the same file name in GAC?
    Yes, remember that GAC is a very special folder, and while normally you
    would not be able to place two files with the same name into a Windows
    folder, GAC differentiates by version number as well, so it’s possible
    for MyApp.dll and MyApp.dll to co-exist in GAC if the first one is
    version 1.0.0.0 and the second one is 1.1.0.0.
  6. So let’s say I have an application that uses MyApp.dll assembly, version 1.0.0.0. There is a
    security bug in that assembly, and I publish the patch, issuing it under name MyApp.dll 1.1.0.0. How do I tell the client applications that are already installed to start using this new MyApp.dll?
Use publisher policy. To configure a publisher
policy, use the publisher policy configuration file, which uses a format
similar app .config file. But unlike the app .config file, a publisher
policy file needs to be compiled into an assembly and placed in the GAC.
  1. What is delay signing?
Delay signing allows you to place a shared
assembly in the GAC by signing the assembly with just the public key. This
allows the assembly to be signed with the private
key at a later stage
,
when the development process is complete and the component or assembly
is ready to be deployed. This process enables developers to work with
shared assemblies as if they were strongly named, and it secures
the private key of the signature from being accessed at different stages
of development.

ASP.NET Inertview Question Answers FOR Windows code security questions




Windows code security questions

  1. What’s the difference between code-based security and role-based security? Which one is better? Code security is the
    approach of using permissions and permission sets for a given code to
    run. The admin, for example, can disable running executables off the
    Internet or restrict access to corporate database to only few
    applications. Role-based security most of the time involves the code
    running with the privileges of the current user. This way the code
    cannot supposedly do more harm than mess up a single user account.
    There’s no better, or 100% thumbs-up approach, depending on the nature
    of deployment, both code-based and role-based security could be
    implemented to an extent.
  2. How can you work with permissions from your .NET application?
 You can request permission to do something and you can demand certain permissions from other apps. You can also refuse permissions so that your app is not inadvertently used to destroy some data.
  1. How can C# app request minimum permissions?
using
System.Security.Permissions;

[assembly:FileDialogPermissionAttribute(SecurityAction.RequestMinimum,
Unrestricted=true)]
  1. What’s a code group?
A code group is a set of assemblies that share a security context.
  1. What’s the difference between authentication and authorization?
    Authentication happens first. You verify user’s identity based on
    credentials. Authorization is making sure the user only gets access to
    the resources he has credentials for.
  2. What are the authentication modes in ASP.NET?
    None, Windows, Forms and Passport.
  3. Are the actual permissions for the application defined at run-time or compile-time?
The CLR computes actual permissions at runtime based on code group membership and the calling chain of the code.

Interview Question Answers For - ASP.NET DataGrid questions



ASP.NET DataGrid questions

  1. What is datagrid?
The DataGrid Web server control is a powerful tool for displaying information from a data
source. It is easy to use; you can display editable data in a professional-looking grid by setting only a few properties. At the same time, the grid has a sophisticated object model that provides you with great flexibility in how you display the data.
  1. What’s the difference between the System.Web.UI.WebControls.DataGrid and and System.Windows.Forms.DataGrid?
 The web ui control does notinherently support master-detail data structures. As with other web server controls, it does not support two-way data binding. If you wantto update data, you must write code to do this yourself. You can only edit one row at a time. It does not inherently support sorting, although it raises events you can handle in order to sort the grid contents. You can bind the web forms datagrid to any object that supports the ienumerable interface. The web forms datagrid control supports paging. It is easy to customize the appearance and layout of the web forms datagrid control as compared to the windows forms one.
  1. How do you customize the column content inside the datagrid?
If you want to customize the content of a column, make the column a template column. Template columns work like item templates in the DataList or Repeater control, except that you are
defining the layout of a column rather than a row.
  1. How do you apply specific formatting to the data inside the cells?
 You cannot specify formatting for columns generated when the grid’s AutoGenerateColumns
property is set to true, only for bound or template columns. To format, set the column’s DataFormatString property to a string-formatting expression suitable for the data type of the data you are formatting.
  1. How do you hide the columns?
 One way to have columns appear dynamically is to create them at design time, and then to hide or
show them as needed. You can do this by setting a column’s Visible property.
  1. How do you display an editable drop-down list?
    Displaying a drop-down list requires a template column in the grid.
    Typically, the ItemTemplate contains a control such as a data-bound
    Label control to show the current value of a field in the record. You
    then add a drop-down list to the EditItemTemplate. In Visual Studio, you
    can add a template column in the Property builder for the grid, and then
    use standard template editing to remove the default TextBox control from
    the EditItemTemplate and drag a DropDownList control into it instead.
    Alternatively, you can add the template column in HTML view. After you
    have created the template column with the drop-down list in it, there
    are two tasks. The first is to populate the list. The second is to preselect
    the appropriate item in the list — for example, if a book’s genre is set
    to “fiction,” when the drop-down list displays, you often want “fiction”
    to be preselected.
  2. How do you check whether the row data has been changed?
    The definitive way to determine whether a row has been dirtied is to
    handle the changed event for the controls in a row. For example, if your
    grid row contains a TextBox control, you can respond to the control’s
    TextChanged event. Similarly, for check boxes, you can respond to a CheckedChanged
    event. In the handler for these events, you maintain a list of the rows
    to be updated. Generally, the best strategy is to track the primary keys
    of the affected rows. For example, you can maintain an ArrayList object
    that contains the primary keys of the rows to update.
This is just a brief on dealing
with ASP.NET DataGrid control. The full version of the document and the
sample code is available on MSDN.

<![if !supportLineBreakNewLine]>

<![endif]>