Tuesday, February 8, 2011

MOSS Alerts are not working

I was facing this issue on the production server. Restart was ruled out by network admin so here are the steps that resolved my issue:


1. 2 Web Front End Servers: WFE1 (primary with Central admin) and WFE2 (secondary). Clustered database environment on SAN.

2. Select * from TimerLock - gives you one record and tells which server is actually responsible for relaying emails. In my case, it was WFE2.

3. WFE2 timer service wasn't working fine, so I stopped the timer service on WFE2.

4. Timeout to release the lock is 20 minutes - i read it but i need to find out where exactly I can see this value Or is there a way to reset it.

5. After 20 minutes, TimerLock table record value was reset to WFE1 which eventually resolved my issues of not relaying emails.

Assumptions here -
Alerts are enabled. How to check (from command prompt)
1. Go to: C:\Program Files\Comman Files\Microsoft Shared\Web Server Extensions\12\bin
2. stsadm -o getproperty -pn alerts-enabled -url http://portalwebsite/
2a. Answer should be 'Yes'.
3. stsadm -o getproperty -pn job-immediate-alerts -url http://portalwebsite/
3a. Answer should be 'Every 5 minutes...'
4. Above commands are just for confirmation to make sure that alerts are enabled.
5. Assuming the Timer Service domain user account has appropriate priviledges and access to website and content database.
Hope this may help somebody.

Tuesday, November 9, 2010

Exception has been thrown by the target of an invocation.

While adding event receiver using issueList.EventReceivers.Add() I was getting following exception.

System.InvalidOperationException was unhandled
Message="Exception has been thrown by the target of an invocation."
Source="Microsoft.SharePoint"
StackTrace:
at Microsoft.SharePoint.SPEventReceiverDefinition.ValidAssembly()
at Microsoft.SharePoint.SPEventReceiverDefinition.ValidReceiverFields()
at Microsoft.SharePoint.SPEventReceiverDefinition.UpdateInternal(Boolean isMigration)
at Microsoft.SharePoint.SPEventReceiverDefinition.Update()
at Microsoft.SharePoint.SPEventReceiverDefinitionCollection.Add(SPEventReceiverType receiverType, String assembly, String className)
at Company.WSS.DeployAndBindAssemblyToList.Program.RegisterEvents() in C:\Program Files\CustomPortal\Code\Company.WSS.DeployAndBindAssemblyToList\Program.cs:line 37
at Ellison.WSS.DeployAndBindAssemblyToList.Program.Main(String[] args) in C:\Program Files\CustomPortal\Code\Company.WSS.DeployAndBindAssemblyToList\Program.cs:line 13
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:

It was because of the fact that I was using log4Net assembly for logging various activities and it wasn't added into GAC. Once added into GAC, above error gone away.

Tuesday, September 21, 2010

Yahoo Messenger: Restrictions: This operation has been cancelled due to restrictions in effect on this computer. Please contact your system administrator.

I am using official laptop, and I am local administrator to the machine. It is our network policy that nobody is allowed to use any type of messenger from office (be it MSN, Google, Yahoo etc). So whenever I connect to office domain in the office, some policy get set in my laptop which doesnt remove automatically whenever I try to connect from outside office premises.
If I start Google Talk or Yahoo, I see following error:

This operation has been cancelled due to restrictions in effect on this computer. Please contact your system administrator.

This is quite irritating and really frustrating. Policy can be changed however, it require lot of approval process again and again. So I thought let me find solution for myself.

I was dead sure that some policy is set in Registry somewhere. I googled around and found the setting at this location:
Computer\HKEY_CURRENT_USER\software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun




On the right side of this, I found all the entries which are actually restricted to run. Once I removed these entries, I was happy man :).

My Machine Configuration:
Dell Latitude D620, Windows 7 Ultimate 64-bit with 4GB RAM.

Thursday, June 24, 2010

Usage of Workflow Variables using SharePoint Designer 2007

At one of my client's place, I have created a couple of workflows that sends out an email to a printing press automatically when employees requests business cards on the SharePoint Intranet Portal. Created a simple list with following fields - Data Type:
1. Employee Name - String
2. Title - Choice (List of Choices)
3. Qty - Number
4. Cell # - Single Line of text
5. Office # - Choice (Drop down choice list)
6. Extn. # - Number
7. Fax # - Choice (Drop down choice List)
8. Email - Single line of text

Simple requirement, eh!
So created a workflow using SharePoint Designer 2007 for this list.
1. Created one workflow step with one action that is 'Send an Email'. Set the appropriate properties in the email body by selecting the values from the 'Current Item'.
2. Looks good so far, however, upon submission of new item, workflow generates an email and then I noticed that some fields that were empty are printed as "?????". This looks weird.

To fix the issue:
1. I created Workflow Variables and set the default values to 'x' for all of them.
2. Created workflow step for each variable and set the condition as:
a. For Cell #, for example,
Condition: If List:Cell # does not starts with x
Action: Set Variable: CellNumber to List: Cell#

Else IF - Click link 'Add 'ElseIf' Condition Branch'.
Condition:
Action: Set Variable: CellNumber to " " (without double quotes). Basically click spacebar once to put single space in the value.

3. Do it for all the variables. Note. If the Field data type is number, for example, extension number, the condition will be:
If List: Ext # is greater than 0,
4. In case of Choice type field, because choice type field values starts with a numeric value, then condition mentioned in step 2 is still valid.

5. Upon setting all workflow steps and values for conditions, the final step is to modify the 'Send an Email' step. The only change here is that instead of using List values, user variables using 'Add Lookup to body' button.

Reason of doing this drama:
When I create a variable in SharePoint Designer, the default value is set to "?????". I dont know where to change this default value. Even if the list field value is empty in the list, when workflow runs, the default value shows up as "?????" and not empty.
So it is required initialize the values by 'x', and then later resetting the value to " " (without double quotes and one space).

And if you try to check the value of the variable to "?????" then the condition will not be true, which is surprising to me. So to fix the problem, I am setting the value to 'x' first and then later if the List: field Value is empty, then resetting the variable to ' ' so that in the email body the field value should display as ' ' (without quotes) which is what customer wants to display.

Initial Workflow Email Output:
Following request submitted for printing

Employee Name : Test User
Title : Client Relationship Manager
Division : Los Angeles
Quantity : 500
Cell # : ?????
Office # : 323.923.3000
Ext. # : ?????
Fax # : 323.923.3020
Fax # (Res) : ?????
Email : ?????

