I have created an asp.net web application on my local machine and I am deploying it to sharepoint. For that I am refereing the following
Deploying ASP.NET Web Applications in the Windows SharePoint Services 3.0 _layouts Folder [http://msdn.microsoft.com/en-us/library/cc297200.aspx]
Its works perfect on my local machine but when I was trying to deploy the same on clients machine it was giving me the "An unexpected error has occurred." Error.
The scenario is, There is not visual studio install on my clients machine so what I was doing is I simply copying my solution folder in 12'hives LAYOUT folder along with the bin folder. Then when I was try to access it by hitting the URL
http://[machineName]/_layouts/[MyCustomFolder]/default.aspx it was giving me the error mention above.
Can anyone help me to solve this issue..? Thanks in advance..
Sachin
Unexpected error might be anything, You need to see what is the root cause of the Error,
- Open the Web.Config file of the IIS SharePoint WebSite
- Search for the CallStack and change it to CallStack="true"
- Search for the CustomError and change it to CustomError="Off"
- Browse the page you will get to know the actual issue that causes the error
- You yourself can rectify it , it might be as simple as missing dll
Try to watch the logfiles, set logging level to maximum to be sure you see what sharepoint says about your page.
To do that, if you have access to the server:
- open SharePoint Central Admin
- go to Operations tab, select "Diagnostic logging"
- select category 'All' and change the trace log level to 'Verbose', save changes
- reset IIS server (for the purpose of a clean experiment)
- open
\\server\c$\Program Files\Common Files\Microsoft Shared\web server extensions\12 logs
and order by modification date - try to load your webpage in /_layouts folder, see the error again
- open the newest logfile you can see and search for
[MyCustomFolder]
name
Then post the error message here.
An unexpected error can have multiple reasons.
Go to C:\inetpub\wwwroot\wss\VirtualDirectories\80
Open Web.Config
Change
<SafeMode MaxControls=”200″ CallStack=”false”
to
<SafeMode MaxControls=”200″ CallStack=”true”
Turn off custom errors
<customErrors mode=”Off”/>
I know that is an old question but for me the fix was to stop and start again the SharePoint Web Application from IIS.
来源:https://stackoverflow.com/questions/1997803/an-unexpected-error-has-occurred