Error message when you try to install SQL Server 2008 if the path of the SQL Server 2008 installation media contains a number sign (#) character: “Could not load file or assembly ‘<Path>\Mi …
Symptoms
When you try to install Microsoft SQL Server 2008 from a local path or from a network path, you receive the following error message:
Could not load file or assembly 'Path\Microsoft.SQL.Chainer.PackageData.dll' or one of its dependencies. The system cannot find the file specified.This issue occurs if the path of the SQL Server 2008 installation media contains a number sign (#) character.
Additionally, the following error message is logged in the Detail_GlobalRules.txt file:
Date Time Slp: Log provider 'Microsoft.SqlServer.Chainer.Infrastructure.LogProviderFile' has been registered
Date Time Slp: Log provider 'Microsoft.SqlServer.Chainer.Infrastructure.LogProviderStatus' has been registered
Date Time Slp: Received request to add the following file to Watson reporting: C:\Documents and Settings\Administrator\Local Settings\Temp\tmpDC5.tmp
Date Time Slp: The following is an exception stack listing the exceptions in outermost to innermost order
Date Time Slp: Inner exceptions are being indented
Date Time Slp:
Date Time Slp: Exception type: Microsoft.SqlServer.Chainer.Infrastructure.ChainerInfrastructureException
Date Time Slp:Message:
Date Time Slp:Could not load file or assembly '<Path>\Microsoft.SQL.Chainer.PackageData.dll' or one of its dependencies. The system cannot find the file specified.
Date Time Slp:Stack:
Date Time Slp:at Microsoft.SqlServer.Chainer.Infrastructure.ExtensionService.RegisterExtension(String extensionId, String name, String path)
Date Time Slp:at Microsoft.SqlServer.Chainer.Setup.Setup.LoadPackageXML(ServiceContainer context)
Date Time Slp:at Microsoft.SqlServer.Chainer.Setup.Setup.Run()
Date Time Slp:at Microsoft.SqlServer.Chainer.Setup.Setup.Start()
Date Time Slp:at Microsoft.SqlServer.Chainer.Setup.Setup.Main()
Date Time Slp:Inner exception type: System.IO.FileNotFoundException
Date Time Slp:Message:
Date Time Slp:Could not load file or assembly <Path>\Microsoft.SQL.Chainer.PackageData.dll' or one of its dependencies. The system cannot find the file specified.
Date Time Slp:Stack:
Date Time Slp:at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
Date Time Slp:at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
Date Time Slp:at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
Date Time Slp:at System.Reflection.Assembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, StackCrawlMark& stackMark)
Date Time Slp:at System.Reflection.Assembly.LoadFrom(String assemblyFile)
Date Time Slp:at Microsoft.SqlServer.Chainer.Infrastructure.ExtensionService.RegisterExtension(String extensionId, String name, String path)
Date Time Slp: The following exception occurred while preparing status logs during Watson failure processing: /Datastore/InputSettings
Date Time Slp: Sco: Attempting to write hklm registry key SOFTWARE\Microsoft\Microsoft SQL Server to file C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\DateTime\Registry_SOFTWARE_Microsoft_Microsoft SQL Server.reg_
Date Time Slp: Sco: Unable to write hklm registry key SOFTWARE\Microsoft\Microsoft SQL Server to file C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\DateTime\Registry_SOFTWARE_Microsoft_Microsoft SQL Server.reg_, Win32 error 2
Date Time Slp: Sco: Attempting to write hklm registry key SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall to file C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\DateTime\Registry_SOFTWARE_Microsoft_Windows_CurrentVersion_Uninstall.reg_
Date Time Slp: Sco: Attempting to write hklm registry key SOFTWARE\Microsoft\MSSQLServer to file C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\DateTime\Registry_SOFTWARE_Microsoft_MSSQLServer.reg_
Date Time Slp: Sco: Unable to write hklm registry key SOFTWARE\Microsoft\MSSQLServer to file C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\DateTime\Registry_SOFTWARE_Microsoft_MSSQLServer.reg_, Win32 error 2
Date Time Slp: Could not load file or assembly '<Path>\Microsoft.SQL.Chainer.PackageData.dll' or one of its dependencies. The system cannot find the file specified.
Date Time Slp: Watson bucket for exception based failure has been created
Date Time Slp: Sco: Attempting to create base registry key HKEY_LOCAL_MACHINE, machine
Date Time Slp: Sco: Attempting to open registry subkey Software\Microsoft\PCHealth\ErrorReporting\DW\Installed
Date Time Slp: Sco: Attempting to get registry value DW0200
Date Time Slp: Submitted 1 of 1 failures to the Watson data repository
Date Time Slp:
Date Time Slp: ----------------------------------------------------------------------
Date Time Slp:
Date Time Slp: Error result: -2068774911
Date Time Slp: Result facility code: 1201
Date Time Slp: Result error code: 1
Resolution
This issue occurs because the Setup program cannot load an assembly from the path of the SQL Server 2008 installation media if the pathcontains a number sign (#) character.
When should I use WPF instead of DirectX?
DirectX is definitely not dead and is still more appropriate than WPF for advanced developers writing hard-core “twitch games” or applications with complex 3D models where you need maximum performance. That said, it’s easy to write a naive DirectX application that performs far worse than a similar WPF application. DirectX is a low-level interface to the graphics hardware that exposes all of the quirks of whatever GPU a particular computer has. DirectX can be thought of as assembly language in the world of graphics: You can do anything the GPU supports. WPF provides a high-level abstraction that takes a description of your scene and figures out the best way to render it, given the hardware resources available. Internally, this might involve using Shader Model 3.0, or the fixed-function pipeline, or software. (Don’t worry if you’re not familiar with these terms, but take it as a sign that you should be using WPF!). The downside of choosing DirectX over WPF is a potentially astronomical increase in development cost. A large part of this cost is the requirement to test your application on each driver/GPU combination you intend to support. One of the major benefits of building on top of WPF is that Microsoft has already done this testing for you! You can instead focus your testing on low-end hardware for measuring performance. The fact that WPF applications can even leverage the client GPU over Remote Desktop or in a partial-trust environment is also a compelling differentiator.
Describe the basic schema of a .config file.
Configuration File Schema for the .NET Framework
Configuration Files are standard XML files.
The elements that implement configuration settings are:
<configuration> Element is the top-level element for all configuration files.
<assemblyBinding> Element specifies assembly binding policy at the configuration level.
<linkedConfiguration> Element specifies a configuration file to include.
The configuration schema is for the machine configuration file, application configuration files, and the security configuration file. The following schemas describe their element purposes:
- Startup Settings Schema – specification of version of the CLR to be used.
- Runtime Settings Schema – configuration of assembly binding and runtime behavior.
- Network Settings Schema – specification of .NET connection to the Internet. \
- Cryptography Settings Schema - mapping friendly algorithm names to classes that implement cryptography algorithms.
- Configuration Sections Schema - creation and use of configuration sections for custom settings.
- Trace and Debug Settings Schema – specification of trace switches and listeners.
- Compiler and Language Provider Settings Schema – specification of compiler configuration for available language providers.
- Application Settings Schema – enabling Windows Forms or ASP.NET applications to store and retrieve application-scoped and user-scoped settings.
Explain the concepts and capabilities of Assembly in .NET.
An assembly is a collection of files (dll’s, exe’s), group of resources that help in creating a logical unit of functionality. It forms the basic building block for deployment, reusability and security issues.
- It provides a CLR environment.
- It helps in maintaining security as it grants grant or denial of permissions.
- When an application starts only assemblies the application initially calls must be present.
- Assemblies can be either static or dynamic.
- Assemblies help in resolving versioning issues.
.NET interview: The concepts and capabilities of Assembly in .NET.
An assembly is a collection of files (dll’s, exe’s), group of resources that help in creating a logical unit of functionality. It forms the basic building block for deployment, reusability and security issues.
- It provides a CLR environment.
- It helps in maintaining security as it grants grant or denial of permissions.
- When an application starts only assemblies the application initially calls must be present.
- Assemblies can be either static or dynamic.
- Assemblies help in resolving versioning issues.
What are different types of directives in .NET?
@Page: Defines page-specific attributes used by the ASP.NET page parser and compiler. Can be included only in .aspx files <%@ Page AspCompat="TRUE" language="C#" %>
@Control:Defines control-specific attributes used by the ASP.NET page parser and compiler. Can be included only in .ascx files. <%@ Control Language="VB" EnableViewState="false" %>
@Import: Explicitly imports a namespace into a page or user control. The Import directive cannot have more than one namespace attribute. To import multiple namespaces, use multiple @Import directives. <% @ Import Namespace="System.web" %>
@Implements: Indicates that the current page or user control implements the specified .NET framework interface.<%@ Implements Interface="System.Web.UI.IPostBackEventHandler" %>
@Register: Associates aliases with namespaces and class names for concise notation in custom server control syntax.<%@ Register Tagprefix="Acme" Tagname="AdRotator" Src="AdRotator.ascx" %>
@Assembly: Links an assembly to the current page during compilation, making all the assembly's classes and interfaces available for use on the page. <%@ Assembly Name="MyAssembly" %><%@ Assembly Src="MySource.vb" %>
@OutputCache: Declaratively controls the output caching policies of an ASP.NET page or a user control contained in a page<%@ OutputCache Duration="#ofseconds" Location="Any | Client | Downstream | Server | None" Shared="True | False" VaryByControl="controlname" VaryByCustom="browser | customstring" VaryByHeader="headers" VaryByParam="parametername" %>
@Reference: Declaratively indicates that another user control or page source file should be dynamically compiled and linked against the page in which this directive is declared.
asp.net interview questions and answers
How do we do paging in gridview?
Make Allowpaging=true also specify the PageIndex as some value
Namespace and Assembly?
Namespace is a logical design-time naming convenience, whereas an assembly establishes the name scope for types at run time.
Diff b/w dataset.clone and dataset.copy
dataset.clone copies just the structure of dataset (including all the datatables, schemas, relations and constraints.); however it doesn’t copy the data. On the other hand dataset.copy, copies both the dataset structure and the data.
Diff b/w Const and readonly?
A const can not be static, while readonly can be static.
A const need to be declared and initialized at declaration only, while a readonly can be initialized at declaration or by the code in the constructor.
A const’s value is evaluated at design time, while a readonly’s value is evaluated at runtime.
Diversities between static or dynamic assemblies ?
Assemblies can be static or dynamic.
Static assemblies can include .NET Framework types (interfaces and classes), as well as resources for the assembly (bitmaps, JPEG files, resource files, and so on).
Static assemblies are stored on disk in portable executable (PE) files.
You can also use the .NET Framework to create dynamic assemblies, which are run directly from memory and are not saved to disk before execution.You can save dynamic assemblies to disk after they have executed.
How can you show the number of visitors of your app
By havving an application variable and Incrementing it in every session start.
TO Achieve it use the Global.asax file's Application_Start and Session_Start Events.
C# interview questions and answers
1. What’s the advantage of using System.Text.StringBuilder over System.String?
StringBuilder is more efficient in cases where a large amount of manipulation is done in the text. Strings are immutable, so it is increasingly being operated, a new instance is created.
2. Can you store multiple data types in System.Array?
No.
3. What’s the difference between the System.Array.CopyTo() and System.Array.Clone()?
The first three performs a deep copy of the array, the second three is shallow.
4. How can you sort the elements of the array in descending order?
By calling Sort() and then Reverse() methods.
5. What’s the C# equivalent of C++ catch (…), which was a catch-all statement for any possible exception?
A catch block that catches the exception of type Process.Exception. You can also omit the parameter information type in this case and write catch {}.
6. Why is it a bad idea to throw your own exceptions?
Well, if that point is known that an error has occurred, why not write the code of law to resolve this error, instead of passing a new Exception object to the catch block? Start your own exclusions means that some design flaws in the project.
7. What’s a delegate?
A delegate object encapsulates a reference to a system. In C++ they were referred to as function pointers.
8. How’s the DLL Hell problem solved in .NET?
Assembly versions allows the application to specify not only the library it needs to function (which was available under Win32), but also the version of the Assembly.
9. What are the ways to deploy an assembly?
An MSI installer, a CAB archive, and XCOPY command.
10. What’s a satellite assembly?
When writing a multilingual application in multi-cultural. NET, and need to deliver the core application separately from the localized modules, the localized assemblies that change the core application are called satellite assemblies.
11. What’s the difference between // comments, /* */ comments and /// comments?
Single-line, multi-line and XML documentation comments.
12. How do you generate documentation from the C# file commented properly with a command-line compiler?
Compile it with a /doc switch.
13. What’s the difference between <c> and <code> XML documentation tag?
Single line code example and multiple-line code example.