After Fixing the issue, it was:
Following request submitted for printing

Employee Name : Test User
Title : Client Relationship Manager
Division : Los Angeles
Quantity : 500
Cell # :
Office # : 323.923.3000
Ext. # :
Fax # : 323.923.3020
Fax # (Res) :
Email :

Hope this helps somebody!! Send me email at Atul Shukla for questions or suggestions to improve the code.
Thanks!

Tuesday, June 22, 2010

The user does not exist or is not unique.

Past one week, I was struggling to get the solution of this problem related to SharePoint.
Problem #1: Whenever I try to add a user to a SharePoint group, if the user exist in the site collection, then I get this specific error.
Problem #2: Whenever I try to add a user to a SharePoint group, and if the user DOES NOT exist in the site collection, then I am unable to add the user at all because SharePoint in unable to communicate with Active Directory for name resolution.

These two specific problems were giving me very hard time. Let me give a brief about the environment here:
Web Front End (WFE) Server: 64-bit machine with 64-bit software. Windows Server 2008 R2, Office SharePoint Server 2007 Standard Edition with SP2 (version 6421).
Database + Reporting Server: 64-bit machine with 32-bit software: Windows Server 2003 Enterprise Edition, SQL Server 2005 with SP2, Reporting Services (with SharePoint Integration Mode), Reporting Services SP2 is applied.
Authentication Mechanism: Kerberos. [Very important here, because in windows NTLM authentication, AD link is working]

After struggling for 10 days, I finally open up the ticket with Microsoft to get the solution, and it is fixed after spending more than 24 hours. I interacted with SharePoint Team, IIS Team, Directory Services team, and but this problem is not related to any of these, it is a feature of Windows Server 2008 (and R2 too) which does not work with SharePoint Server 2007 OR the applications that are built on Windows Server 2003 based application. It is a local policy in 2008 R2 that is required to be disabled (and machine restart is required after reset).
This policy name is "Domain member: Digitally encrypt or sign secure channel data (always)". It is Enabled by default when you configure Windows Server 2008 R2.
How to reach to this policy: Start -> Run -> type gpedit.msc.
Browse to Computer Configuration -> Windows Settings -> Security Settings -> Local Policies -> Security Options. Under Security Options on the right hand side, you will find this policy.
Double click to open the policy, Click 'Disable' radio option. Save the changes and restart the machine.

Earlier to this solution, did following checks though:
1. people picker property is correctly set.
2. Domain Controller is receiving request and responding it back using Network Monitoring Tool.
3. Port Qry UI - A tool that helps to check what ports are responding for kerberos Authentication mechanism.

One very good article that is worth reading: http://support.microsoft.com/kb/823659.

Hope this will help somebody who have Windows Server 2008 R2.

Thursday, June 10, 2010

Reporting Server 2005 Add-in for SharePoint Technologies Not setting up correctly on SharePoint Server 2007

I was trying to setup Reporting Services 2005 Add-In for SharePoint Technologies. Existing Production Environment is
(1) Server1 - Web Server (64-bit) - Windows Server 2008 R2, Office SharePoint Server 2007, IIS 7.0 - 64-bit softwares are used in this box
(2) Server2 - Database Server (32-bit) - Windows Server 2003 Ent Edition, SQL Server 2005 Ent Edition, Analysis, Integration & Reporting Services - are installed.

I thought of creating Reporting Services on Web Server (Server1) and with this thought, we installed SQL Server Reporting Services 2005 (32-bit) on Web Server. Initially configuration check was failing because 'Enable 32-bit Applications' setting was 'False' in IIS. I changed it to True and validation succeeded. Installation also completed without any further problems. Ran Reporting Services COnfiguration wizard to set the configuration settings, we gave Database Server name as Server2 and Instance name as MSSQLSERVER. It is done without any problem. Before setting up the SharePoint integration mode, we checked the SharePoint Portal server, and found that neither the portal nor the central admin page is accessible. Panic created because it was production portal web site. Checked all configurations, everything looks good, but still the problem persist. As soon as I disabled 'Enable 32-bit application' and set its value to 'False', Central Admin and Portal Web Site started working again. So conclusion came out that we can't install SSRS on Web Server because web server is running on 64-bit hardware and software, however, SQL Server database is running on 32-bit OS and softwares. So we decided to install SSRS on database server (as there is no separate box available for Reporting services). So we changed 'Enable 32-bit application' to true and then un-installed SSRS from Web Server. Restarted the web server, and changed 'Enable 32-bit application' back to 'False'. Portal web sites and central admin web site was running fine.

Now we installed SSRS on Database server (Server2), and configured reporting services in there. We also installed WSS 3.0 (32-bit) on database server and add it to existing web farm. We configured reporting services into SharePoint Integration Mode, without any problem using domain service account. In fact, we logged to these machines using this service account. All configuration is done and accessible.

Further we need to install Reporting Services 2005 Add-in for SharePoint Technologies on the web server. We installed (64-bit) version on Web Server (Server1). Double click installation was failing so adapted another suggested way. Downloaded SharePointRS_x64.msi locally, and then from command prompt, executed this command SharePointRS_x64.msi SKIPCA=1. This extract a file named rsCustomAction.exe to the %temp% location. From Command Prompt, executed command cd %temp% to go to Temp directory, and then executed rsCustomAction.exe -i. Installation completed without any problem. Given the log details:

User: svcSharepoint
Installing Report Server feature.
Calling copyappbincontents command.

