Solved

IIS 7 error loading CSS and JS files on app

Posted on 2012-03-30
12
1,211 Views
Last Modified: 2012-04-11
Hello all,

I have a SharePoint website that is being moved from a windows 2003 / IIS6 to a Windows 2008 R2 / IIS7. And there's a lot of things that are not working.

On IIS 6 I had a virtual diretory called /sistema.  On IIS 7 I created an Application with the same name. Problem is, when I try to access CSS or JS files on that application, like: /sistema/includes/script.js , I get an error:

Server Error in '/Sistema' 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 about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
   Microsoft.SharePoint.SPSecurity.get_UseMembershipUserKey() +40
   Microsoft.SharePoint.ApplicationRuntime.SPHttpHandler.OverrideExecuteUrlPath() +2852
   System.Web.DefaultHttpHandler.BeginProcessRequest(HttpContext context, AsyncCallback callback, Object state) +134
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +391
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +262

Open in new window


I know the file is there, and I think it is a permission issue, but I could not fix it.

How do I do that?
Thank you
0
Comment
Question by:vetrixicode
  • 6
  • 4
  • 2
12 Comments
 
LVL 38

Expert Comment

by:Justin Smith
ID: 37787515
How did you do the move?
0
 

Author Comment

by:vetrixicode
ID: 37789718
Hello ACH1LLES,

The Sharepoint Site was a backup/restore operation, no problem there. But the /sistema application was copied from one server to the other.
0
 
LVL 38

Expert Comment

by:Justin Smith
ID: 37789733
So you moved from one farm to another?  

You shouldn't have to play around in the IIS folders with SharePoint sites, even when moving to a new farm.
0
 
LVL 2

Expert Comment

by:BillAndras
ID: 37790192
What version of the .NET framework were you running on the 2003 IIS6 server? This appears to be a .NET version error. I bet you had 2.0 configured on IIS6 and your app pool defaulted to 4.0 on the 2008 IIS7 server.

Also did you change the app pool user or did you leave it default. If the app pool user was changed you need to check permissions on the target site folders (I don't think this is the issue though).
0
 

Author Comment

by:vetrixicode
ID: 37791157
All app pools are V2.0, and they should use a custom account (sharepoint). The /sistema had the default identify, and I've changed it to the sharepoint user.
Now I get Permission Denied message, but the permissions seems right, please check attached messages.

I also get another error when accessing the edit user page:

Server Error in '/Sistema' Application.
Could not load file or assembly 'Microsoft.Office.Server.Search' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.BadImageFormatException: Could not load file or assembly 'Microsoft.Office.Server.Search' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.Office.Server.Search' could not be loaded.

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].


Stack Trace:

[BadImageFormatException: Could not load file or assembly 'Microsoft.Office.Server.Search' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
   System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
   System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +416
   System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +166
   System.Reflection.Assembly.Load(String assemblyString) +35
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +190

[ConfigurationErrorsException: Could not load file or assembly 'Microsoft.Office.Server.Search' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +11224200
   System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +388
   System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +232
   System.Web.Configuration.AssemblyInfo.get_AssemblyInternal() +48
   System.Web.Compilation.CompilationUtil.GetTypeFromAssemblies(AssemblyCollection assembliesCollection, String typeName, Boolean ignoreCase) +166
   System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +362
   System.Web.UI.Page.get_ScriptManagerType() +61
   System.Web.UI.Page.get_IsPartialRenderingSupported() +74
   System.Web.UI.WebControls.ValidationSummary.OnPreRender(EventArgs e) +340
   System.Web.UI.Control.PreRenderRecursiveInternal() +108
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +11056792
   System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +11056490
   System.Web.UI.Page.ProcessRequest() +91
   System.Web.UI.Page.ProcessRequest(HttpContext context) +240
   ASP.cadusuario_aspx.ProcessRequest(HttpContext context) +9
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +599
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +171


Version Information: Microsoft .NET Framework Version:2.0.50727.5448; ASP.NET Version:2.0.50727.5420 

Open in new window


Thank you
permissions.png
app-pool.png
0
 
LVL 2

Expert Comment

by:BillAndras
ID: 37791589
Did you check any sub folders of ativo_adm to make sure they are inheriting the permissions that you set on the top level. You can also replace all child under the advanced button.

Also make sure you register that user with IIS. This will set permissions on other folders also (GAC etc).
C:\Windows\Microsoft.NET\Framework\v2.0.50727>aspnet_regiis -ga domain\id

(Replace your domain and ID in the command above)
0
Wish Marketing would stop bothering you?

Is your marketing department constantly asking for new email signature updates? Are they requesting a different design for every department? Do they need yet another banner added? Don’t let it get you down! There is an easy way to manage all of these requests...

 

Author Comment

by:vetrixicode
ID: 37797418
Hi, BillAndras

I've checked the permissions on subfolders and registered the sharepoint user on IIS.
Restarted IIS. Nothing changes, the problem still there.
What else can I do?
Thanks
0
 
LVL 2

Expert Comment

by:BillAndras
ID: 37797538
Can you please check in Sharepoint to see if your "User Profile Synchronization Service" is stuck in a "starting" state.
0
 

Author Comment

by:vetrixicode
ID: 37798947
Where do I check that in Sharepoint 2007?

On the windows services, I have "User Profile Service", started. I've restarted it, and problem remains.
0
 
LVL 2

Accepted Solution

by:
BillAndras earned 500 total points
ID: 37814821
My apologies, I was traveling so I didn't get back to you. Digging around it appears that the service I listed may only be present if you use ForeFront with Sharepoint.

To try and eliminate an OS\FS permission issue and narrow it down to a Sharepoint problem can we try the following?

 - Create a new account on the server. Call it whatever you want (something like IIStest). Make this account part of the local administrators group.
 - Change your app pool identitiy from network service to this new local admin account.
  - Restart your app pool and see if the problem goes away.

If the problem goes away we can focus on the network service account and the permissions it is missing. We can leverage some of the sysinternal tools if needed.

If the problem doesn't go away it must be something with Sharepoint and not an OS\FS issue. In that case you might have to re-post this in a Sharepoint section. I am not an expert with that.
0
 

Assisted Solution

by:vetrixicode
vetrixicode earned 0 total points
ID: 37817797
Hi, BillAndras

I've found the problem.
The application should have the "scripts" feature permission checked on the handler mappings.
I will share the points with for your effort.
Thank you
0
 

Author Closing Comment

by:vetrixicode
ID: 37831713
I have found the solution myself.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Lync server 2013 Backup Service Error ID 4049 – After File Share Migration
I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
This tutorial will show how to push an installation of Backup Exec to an additional server in both 2012 and 2014 versions of the software. Click on the Backup Exec button in the upper left corner. From here, select Installation and Licensing, then I…
This tutorial will walk an individual through locating and launching the BEUtility application and how to execute it on the appropriate database. Log onto the server running the Backup Exec database. In a larger environment, this would generally be …

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now