IIS 7 error loading CSS and JS files on app

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
vetrixicodeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Justin SmithSr. System EngineerCommented:
How did you do the move?
0
vetrixicodeAuthor Commented:
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
Justin SmithSr. System EngineerCommented:
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
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

BillAndrasCommented:
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
vetrixicodeAuthor Commented:
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
BillAndrasCommented:
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
vetrixicodeAuthor Commented:
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
BillAndrasCommented:
Can you please check in Sharepoint to see if your "User Profile Synchronization Service" is stuck in a "starting" state.
0
vetrixicodeAuthor Commented:
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
BillAndrasCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
vetrixicodeAuthor Commented:
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
vetrixicodeAuthor Commented:
I have found the solution myself.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft IIS Web Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.