copyappbincontents command completed successfully.
Adding Report Server feature to farm.
Installed Report Server feature.
Activating Report Server feature to root level site collections.
Activating feature in web app 'SharePoint - 90'
Activating feature to root site collection: http://Server1
Feature already activated in site collection http://Server1
Activateing Report Server feature in all admin site collections.
Activating feature in web app ''
Activating feature to root site collection: http://Server1:24920
Feature already activated in site collection http://Server1:24920
Updating DocIcon.xml file
DocIcon.xml file updated.
Beginning install of cab files.
Calling HCInstal for lcid '1033'
Outcome code is: 4
Calling HCInstal for lcid '3082'
Outcome code is: 4
Calling HCInstal for lcid '2070'
Outcome code is: 4
Calling HCInstal for lcid '2052'
Outcome code is: 4
Calling HCInstal for lcid '1055'
Outcome code is: 4
Calling HCInstal for lcid '1053'
Outcome code is: 4
Calling HCInstal for lcid '1049'
Outcome code is: 4
Calling HCInstal for lcid '1046'
Outcome code is: 4
Calling HCInstal for lcid '1045'
Outcome code is: 4
Calling HCInstal for lcid '1044'
Outcome code is: 4
Calling HCInstal for lcid '1043'
Outcome code is: 4
Calling HCInstal for lcid '1042'
Outcome code is: 4
Calling HCInstal for lcid '1041'
Outcome code is: 4
Calling HCInstal for lcid '1040'
Outcome code is: 4
Calling HCInstal for lcid '1038'
Outcome code is: 4
Calling HCInstal for lcid '1036'
Outcome code is: 4
Calling HCInstal for lcid '1035'
Outcome code is: 4
Calling HCInstal for lcid '1032'
Outcome code is: 4
Calling HCInstal for lcid '1031'
Outcome code is: 4
Calling HCInstal for lcid '1030'
Outcome code is: 4
Calling HCInstal for lcid '1029'
Outcome code is: 4
Calling HCInstal for lcid '1028'
Outcome code is: 4
Cab files installed successfully.
Stopping W3SVC service.
Starting W3SVC service.

After installing, followed the instructions to configure the settings in Central Administration - Application Management Tab. I found 'Reportion Services' section. Clicked Manage integration settings and gave values for Report Server Web Service URL as http://server2:8080/reportserver. Set the value of Authentication Mode as Trusted Account. In Grant Database Access section, I noticed that Report Server name is appearing as Server1 (which is my webserver and not report server). Changed this name to Server2. Click Ok pops up a dialog box to ask about the reporting services service account details. I inputed the correct service account details and click Ok. In Set server defaults, I did not make any changes.

With these settings, I thought that I am done with my configuration settings. Further I created a simple SSRS report using Business Development Studio from Database Server (Server2) and published the reports directly to SharePoint Portal under Reports -> Reports Library. Publishing succeeded without any problems. When I clicked the report RDL file, it gives me the following error:

An unexpected error occurred while connecting to the report server. Verify that the report server is available and configured for SharePoint integrated mode.

Enabled the tracing on the web server, and access the portal directly from web server, i found this error:

File not found.

Both webserver and database server are running under NTLM authentication. I ran the following script from command prompt:

cscript adsutil.vbs set w3svc/NTAuthenticationProviders "NTLM"

So now the question I am asking to myself, where exactly it is searching for the report? When I further checked the configuration values set under 'Grant database access', I found that Server Name is still pointing to Web Server (Server1) instead of correct reporting services database that is running on Server2. So now I am stuck as none of the reports are accessible. And I have no clue what else I can check.

---------------------------
I posted this description on SQL Server Reporting Services Forum, but didn't receive any response in few days. Finally opened a ticket with Microsoft and they resolved it. Here is the resolution.
1. Checked if both Server1 and Server2 are running with same version of SharePoint. It was different. Server1 installed with Office SharePoint Search Server 2007 Enterprise Edition 64-bit, and Server2 installed with WSS3.0 (32-bit). So un-installed WSS3.0 from Server2 and installed Office SharePoint Search Server 2007 Enterprise Edition (32-bit as machine is 32-bit). Since reporting services add-in needs SharePoint Object Model to be installed/present on the machine, I configured this installation as 'Web Front-end Only' and attached it to existing web farm. Definitely I dont want this server to host any web application so opted the choice accordingly.
2. Checking "NTLM" Authentication set on Report Server (Server2). He checked this option using this script from command prompt:

C:\inetpub\AdminScripts>cscript adsutil.vbs get w3svc/NTAuthenticationProviders

With this command it is identified that IIS is configured with NTLM authentication. I had executed the check earlier and set it to NTLM using command:

C:\inetpub\AdminScripts>cscript adsutil.vbs set w3svc/NTAuthenticationProviders "NTLM"

Further, check if Report Server IIS Web Site authentication is NTLM. To check that, use following command:

C:\inetpub\AdminScripts>cscript adsutil.vbs get w3svc/812193046/root/NTAuthenticationProviders Where 812193046 is website identifier related to my machine.

Yours could be different so use it accordingly. If the value is not set or is not NTLM, use the following to set appropriately:

C:\inetpub\AdminScripts>cscript adsutil.vbs set w3svc/812193046/root/NTAuthenticationProviders "NTLM"

3. Checking Disable Loop Back Check registry entry on Web & Report Server (Franky speaking, I do not know much about disabling Loop back check, however, it is required to set on web & report server) - As I said, it is required to be set in Web front end & Report Server machines. Here are the instructions. On the web front end, open registry using regedit from Start->Run.

(b) Navigate to the path: Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa and on the right side, if you do not find the name as DisableLoopbackCheck, then create one by:
(a) Right Click white space, click New-> DWORD (32-bit) Value (My WFE is 64-bit machine). Give the name as DisableLoopbackCheck (case-sensitive). The value should be 1 (Decimal).
Do this change on Report Server machine too.

4. Final changes are required in SharePoint Central administration -> Operations -> Global Configuration -> Alternate Access Mapping.
It is important to note that Reporting Services 2005 Add-in works ONLY with the website defined in Default Zone.
In my situation there were two zones (a) Default zone, the internal url was http://server1 and (b) Intranet zone, it was http://portal.company.com/.
I was trying to access the reports using http://portal.company.com/ and getting file not found error because of the said reason. I swapped default zone and intranet zone Internal URL. It is important to note that http://server1 internal URL must exist in any of the zone (other than default).

With these changes, republished a SSRS report on to the portal and accessed it correctly.

So one milestone achieved where SSRS reports are accessible directly from SharePoint Portal. Now the next task was to publish the Analysis Services based SSRS reports to Portal. Publishing is easy, however, those reports will not be accessible and you may notice this error:

An unexpected error occurred while connecting to the report server. Verify that the report server is available and configured for SharePoint integrated mode.

And if you try to access the report directly from Web Server (assuming that trace is on), you will see the following error:

An unexpected error occurred while connecting to the report server. Verify that the report server is available and configured for SharePoint integrated mode. --> Server was unable to process request. ---> The request failed with HTTP status 401: Unauthorized.

