Pages

Friday, November 26, 2010

Issue with /Bin Dlls in IIS7

Problem:  I have created  one .NET 4.0 c# webApp using VS2010. The application  runs on  the internal VS web server for test but I face issues while trying to get WebApp running on IIS7.

I have 3 DLLs within my /Bin directory and I am not sure how to "register" them.



Error: Server Error in '/XXX' Application. Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information. 
Exception Details: System.NullReferenceException: Object reference not set to ab instance of an object.
Stack Trace: [NullReferenceException: Object reference not set to an instance of an object.]

Solution: Instead of that Build the project, and then Publish it to a directory somewhere and copy the contents of that publish folder. It sounds like you may have just copied the contents of the development project instead, rather than the build output. 

**** AS IS **** ; Please apply at your own risk.

IIS 7 Permissions issue

We are using windows 2008 for our internal Intranet server.  We want to restrict some of the sub folders to specific a domain group.  We have Windows authentication enabled (anonymous is disabled).  The NTFS permissions on the folder are set as follows:
 - WebAdmins = Full Control
 - RegistrationStaff = Read & executie, List folder contents, Read
WebAdmin users and Technical Staff users are given a "500 error". If I add "Domain Users" or IIS_IUSRS to the folder, then EVERYONE can access it! 

My Accepted Solution:
 http://technet.microsoft.com/en-us/library/cc753695%28WS.10%29.aspx

****AS IS****; Please apply at your own risk.

SQL Database Load Balancing

I have 2 databases(Sql Server) on different servers. How could I implement. Please don't give me the theoritical part as I need more practical stuff.
Helpful Article: - http://www.codeproject.com/KB/architecture/dbloadbalancerservice.aspx?
This may help you: http://msdn.microsoft.com/en-us/library/ms151314%28v=SQL.90%29.aspx
You should check its "Installing SQL Server Replication  " section. 


****AS IS **** ; Please apply at your own risk.

Monday, November 22, 2010

Import Microsoft Access (v2003) tables into SQL Server Express Edition (v2005)

Import Microsoft Access (v2003) tables into SQL Server Express Edition (v2005)
Steps are here:
  • Open Microsoft SQL Server Management Studio Express
  • Create a database for the import, if necessary
  • Open the Microsoft Access database that will be imported into SQL
  • Switch to “Tables” in Microsoft Access
  • Right click on the Table to be exported
  • Select “Export”
  • In the ‘Save Type As…’ field select “ODB Databases()”
  • Name the Table and Press “OK”
  • Press the “New…” button
  • Select “SQL Server” and Press “Next>”
  • Enter a name for the Data Source then Press “Next>”
  • Press “Finish”
  • Enter a Description if necessary
  • Select the SQL Server to connect to and Press “Next>”
  • Select the correct Authentication settings and Press “Next>”
  • Check “Change the default database to:” and Select the correct Database then Press “Next>”
  • Press “Finish”
  • Press “Test Data Source…” to very the information entered was correct
  • If test completed successfully then Press “OK”
  • Press “OK”
  • In “SQL Server Login” dialog box, enter correct authentication information and Press “OK”
  • Export should occur without any further dialog boxes or prompts
  • Switch back to the Microsoft SQL Server Management Studio Express
  • Navigate to the database, refresh the console and verify the table was created/imported
****AS IS****; Apply at your own risk.

Sunday, November 21, 2010

Cannot Login to External Website


Question: I am using IIS 6.0. I used to be able to login to my external website called externaldomain.com.
Now it does not recognize the password. Where do I find it and reset? 
 
Solution was:
Is this problem with you only? You can reset password for your account on DC and then try to login into the website. It should work.
****AS IS**** ; Please apply solution at your own risk.

Thursday, November 18, 2010

Web deploy IIS6 to IIS7 migration problem


Web deploy IIS6 to IIS7 migration problem

I'm trying to move a site with the Web Deployment tool, but the site on the source server is on drive "E", whereas on the destination server it's on drive "C" - how can I configure Web Deploy for this difference?  (I get an drive "E" not found error now when I try the move)

use the replace rule to create the DEPLOYMENT package.

eg: To package

