Friday, November 14, 2008
Error: ASPX page has not been pre-compiled, and cannot be requested
The simple workaround for that I have found is :
1. If you are using any 3rd party component , remove them from web.config, then using Add Reference add all reference to them again.
2. Instead of setting the WDP's Output Assemblies property to “Merge all outputs to a single assembly” and deploy, use Publish Web Site under the Build menu.
3. Check the "Allow this precompiled site to be updatable" check box in the Publish Web Site options of Visual Studio 05, and deploy.
4. make sure you uploaded all the required assemblies. If anyone is missing upload that manually.
Hope this information will be helpful to my peer community.
Monday, September 15, 2008
General network error. Check your network documentation.
I tried all of them but still i experienced the same error intermittently. Finally i found that The calling asp.net page creates an ojbect which opens the connection over and over and relies on the destruct method of the database object to do the closing so I am assuming our problem is related to this but I have not been able to reproduce it reliably so I can't be sure this is the cause of the problem.
then i found this microsoft KB article
it says that In the current design, after an application role is enabled on a client connection to SQL Server, you cannot reset the security context of that connection. Therefore, when the user ends the SQL Server session and disconnects from the server, the session is not reusable. However, OLE DB resource pooling returns the closed connection to the pool, and the error occurs when that connection is reused and the client application tries to reset the connection's security context by calling sp_setapprole again.
WORKAROUND
The only available workaround is to disable OLE DB Resource Pooling, which ADO uses by default. You can do this by adding "OLE DB Services = -2" to the ADO Connection string, as shown here: 'For SQLOLEDB provider
'strConnect = "Provider=SQLOLEDB;server=SQL7Web;OLE DB Services = -2;uid=AppUser;pwd=AppUser;initial catalog=northwind"
' For MSDASQL provider
'strConnect = "DSN=SQLNWind;UID=Test;PWD=Test; OLE DB Services= -2"
Pooling can be disabled for the SQL Server .Net Data Provider by adding "Pooling=False" to the connection string.
although that solves my issue but what if the connection pooling is needed ????
Wednesday, July 2, 2008
What is equivalent for regsvr32 exe in .NET?
What are types of compatibility inVB6?
How do you do object pooling in .NET?
How to implement DTC in .NET?
Can you describe IUKNOWN interface in short?
How can we use COM Components in .NET? Twist: What is RCW?
What is CODE Access security?
All managed code that targets the common language runtime receives the benefits of code access security, even if that code does not make a single code access security call.
What'is difference between System exceptions and Application exceptions?
This class is provided as a means to differentiate between exceptions defined by the system versus exceptions defined by applications.
So, consider it the opposite of ApplicationException. All Exceptions that are defined by the .NET Framework inherit from SystemException. All Exceptions that are defined by code that you write should derive from ApplicationException. Exception is the root class of ALL exceptions.
Friday, June 27, 2008
What is the difference between VB.NET and C# ?
But still let’s list down some major differences between them
:-Advantages VB.NET :-Has support for optional parameters which makes COM interoperability much easy. With Option Strict off late binding is supported. Legacy VB functionalities can be used by using Microsoft.VisualBasic namespace. Has the WITH construct which is not in C#. The VB.NET part of Visual Studio .NET compiles your code in the background. While this is considered an advantage for small projects, people creating very large projects have found that the IDE slows down considerably as the project gets larger. Advantages of C# XML documentation is generated from source code but this is now been incorporated in Whidbey. Operator overloading which is not in current VB.NET but is been introduced in Whidbey. Use of this statement makes unmanaged resource disposal simple. Access to Unsafe code. This allows pointer arithmetic etc, and can improve performance in some situations. However, it is not to be used lightly, as a lot of the normal safety of C# is lost (as the name implies).
This is the major difference that you can access unmanaged code in C# and not in VB.NET.
What is concept of Boxing and Unboxing ?
Dim x As IntegerDim y As Object x = 10‘ boxing process y = x‘ unboxing process x = y
What are Value types and Reference types ?
What is reflection?
Can we force garbage collector to run ?
What is garbage collection?
Programmers usually forget to release the objects while coding ..... Laziness (Remember in VB6 where one of the good practices is to set object to nothing).
CLR automatically releases objects when they are no longer inuse and refernced.
CLR runs on non-deterministic to see the unused objects and cleans them. One side effect of this non-deterministic feature is that we cannot assume an object is destroyed when it goes out of the scope of a function. we should avoid using destructors because before GCdestroys the object it first executes destructor in that case it will have to wait for code to release the umanaged resource. resultin in additional delays in GC.
So its recommended to implement IDisposable interface and write cleanup code in Dispose method and call GC.SuppressFinalizemethod so instructing GC not to call your constructor.
What is Delay signing ?
Following is process to delay sign an assembly:
First obtain your string name keys using SN.EXE. Annotate the source code for the assembly with two custom attributes from System.Reflection: AssemblyKeyFileAttribute, which passes the name of the file containing the public key as a parameter to its constructor. AssemblyDelaySignAttribute, which indicates that delay signing, is being used by passing true as a parameter to its constructor. For example as shown below:[Visual Basic] [C#] [assembly:AssemblyKeyFileAttribute("myKey.snk")] [assembly:AssemblyDelaySignAttribute(true)]The compiler inserts the public key into the assembly manifest and reserves space in the PE file forthe full strong name signature. The real public key must be stored while the assembly is built so that other assemblies that reference this assembly can obtain the key to store in their own assemblyreference. Because the assembly does not have a valid strong name signature, the verification ofthat signature must be turned off. You can do this by using the –r option with the Strong Name tool. The following example turns off verification for an assembly called myAssembly.dll.Sn –r myAssembly.dll80vJust before shipping, you submit the assembly to your organization's signing authority for the actual strong name signing using the –R option with the Strong Name tool. The following example signs an assembly called myAssembly.dll with a strong name usingthe sgKey.snk key pair.
Sn -R myAssembly.dll sgKey.snk
What is concept of strong names (Twist :- How do we generate strong names or what is the process of generating strong names , What is use of SN.EXE , How do we apply strong names to assembly ?
Go to “Visual Studio Command Prompt”. See below figure “Visual studio Command Prompt”. Note the samples are compiled in 2005 but 2003 users do not have to worry about it. Same type of command prompt will be seen in2003 also.
After you are in command prompt type sn.exe -k “c:\test.snk”.
After generation of the file you can view the SNK file in a simple notepad.
After the SNK file is generated it’s time to sign the project with this SNK file
Click on project -- properties and the browse the SNK file to the respective folder and compile the project.
Click on Use a key file to sign the assembly with strong name. and that’s it.
What is GAC (Twist :- What are situations when you register .NET assembly in GAC ?) ?
· If the application has to be shared among several application.
· If the assembly has some special security requirements like only administrator scan remove the assembly. If the assembly is private then a simple delete of assembly the assembly file will remove the assembly. Note :- Registering .NET assembly in GAC can lead to the old problem of DLL hell, where COM version was stored in central registry. So GAC should be used when absolutely necessary.
what is Manifest? what is strongname?
The following table shows the information contained in the assembly manifest. The first four items — the assembly name, version number, culture, and strong name information — make up the assembly's identity.
Assembly name: A text string specifying the assembly's name.
Version number: A major and minor version number, and a revision and build number. The common language runtime uses these numbers to enforce version policy.
Culture: Information on the culture or language the assembly supports. This information should be used only to designate an assembly as a satellite assembly containing culture- or language-specific information. (An assembly with culture information is automatically assumed to be a satellite assembly.)
Strong name information: The public key from the publisher if the assembly has been given a strong name.
List of all files in the assembly: A hash of each file contained in the assembly and a file name. Note that all files that make up the assembly must be in the same directory as the file containing the assembly manifest.
Type reference information: Information used by the runtime to map a type reference to the file that contains its declaration and implementation. This is used for types that are exported from the assembly.
Information on referenced assemblies: A list of other assemblies that are statically referenced by the assembly. Each reference includes the dependent assembly's name, assembly metadata (version, culture, operating system, and so on), and public key, if the assembly is strong named.