With the error description, it is clear that current logged on user is not authorized to access cube data. It is by design that Analysis Services Cubes run under 'Windows Integrated Security'. So how to get pass by this problem, when NTLM security is set for Reporting Services 2005 with SharePoint. There is a solution for that. Follow the steps to check and set some settings:

1. On Database server where report server database exist (in my case, report server is configured on database server {Server2}). Start SQL Server Surface Area Configuration. This option is available here: Start -> All Programs -> Microsoft SQL Server 2005 -> Configuration Tools -> SQL Server Surface Area Configuration.

2. Click Surface Area Configuration for Features. Expand Reporting Services. This option is available under default instance of MSSQLSERVER. Click 'Windows Integrated Security' and clear the check box on the right with the option 'Enable Windows Integrated Security for report data source connections' (if selected).

All set here with a change in the Cube based data source that you must create a new Report Data Source, say DataSource1. Other values are:
a. Name (Required): DataSource1 (.rsds)
b. Data Source Type: Microsoft SQL Server Analysis Services
c. Connection String: Data Source=;Initial Catalog=. For example, if Analysis Services Database Name is AdventureWorks 2008 DW, then this value must be in double quotes while defining in Initial Catalog. Initial Catalog="AdventureWorks 2008 DW"
d. Credentials: Click 'Stored credentials' and then define domain service account in user name as DomainName\DomainUserName, in password box, type valid domain user password. Make sure to select check boxes 'Use as Windows Credential'. Also, this domain service account user should have access to the cubes appropriately. If not it will not work.
e. Availability: Make sure that 'enable this data source' check box is checked. If not, then this data source can't be used at run time for reports.
f. Click Ok to save the changes.

Appropriately set the Report data source as this newly created data source and you are all set.

Thursday, March 4, 2010

Installating SharePoint 2010 Beta in Windows 7

When SharePoint 2010 Beta was released for installation, I was very excited. And then when it was clearly mentioned that it can be installed on Windows 7, then I was more excited. It was because I faced lot of trouble installing SharePoint 2007 on Windows Vista. However, later I found customized solution/installer from Bamboo solutions that allows the installation on to Windows Vista. Pretty good work by Banboo Solutions.

There are lots of MSDN articles available that will instruct you (step by step) to install SharePoint 2010 (Foundation and/or Server) on Windows 7 (Home Premium/Professional/Ultimate). The one MSDN article that I referred was http://msdn.microsoft.com/en-us/library/ee554869(office.14).aspx. Everything is good here.

Home Laptop: Intel Core 2 Duo, Dell XPS with 4GB RAM (Maximum).

SharePoint 2010 Foundation: Installation goes smoothly. With this installation I thought that SharePoint installation is piece of cake and I can install SharePoint 2010 Server on office machine.

Home machine is WorkGroup machine and Office laptop is actually domain connected machine. This is important point here.

Office Laptop: Dell Latitude D620 with 4GB Of maximum RAM.

Downloaded SharePoint 2010 Server software and followed the instructions given in the MSDN web site. Prior to this installation, I did install SQL Server 2008 Enterprise Edition (64-bit). SharePoint 2010 Server installation was smooth. The challenge started when tried to do configuration. Configuration was failing at step 2 with one reason on other. I was freaked out and was thinking the root cause of the failure. I tried so many times, but failed at step 2 of 10 all the time. hmm!!!

Then I recalled by SharePoint 2007 configuration pre-requisite, it says that do the installation with a domain service account. Now I am using office laptop which is not actually connected to domain, however, I am trying to install the application with domain account. What I thought was that if I have Local machine service account which is not actually domain service account, it will definitely work. WIth this thought, I un-installed SharePoint 2010 Server first using my domain account.

Created a local account and make it local admin to the box. Logged off from domain account and then log back again using local service account.

Started SharePoint 2010 Server installation, completed successfully.

Started SharePoint Configuration using configuration wizard. Chose 'Standalone' installation (with my fingers crossed). Step 2 configuration going on... going on... and after 5 minutes or so, step 2 installation completed and it continued till step 8 of 10 without any problems. I was sure that now installation will complete without any problem, however, my assumption was wrong and it failed at step 8. Never mind. I thought of checking the SharePoint Configuration and Content databases if created successfully, and it did.

Started SharePoint 2010 Central Administration, and bingo ... you will see the central administration is running without any problem. Default website is not accessible because step 8 was failed. So you need to create the default website by yourself. I did create the default website that runs on http://machineName/.

Couple of Important Points here:

1. Create local machine service account with 'never expired' password policy.

2. Add this local machine service account in local administrator group.

3. Logon to machine using this service account.

4. Install SharePoint 2010 (Server/Foundation) and complete the configuration. Make sure to use 'Standalone' option. I haven't tried another option.

5. If installation continues and pass step 7 of 10, no worries. Step 8 till 10 is basically for (I guess) to create default site and related configurations.

6. Installation using domain account doesnt work unless you are actually connected to domain.

Good Luck and Enjoy SharePoint 2010!!!

Monday, February 8, 2010

Disable ASP.NET Button while processing in Background

Today, I was stuck in a simple scenario, where I wanted to restrict end user to click a button only once. Looked simple, and while starting implementation, doesn't found it simple enough.

I asked my friends and different people gave me different opinions and options. I was looking for the good option without putting extra code.

So here is the Default2.aspx code.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Background Processing while disabling main button</title>
<script type="text/javascript" language="javascript">
function disableBtn(btnID, newText) {

var btn = document.getElementById(btnID);
setTimeout("setImage('"+btnID+"')", 10);
btn.disabled = true;
btn.value = newText;
}
//using absolute url for image to avoid complication
function setImage(btnID) {
var btn = document.getElementById(btnID);
btn.style.background = 'url(http://images.ysatech.com/ajax-loader.gif)';
}
</script>
</head>

<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="btnOne" runat="server" Text="Process" OnClientClick="disableBtn(this.id, 'Processing...')"
UseSubmitBehavior="false" OnClick="btnOne_Click"/>
<br />
<br />
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</div>
</form>
</body>
</html>

And then Default2.aspx.cs code here:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void btnOne_Click(object sender, EventArgs e)
{
System.Threading.Thread.Sleep(5000);
Label1.Text = DateTime.Now.ToLongDateString();
}
}

Special Thanks to Bryian.

Friday, June 5, 2009

Display XML string on Browser

Initially I thought that it is very simple task. I was surprised myself that it is not so simple as I thought.