msdeploy -verb:sync  -source:metakey=lm/w3svc/119998765 -dest:package=c:\myWebSite.zip
-replace:objectName=metaProperty,scopeAttributeName=name,scopeAttributeValue=path,targetAttributeName=value,match="e:",replace="c:"
-whatif
> WebDeployPackage.log

*  Make sure you add the  -whatif argument to display what would have happened without actually performing any operations.

See MSDeploy Blog
http://blogs.iis.net/msdeploy/archive/2008/05/23/how-to-write-skip-and-replace-rules-for-msdeploy.aspx

http://technet.microsoft.com/tr-tr/library/dd568992(WS.10).aspx
 

****AS IS**** ; Please apply at your own risk.

Odex enterprise and SSL certificate

http://www.dip.co.uk/kb/1159.aspx
When importing certificates in Windows, the certificate will be placed in your own trusted root store.
If ODEX is running as an application, it is running as your user and so selecting certificates from your root store should show the new certificate.
If ODEX is running as a system service, you will need to ensure that the certificate is copied to the local machine's trusted root store. Certificates can be copied using the Microsoft Management Console (MMC).
Select add/remove snap-ins and add the certificate snap in twice, once selecting your user account and once selecting the local machine.
If you expand your current user trusted root store, you should be able to see the new certificate. This needs to be copied to the corresponding folder underneath the local computer.
If you are unfamiliar with MMC, you can select the import option from ODEX when browsing for certificates. This will cause ODEX to import the certificate into the appropriate store depending on whether ODEX is running as a service.

Theme Managment with httpHandlers


Theme Managment with httpHandlers , How to do that? 


You can do this in a module:
  public class ThemeModule : IHttpModule
  {
    public void Init(HttpApplication context)
    {
      context.PreRequestHandlerExecute += new EventHandler(this.app_PreRequestHandlerExecute);
    }

    private void app_PreRequestHandlerExecute(object Sender, EventArgs E)
    {
      Page p = HttpContext.Current.Handler as Page;
      if (p != null)
      {
          string strTheme = "Theme1";
            if (Convert.ToString(HttpContext.Current.Session["THEME"]) != string.Empty)
                strTheme = Convert.ToString(HttpContext.Current.Session["THEME"]);
            return strTheme;
          p.StylsheetTheme;
      }
    }

    public void Dispose()
    {
    }
  }
   Then add the module in config:
   
     
   
 

An alternative however, is to use an even in global.asax:
private void app_PreRequestHandlerExecute(object Sender, EventArgs E)
    {
        Page p = HttpContext.Current.Handler as Page;
      
        if (p != null)
        {
            string strTheme = "Theme1";
            if (Convert.ToString(HttpContext.Current.Session["THEME"]) != string.Empty)
                strTheme = Convert.ToString(HttpContext.Current.Session["THEME"]);
            p.StyleSheetTheme = strTheme;
        }
    } This saves having to configure the module. The event runs early enough int he page lifecycle to allow the theme to be set.

Wednesday, November 17, 2010

Exception: System.NullReferenceException

"An unhandled exception occurred and the process was terminated. Application ID: /LM/W3SVC/1303255675/ROOT  Process ID: 5112 Exception: System.NullReferenceException"

 error - 2010/11/17 00:12:20 - ASP.NET 2.0.50727.0 (1334) - n/a  "An unhandled exception occurred and the process was terminated. Application ID: /LM/W3SVC/1302395675/ROOT  Process ID: 5112 Exception: System.NullReferenceException
 Message: Object reference not set to an instance of an object. StackTrace:
 at System.Web.SessionState.SessionStateModule.PollLockedSessionCallback(Object
 state) at System.Threading._TimerCallback.TimerCallback_Context(Object state) at  System.Threading.ExecutionContext.runTryCode(Object userData) at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode
 code,
 CleanupCode backoutCode, Object userData) at System.Threading.ExecutionContext.RunInternal(ExecutionContext
 executionContext, ContextCallback callback, Object
 state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext,  ContextCallback callback, Object state) at System.Threading._TimerCallback.PerformTimerCallback(Object
 state)"

Possible Solution:
This might be an InProc Session State issue.  This Microsoft Support Fix might help.  Check it out.
http://support.microsoft.com/kb/942086

Check this link as well.  Here is a discussion on similar problem and may provide some clue: http://forums.asp.net/t/1132396.aspx