My requirement: XMLs are stored in SQL Server 2005 database in XML data type field. On web page, I wanted to display a hyperlink and when user click to this hyperlink, then the xml should display for the selected ID.

My Solution:
Created a sample web application, here is the code snippet of Default.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ShowXmlOnPage._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd >">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"></a>;
<html xmlns="<a href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</a>" ><head runat="server"> <title>Untitled Page</title></head><body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>

And then subsequent code behind page(Default.aspx.cs) is:


using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml;
using System.Xml.Xsl;

namespace ShowXmlOnPage
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
doc.Load(MapPath("Vendor.xml"));
Response.Write(LoadXmldocument(doc));
}
private string LoadXmldocument(XmlDocument xmlDocument)
{
System.IO.Stream s = System.IO.File.OpenRead(MapPath("defaultss.xsl"));
System.Xml.XmlReader reader = System.Xml.XmlReader.Create(s);
XslCompiledTransform transform = new XslCompiledTransform(true);
transform.Load(reader);
System.Text.StringBuilder sb = new System.Text.StringBuilder();
XmlWriter writer = XmlWriter.Create(sb);
transform.Transform(xmlDocument, writer);
return sb.ToString();
}
}
}

The .NET Solution file require a couple of other files too.
1. Vendor.xml file - Here is the XML file:
<?xml version="1.0" encoding="utf-16" ?><Response> <Success> <Operation>PlaceOrderCredit,PlaceSalesOrderPOs,Payment</Operation> <SORefNumber /> <PONumber /> <PONumber /> <SalesReturnRefNumber /> <CreditRefNumber /> <RMARefNumber /> <PaymentRefNumber /> </Success> <Failure> <Operation>PlaceOrderCredit,PlaceSalesOrderPOs,Payment</Operation> <SORefNumber /> <PONumber /> <PONumber /> <SalesReturnRefNumber /> <CreditRefNumber /> <RMARefNumber /> <PaymentRefNumber /> <ErrorMessage /> </Failure></Response>

2. defaultss.xsl - This file I downloaded from "http://blorgh.files.wordpress.com/2006/10/defaultss.txt". Thanks to the author who has modified this xsl file. Save the file as "defaultss.xsl" - that is what I referenced in the code.

And that's it. This is the sample application where Vendor.xml is physically present in the solution folder. It is required to have defaultss.xsl present in the web folder too.

Happy Coding!!!

Wednesday, May 20, 2009

Loading excel data column (alpha-numeric) using OLE DB adapter

Problem: One of the excel data column has alpha-numeric data stored. While loading the data using Ole DB adapter, adapter preset the data type to numeric and subsequently doesn't read the alpha numeric content.

Solution: While defining the connection string, define it as:
string connectionString = "Provider=Microsoft.Jet.OleDb.4.0;Extended Properties='Excel 8.0;HDR=Yes;IMEX=1';";
connectionString += "data source='C:\Temp\FileTobeProcessed.xls';";

we generally define the extended properties = 'Excel 8.0;' only and forget to add, if excel file has header, or treat the column data type as alpha-numeric (add IMEX=1 in extended properties).

It helped me a lot of places, mostly, when I used Dynamics GP eConnect to transfer Items from One bin location to another, and item number data was alpha-numeric.

Tuesday, March 3, 2009

MATSHITA DVD +- RW UJ 857G Driver Problem/Solution

I have DELL XPS 1330 with MATSHITA DVD UJ 857G DVD Drive. Because of nVidia problems, the mother board is replaced three times (thanks GOD that I took 3 years warranty on it), so I didnt pay a single penny so far on repairs.
Now I formatted it with Vista Ultimate 64bit and later I found that Vista is not detecting drivers for DVD.
I searched a lot but didnt find any suitable driver.
In device manager for the drive, I was getting error 32, and googled it based on the error description,and then I found the following posting:
http://www.pchell.com/hardware/cd_drive_error_code_39.shtml

It talks about error 39, still I did the same what the post says... and deleted entry LowerFilters - PxHlpa64. Restarted the computer, and noticed that drive is working just fine.

Tuesday, January 6, 2009

Read QueryString Parameter and use in CAML to display specific blog category Posts

Well, SharePoint is full of challenges, and one day before I was stuck on this problem. I modified Blog Category page, and hence the page became customized. Now when I click a specific blog category, the page was displaying all the posts having no category defined. I was confused what is happening. Apparently I looked the CAML Query in 'SelectCommand' attribute and found the CAML as:
<View><Query><OrderBy><FieldRef Name="PublishedDate" Ascending="FALSE"/><FieldRef Name="ID" Ascending="FALSE"/></OrderBy><Where><Eq><FieldRef Name="PostCategory"/><Value Type=""><GetVar Scope="Request" Name="Name"/></Value></Eq></Where></Query></View>"

Looked Ok to me! What is wrong in there. Noticed that how <GetVar> is working here. I thought of modifying the CAML query, but thought to investigate further using SharePoint Designer. BTW, here I am modifying WebPartPages:DataFormWebPart that has my custom formatting.
  1. Now clicked this DataFormWebPart and a left arrow appears on the right of the same window, click it.
  2. The window is titled as 'Common Data View Tasks'.
  3. Click the top option - Filter.
  4. When you click this 'Filter' option, 'Filter Criteria' window will open.
  5. Click 'Click here to add a new clause...'.
  6. Select the Field Name - In my case it was 'Category'.
  7. Select Comparison value as 'Equals'
  8. Select Value field and drop down option, click the last option...Create a new parameter. As soon as you click this new parameter option from drop down list, a new window will open titled as 'Data View Properties'.
  9. Under Parameters, Type 'CategoryName' for 'Param1'. You can name anything here.
  10. For Source Column, on the right side, select 'Query String' from the 'Parameter Source' drop down combo box.
  11. As soon as you select 'Query String' from drop down, two new text boxes will appear. One is to define the query string variable name. Category page, by default, has 'Name' as Query String value. So Type 'Name' in Query String Variable Text Box.
  12. Leave 'Default Value' text box empty.
  13. Click Ok to close 'Data View Properties' window.
  14. Click Ok to close 'Filter Criteria' window.

You are done here.

And finally when you look back your CAML query, it will look like the following:

<View><Query><OrderBy><FieldRef Name="PublishedDate" Ascending="FALSE"/><FieldRef Name="ID" Ascending="FALSE"/></OrderBy><Where><Eq><FieldRef Name="PostCategory"/><Value Type="Text">{CategoryName}</Value></Eq></Where></Query></View>

And when I ran my category page again for a specific category, filtering was happening correctly.

I am relieved!!

References that I used:

http://msdn.microsoft.com/en-us/library/aa218649.aspx - This I looked to understand the parameter binding relationship and from here I got the clue to look for 'Query String' option as one of the ParameterBindings Name is 'filterParam'. It is interesting article though.

Tuesday, November 4, 2008

Calendar: New Event - Hide 'Workspace' from NewForm or EditForm page

Somebody asked me about hiding a field called 'Workspace' from Calendar: New Event or Edit existing event.
I was wondering that there should be some decent way to hide any field available on 'New' or 'Edit' page.
I googled around, and I found couple of responses, forexample,
1. Modifying the NewForm.aspx page in SharePoint Designer 2007, hiding existing List Form Web Part, and then adding Custom List Form. Then delete the Workspace row from the form.

Let me talk about the dis-advantages of this option:
a. Attach File will NOT work. You need to investigate further to make it work. Still painful process.
b. Try to create a 'Recurring' event, it will not work as expected.

Considering these advantages, I thought that this is very tedious process, and one has to make the changes to all calendar lists. And then this change is required to be done on NewForm.aspx and EditForm.aspx. How about that? So it is really very painful process.

2. Another option is again, modifying the NewForm.aspx or EditForm.aspx, and add following script (However, it didnt work for me though), but it is worth adding it here, just in case, if people are trying to solve the problemin this manner.
<script language='javascript' type='text/javascript' >
var toolbar = document.getElementByName("<name attribute value>"); toolbar.parentNode.parentNode.parentNode.style.display = 'none'; toolbar.parentNode.parentNode.style.display = 'none';
<script>

This can be added in asp:content ContentPlaceHolderId="PlaceHolderTitleAreaClass".
Once again as I said that it didnt work for me, but it can be done this way too.

3. Recommended way. First thing is that it is a feature, and can be found (12 Hive folder) at C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\Template\Features\EventsList. Yes, it is event list feature. Now the modifications are required in schema.xml that can be found under Events folder (folder location, once again, is ..\12\TEMPLATE\FEATURES\EventsList\Events). This file can be modified in notepad.exe.
While looking into the Calendar List Settings in Internet Explorer, I noticed that this field 'Workspace' is of type 'Cross Project Link'. This is important to remember, and search 'CrossProjectLink' in schema.xml file. I noticed there is only one instance of it.
Secondly, the field is SharePoint field so looked for the corresponding class which is SPField. I looked into SPField Class Members on
MSDN and found a couple of interesting properties (and used two of them), for example, ShowInDisplayForm, ShowInEditForm, ShowInListSettings, ShowInNewForm, ShowInVersionHistory, ShowInViewForms. I was interested in ShowInEditForm and ShowInNewForm properties only. So in schema.xml file, for Field of Type="CrossProjectLink", added these two properties as attributes, and set the value="FALSE".
IMPORTANT: attribute value should be set as ShowInNewForm="FALSE" (case sensitive). If you set the value as ShowInNewForm="false", it will not work, so be careful here.
My final <Field> is looked like:
<Field ID="{08fc65f9-48eb-4e99-bd61-5946c439e691}" Type="CrossProjectLink" Name="WorkspaceLink" Format="EventList" DisplayName="$Resources:core,Workspace;" DisplayImage="mtgicon.gif" HeaderImage="mtgicnhd.gif" ClassInfo="Icon" Title="$Resources:core,Meeting_Workspace;" Filterable="TRUE" Sealed="TRUE" SourceID="
http://schemas.microsoft.com/sharepoint/v3" StaticName="WorkspaceLink" ShowInEditForm="FALSE" ShowInNewForm="FALSE">
As mentioned, I added only two attributes.
Save the schema.xml file.

Now the task is to publish the feature with changes. And since the feature is already installed and activated, so it is mandatory to de-activate it and then un-install it.

To smoothen the process I wrote two batch files one each for de-activate, un-install and install, activate:
script for uninstallfeature.bat

path="C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN"
cd\
cd "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN"
stsadm.exe -o deactivatefeature -filename EventsList\Feature.xml -url
http://moss2007:8551/sites/Demo1
stsadm.exe -o uninstallfeature -filename EventsList\Feature.xml -force
cd\

It is straight forward to understand, however, if you want instructions for the same, can send me request.

script for installfeature.bat

path="C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN"
cd\
cd "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN"
stsadm.exe -o installfeature -filename EventsList\Feature.xml
stsadm.exe -o activatefeature -filename EventsList\Feature.xml -url
http://moss2007:8551/sites/demo1
cd\

URL is required to install the feature, in this script, I am deploying the feature for a specific website.
Dont forget to do IISRESET

I am done, and when I tried to create or edit a calendar event, I don't see 'Workspace' option in there. I double checked that attach file is working, and I am able to create a 'Recurring' event too.
It is really very useful tip for me, so thought let me add it here for future reference too.


Update as on 01/13/2009:
1. The approach described here is applicable for a website. For example, if there are different calendars for different locations or divisions for an organization, then this approach can be used to hide a field in all calendars in that website. However, if the requirement is to show/hide 'Workspace' field for a specific list, there is a tool available in http://www.codeplex.com/spm [Thanks for Boris].

Monday, October 13, 2008

SQL Express 2005 - changing sa password from osql command

I installed MOSS 2007 on stand alone system, and by default it installed with SQL Express 2005. Now I wanted to connect to it from osql command using 'sa' account, I tried to connect to it using sa and 'null' password but failed with error 'Login failed for user 'sa''.
I googled and found very interesting support article here.

The steps to change the 'sa' password from command prompt is given here.
1. Goto Command Prompt.
2. Type: osql -E -S servername\instancename [and press Enter]. This option will work only if you are logged on as administrator on the machine or using the account that you used while installing sharepoint. Otherwise this option will not work. It worked for me because I am the administrator on my machine and same account was used to install MOSS.
3. After successfully connected to SQL instance you will see sql prompt as ">".
4. Type:
1>sp_password @old=null, @new='pass123#$', @loginame='sa'
2>go
1>
Important: @loginame (this is correct, there is no double "n" in login name... )
You must see 1> once password is changed successfully. Quit from windows authentication, and try connecting using the new 'sa' password.
1>quit
C:\>
C:\>osql -S servername\OfficeServers -U sa -P pass123#$ [and Press Enter]. You should be able to see the SQL Prompt which is:
1>