Also, its a possibility when a heavy load on the web server and you are using InProc, can cause this problem. You can try editing your Session State using State Server
http://msdn.microsoft.com/en-us/library/ms178586.aspx


****AS IS**** ; Please apply at your own risk.

Russell Peter on Cheapness : You want a bear

We are cheap .. every body is cheap .. Never  called White people cheap. White people will get really upset. when You call a white person cheap, he will get very angry. because White people probably are a part of people who are not cheap.
If you call White people cheap, Fuck you are cheap, I am not a cheap. I buy a bear, You want a bear, I said a white guy cheap, He said you want a bear you want a bear you want a bear you want a bear Fuck I am not a cheap I will buy a bear. Everybody is cheap , its all about levels you know.

Russell Peter on Bargaining in China : Be A Man

 An Indian and a Chinese can be together but can't work together.. you know what I mean?
Well there's this day I went to this chinese mall and I see this bag. I ask this guy: You know i want to buy this bag, how much?
and he says: thirty-five dollars. And then I said: oh c'mon thirty dollars. Asian guy says:NOOOOOOOOOOOOOOOOO , the Biggest NO I ever heard in my life , i said its just five dollars. Then he said: wait I talk to my wife.*chimla choo chi mai choyee*OK you seem like nice guy, I will give you best price thirty-four fifty. i said cmon man that 50 cents... he replied you save 50 cents here you go somewhere else you save another 50 cents.. you have one dollar and you go to the dollar store you go buy something else. Then i start to leave , the guy yells: Hey Be a man, do the right thing. Buy the bag.
HAHA an Indian cant live without a bargain and a Chinese guy cant give you a bargain.

Russell Peters on the N-word

As a guy who grew up with Black people, I know the N-word is not specific to people. It’s a fucking noun. It is used for everything else but people. It’s not specific to black people.
I see my friends. They’ll be like, “Yo Russell, I seen you with some Chinese niggers last night.”...
My homeboy called me, was like, “Yo, you gotta put on Discovery Channel, son They got this shit on killer whales. Yo, those niggers are crazy!”

Russell Peters on Shopping in China

I have to go to this mall in Beijing to buy some clothes. I didn’t know this until I got there, but apparently in China I’m Shaquille O’Neal. I go to mall. I walk into the store. I’m like, “Hey, you got a 10.5/11 in those shoes?”
“Ah no! How about an 8?”
“How about I can’t negotiate my foot size with you?”

Russell Peters on Racism

Every group is racist. White folks will see a group of Indian people and they’re like, “Look at all those brown people, they’re probably all very happy together.” Then you get in that group and like, “Hey, you from India? I’m from India. What part? No, not that part. Go to hell you dirty bastard.”

Tuesday, November 16, 2010

IIS6 and IIRF rewrite not honoring .NET tilde (~) to denote application root.

IIS6 and IIRF rewrite not honoring .NET tilde (~) to denote application root.
At IIS6,  I'm using the IIRF ASAPI filter to provide extension-less "friendly" url rewrites.
The end result I want is an IIS6 + IIRF installation of my web application to behave exactly the same as it does when installed on IIS7+ with Microsoft's urlrewrite enabled.

Problem description is:

"~/services/servicename" is rendered in html as "/services/servicename" when i'm actually on a root page which is at "/".
Pages from sub directories like  "/contact/email-us" that same url "~/services/servicename
" will render in html as "/contact/services/this-is-a-service"
Solution:

Need a web application to create users via webpage on browser

I like to have a webpage on my website which could provide me option to add username , select Group membership and have a web application to create the users and their home folders. Is it possible to do so?


Yes it is possible and easy, A small coding is required though: 
Add user
http://channel9.msdn.com/Blogs/RobertShelton/Adding-users-to-Active-Directory-with-NET

Add user to Group
http://channel9.msdn.com/Blogs/RobertShelton/Adding-Groups-and-users-to-groups-to-Active-Directory-with-NET

MSDN Example
http://msdn.microsoft.com/en-us/library/bb384369.aspx

Can i know how to add the following Handler Mapping in IIS6.0


Case - Conversion of PublicKeyToken into a valid handler using sn.exe