Hoping it is useful for someone as it was for me.

Monday, July 14, 2008

Who is connected to a server using Remote Desktop (command line command)

I was trying to connect to a machine, and then I get 'terminal server connection exceeded...' notification.
I was wondering if there is a way to find out who is connected to the machine so that i can send an email who is in 'Disconnected' mode or something.
I took the help of a network administrator, and he gave me one simple command that I ran from command line and it gave me the list of all sessions connected/disconnected to the machine.
Here you go:
C:\>qwinsta /server:urservername [press enter]

If you want to remove any instance/session, then run the following:
C:\>rwinsta /server:urservername ID# [press enter]

I like to mention it here though.

Read AppSettings Section from MyApp.dll.config

Its been long time, when I was struggling to read DLL Configuration file settings, and finally I found the solution. My app.config content is as :


<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler"/>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" ><section name="Lab3.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<log4net debug="true">
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender,log4net">
<param name="File" value="C:\\AppConfig\\Log.txt"/>
<param name="AppendToFile" value="true"/>
<param name="RollingStyle" value="Composite"/>
<param name="DatePattern" value="yyyyMMdd"/>
<param name="MaxSizeRollBackups" value="10"/>
<param name="MaximumFileSize" value="50KB"/>
<layout type="log4net.Layout.PatternLayout,log4net">
<param name="ConversionPattern" value="%d %-5p %c [%x] - %m%n"/>
</layout>
</appender>
<root>
<priority value="ALL"/>
<appender-ref ref="RollingLogFileAppender"/>
</root>
</log4net>
<appSettings>
<add key="UserName" value="MyUserName"/>
</appSettings>
<applicationSettings>
<MyApp.Properties.Settings>
<setting name="MyApp_SampleWS_Service1" serializeAs="String">
<value>http://localhost/SampleWebService/Service1.asmx</value>
</setting>
</Lab3.Properties.Settings>
</applicationSettings>
</configuration>


The assembly (MyApp.dll) is deployed in GAC, and the once compiled, I copied MyApp.dll.config from build folder to C:\AppConfig. This path is hardcoded in the code so that it can be picked up easily by the code.
This app.config has three major parts:
1. Log4Net - to write log details in a text file.
2. AppSettings
3. WebService Reference.

The piece of code that reads this config file from C:\AppConfig location:


ExeConfigurationFileMap fileMap = new ExeConfigurationFileMap();
fileMap.ExeConfigFilename = @"C:\AppConfig" + @"\MyApp.dll.config";
if (!File.Exists(fileMap.ExeConfigFilename))
{
logger.Info("File " + fileMap.ExeConfigFilename + " does not found.");
return;
}
assemblyConfig = ConfigurationManager.OpenMappedExeConfiguration(fileMap, ConfigurationUserLevel.None);
AppSettingsSection appSettings = assemblyConfig.AppSettings;
logger.Info("App Settings found");
logger.Info("Key=UserName, Value=" + appSettings.Settings["UserName"].Value);
logger.Info("End of Information");

And two static variable declarations:

private static ILog logger = LogManager.GetLogger("Atul.Sample.ConfigSample");
private static Configuration assemblyConfig;

Add following line of code in AssemblyInfo.cs too to make log4net working correctly.

[assembly: log4net.Config.XmlConfigurator(ConfigFile = @"C:\AppConfig\MyApp.dll.config", Watch = true)]

Once again, make sure to copy 'MyApp.dll.config' in the C:\AppConfig location to make it work correctly.

Assumption is that your assembly is 'strongly named' as this is required for deployment in GAC.

Thursday, July 10, 2008

Installing MOSS 2007 on Windows Vista home edition (32Bit)

First of all, thanks to the authors of the website who published ways to install Windows Sharepoint Services 3.0 on Windows Vista Operating System.
The URL is
Hats off to the URL content authors!!!

I applied the steps mentioned in the URL. I have windows vista home premium 32bit operating system. However, URL doesn't claim that they have tested installation on Home Premium, however, I did. And I have installed it successfully.
I have SQL 2005 Developer Edition as well as SQL Express. Also have Visual Studio 2008 with .NET framework 2.0, 3.0 and 3.5.
Why I looked these options, because initially I wanted to run virtual PC 2005 or 2007 so that I can run virtual Hard Disk for MOSS 2007. As per the installation instructions, it doesn't support installation on Vista Home, and thanks to google that helped me to find bamboo solutions.
So, I downloaded the files per the URL instructions, and run the installation. While configuring the Sharepoint Services Database, I used SQL Server 2005 default named instance but configuration failed with some errors. Actually I deviated the installation per given the instructions in the URL. Once it failed, I followed the same instructions (installing it on SQL Express instead of regular SQL Default instance), and installation completed smoothly.
Now the challenge starts. I successfully start the Sharepoint services http://servername:8260/
First task is to create a web application, and created it successfully however, when I started the URL it failed with two different errors:
1. Internet Server Error - error on the web.config file.
2. Access Denied.
Please note that I opted Anonymous and Windows Authentication. However, Vista Home doesnt support Windows Authentication, it does support Basic Authentication. So once again I looked into the same URL for possible reasons how to make the website work, but in vain. People were talking about UAC (User Access Control) settings, though I did change it but in vain. So I reverted back all changes.

I tried all options:
1. Changing UAC Settings.
2. Changed Authentication mode in IIS 7.0. 'Basic Authentication' is enabled.











Even completed these steps didnt help me much, so was thinking that what exactly am I missing. And finally I get a breakthrough in the central administration itself.




















Click Save to save settings on Authentication Provider page.

Once I changed the option, it solved the problem and I was able to run my team site successfully.



Friday, June 13, 2008

Installing Windows Vista Ultimate 64-bit on DELL XPS M1330

Well, I am not doing something new here. I bought DELL XPS M1330 last year. It came with following configuration:
Intel Core 2 Duo T7500 (2.2GHz)
3GB RAM, 160GB HDD (7200rpm)
nVidia 8400M GS 128MB Graphics Card,
Intel 4965 Wireless card
9Cell battery
Pre-Installed Windows Vista Home Premium 32-bit.

Well, I did buy Windows Vista Ultimate (32 and 64-bit), so upgraded the machine without any problems though, to Vista Ultimate 32bit. It worked pretty well, and smoothly. Surprisingly Windows Vista does search all the updated drivers automatically, if the machine is connected to internet and install the most appropriate one automatically.

So long story short, I always wanted to have or to feel 64-bit taste. And one crazy day, I made a decision and started the installation. As soon as I completed the first stage of 64-bit installation of Vista Ultimate, I didn't get any success as I was getting BSOD (blue screen). I was unable to look into the error too because machine restarts within seconds as soon as it displays the error. So I spoke to DELL technical support and spent more than 24 hours (in three days) and issue was ATA/AHCI settings in BIOS. Frankly speaking, I really dont know what is the difference, but expert suggest that it should be AHCI.
I followed the instructions given in the following post, and believe me, it is very good and informative, though you will get lot of new information too, here you go:
http://forum.notebookreview.com/showthread.php?t=158277

Also, I refer following websites while investigating on the issues:
http://support.intel.com/support/chipsets/imsm/sb/cs-020644.htm - This website will explain about the chipset installed on your machine and also gives you insight what needs to installed, version etc.

I followed the steps given in the following post:
http://forum.notebookreview.com/showthread.php?t=164159. Before that I installed Vista Ultimate 64-bit in ATA mode (Flash Cache Mode was OFF). And then followed the instructions given in this post. Did the change in the BIOS (as given) and it worked without any problems. And then I followed the instructions as per the first post (http://forum.notebookreview.com/showthread.php?t=158277).

I was very frustrated earlier while talking to Dell technical support, but patiently executing all the troubleshooting steps as they were telling.

Now this laptop is working fine, and windows update is going on right now, while writing down this post using another computer :).

Now the next step is to upgrade the RAM from 3 GB to 4 GB to fully utilize the 64-bit environment.

Monday, January 28, 2008

HTTP Error 500.19 - Internal Server Error

This is the problem I faced when I copied IIS 6.0 web application on to IIS 7.0. The steps that I executed are:
1. Copied the web application on to a different folder, C:\Users\Name\....\myWebSite.
2. In IIS 7.0, created a new 'Application' (please note that I haven't created virtual directory).
3. The physical folder location is same as defined in step 1 above.

I thought that I am done with my configuration, but when I tried to open 'Default.aspx' in the browser, I get this error.
Description: The requested page cannot be accessed because the related configuration data for the page is invalid.
Error Code: 0x80070005
Notification: BeginRequest
Module: IIS Web Core
Requested URL: http://localhost/MyWeb/Default.aspx
Physical Path: C:\Users\LoggedOnUser\...\Default.aspx
Logon User: Not yet determined
Logon Method: Not yet determined
Handler: Not yet determined
Config Error: Cannot read configuration file
Config File: file:///?\C:\Users\loggedOnUser\...\web.config
Config Source:
-1:
0:

More Information... This error occurs when there is a problem reading the configuration file for the Web server or Web application. In some cases, the event logs may contain more information about what caused this error.
--------------------------------------------------------------------------------
Server Version Information: Internet Information Services 7.0.

Seeing this error, it striked in my mind that definitely it is related to configuration settings in IIS 7.0. I checked the following settings:
1. Authentication - It was disabled for 'Windows Authentication'. I enabled it for the web application.
2. But then also, when I tried to open the default page, i get the same error.
I was thinking that why it is not working, then thought to do some hit and trial versions. The very first step I did is to create a new application pool and instead of using 'NetworkService' as Identity, I set the identity to machineName\userName, in my case because I am not the domain user, so I used machineName\LocalAdministrator. And finally, I set the application pool of the web application to this new application pool.

Bingo! It worked!
I need to explore more of IIS 7.0 features, and actual differences / advantages.

Thursday, January 10, 2008

Required file alink.dll with IAlink3 could not be found

I copied the VS.NET 2005 application from a machine running Windows XP Professional on to another machine with configuration [Dell XPS Intel core 2 Duo, 2.2 GHz processor with 3GB RAM and 160GB HDD (7200rpm)] and Windows Vista Ultimate operating system. Well when I copied the files on to the local XPS machine the challenge was to execute the console application. The very first error I was facing (a) Required file alink.dll with IAlink3 could not be found.

Problem: Required file alink.dll with IAlink3 could not be found.
Solution: I thought that definitely it is something related to either operating system or orcus (VS.NET Studio 2008). As usual the very first thing a developer does is to look for a probable solution in google, and thats what I did too. The very first link was talked pretty well about the solution.

The URL is:

http://codebetter.com/blogs/sam.gentile/archive/2007/04/29/workaround-for-orcas-beta-1-compile-problem-required-file-alink-dll-with-ialink3-could-not-be-found.aspx.

In this if this URL is out of service or content is not available, the details are given here too (courtsey to the URL author).
URL Content

------------------------------------------------------------------------------------
Required file 'alink.dll with IAlink3' could not be found.
I am very grateful to two very fine Microsoft gentlemen that heeded my cry and came to my aid. The first was Tim Ng, who pointed me to the existing forum thread where the problem and a first workaround was posted by Pat Long:
The MSUs are located on the Install CD under \WCU\dotNetFramework\dotNetMSP\x86 and they are called
Windows6.0-KB110806-x86.msuWindows6.0-KB929300-x86.msuWindows6.0-kb930264-x86.msuThey needed to be run manually in order. The problem was when I tried to run the 3rd update it would always fail. At that point, Tim brought in another Softie, Jared Parsons, who came up with the solution and the workaround. We're still working on the issue but if you encounter this problem, the following will get you working!

Another update. This error message occurs because the C# compiler is trying to embed a Vista manifest into your DLL. I believe you can also work around this problem by doing the following.
Navigate to the properties page for the project. At the bottom of the Application tab (should be selected) there is an label called "Manifest" and a combo box underneath that says "Embed manifest with default settings". Switch that to "Create Application without a manifest". I know that will work around the warning in VB and I'm pretty sure it will with C# as well.
Thanks Guys!!!!
-----------------------------------------------
I read this post and then recalled that Gosh! I dont have the operating system DVD handy. A sudden thought "Am I stuck?". Can't I proceed without it. Then I read further in the given solution where it talks about the "vista manifest". I just changed the manifest option from "Embed manifest with default settings" to "Create application without a manifest", and compiled my application (which was an exe). Bingo! Application ran without any problem.

Now my next action item is to investigate on this "Manifest" option, what is the difference and what are the advantages and disadvantages.