Request path: Reserved.ReportViewerWebControl.axd
Type: Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Name: Reserved.ReportViewerWebControl.axd

 
You could not add this Handler directly, First you have to convert it using the StrongName
As strong names are generated using PublicKey cryptography.  So, it is necessary to have a PublicKey as part of the assemblies manifest so implementation of  applications can then encrypt using the PrivateKey generated with a strong name key, which is essentially a very large random number, Hence, make the assembly useful.  The PublicKeyToken value is that public key.  A StrongName assembly's PublicKey token can be found with the "sn.exe" utility which comes with the .NET Framework SDK with the "-T" switch.  The "sn.exe" utility is primarily used to generate and manage strong name keys, and sign assemblies.

In this case PublicKeyToken=b03f5f7f11d50a3a

****AS IS**** ; Please try at your own risk.

Friday, November 12, 2010

Festival of Employees - Sunday
Happy Weekend :-)

Thursday, November 11, 2010

Bug on Sharepoint 2010

Bug on Sharepoint 2010

You try to import users from Active directory who have Manager field and the time you create filter, Central point Admin crash.
This is a bug in Sharepoint 2010, and it'll be fixed in coming service packs

How to Add Pictures to Survey in Sharepoint

You could add the insert the image  code before the question text, the question should looks like: Ques1:xxxx

Then add JavaScript code  to the newForm.aspx and editForm.aspx
document.getElementById('onetIDListForm').rows[0].cells[0].innerHTML
    =
    document.getElementById('onetIDListForm').rows[0].cells[0].innerHTML.replace(/</g,'<').replace(/>/g,'>');


It will work on DispForm, NewForm and EditForm pages. While for 'Summary page" , please use below code
document.getElementById('MSOZoneCell_WebPartWPQ2').innerHTML
    =
    document.getElementById('MSOZoneCell_WebPartWPQ2').innerHTML.replace(/</g,'<').replace(/>/g,'>');

Sharepoint List permissions

Default Sharepoint List permissions are given below:

Manage List, Override Check out, Add items, Edit Items, Delete items, View items, Approve items,
open items, view versions, Delete versions, create Alerts, View application pages

While for a user, list Permissions, the following are required...
Add Items, Edit Items, View items, Open Items, View Versions, Create Alerts, View Application Pages

For Site Permissions, the following are only required
Browse Directories, View Pages, Enumerate Permissions, Browse user Information, Use Remote Interfaces, Use Client Integration Features, Open, Edit Personal Information.

****AS IS**** ; Please use provided information at your own risk

Microsoft Single Sign On service missing

Case :Microsoft Single Sign On service missing

To enable SSO functionality for Office SharePoint Server 2007, you need to start the Microsoft Single Sign-On service and then manage SSO settings in the SharePoint Central Administration Web application.

Start the Single Sign-On service on all front-end Web servers and all application servers in your farm that run Excel Calculation Services.
Steps to start it: 
Start -> Run -> Services.msc -> Locate Microsoft Single Sign-On Service -> On the Log On tab of the Single Sign-On Service Properties page, click This account, and then type the domain, user name, and password that you have used to install and manage your server. -> Click Apply. -> change the start up type to Automatic, click Start, and then click OK.

****AS IS**** ; Please use the provided information at your own risk. 

Unable to upload files with specific extension via explorer view in SharePoint 2010

Case : Unable to upload files with particular extension via explorer view in SharePoint 2010

You may face problem in upload or delete the below file types when accessing a SharePoint 2010 library via explorer view while able to upload or delete all file types file when accessing the library via a web browser
File Extension could be :
.vb
.resx
.vbproj
.dll
.exe
.mdb


Error : Item not found
This is no longer located in \\path. Verify the item's location and try again.

 
Steps to solution:
All file extensions have been allowed via Central Administration --> Security --> Define blocked file types


IIS manager -> select the web site -> properties -> Select Handler Mappings -> Edit Feature Permissions -> Uncheck the Execute check-box -> Restart the site

To enable the upload of .other file types via explorer view : IIS manager -> Add a new MIME type for the required extention

Now Modify IIS configuration file applicationHost.config under path %SystemRoot%\system32\inetsrv\config
locate the  < requestFiltering >  section
change the allowed property to true to allow above file extension to be served.
e.g
     
                 
                         



****AS IS**** ; Please use at your own risk.