Asp.net MVC Connection - asp.net-mvc

I have multiple Web applications running on the same server. All are MVC.
I created a new Asp.Net MVC app and placed it on the server. Changed the Connection String values and it's throws the following error. I am stumped with this. SQL Server is set to allow remote connections. Connection String references the correct named instance.
This is my connection string in web.config
<connectionStrings>
<add name="RAD_SystemEntities" connectionString="metadata=res://*/Models.RADSystem.csdl|res://*/Models.RADSystem.ssdl|res://*/Models.RADSystem.msl;provider=System.Data.SqlClient;provider connection string="Data Source=ServerName\NAMED_INSTANCE;Initial Catalog=RAD_System;Integrated Security=False;Persist Security Info=False;User ID=sa;Password=sa"" providerName="System.Data.EntityClient" />
</connectionStrings>
Following is the Error
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or
was not accessible. Verify that the instance name is correct and that
SQL Server is configured to allow remote connections. (provider: SQL
Network Interfaces, error: 26 - Error Locating Server/Instance
Specified) 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.Exception: A network-related or instance-specific error occurred while establishing a connection to
SQL Server. The server was not found or was not accessible. Verify
that the instance name is correct and that SQL Server is configured to
allow remote connections. (provider: SQL Network Interfaces, error: 26
- Error Locating Server/Instance Specified)
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:
[Exception: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not
found or was not accessible. Verify that the instance name is correct
and that SQL Server is configured to allow remote connections.
(provider: SQL Network Interfaces, error: 26 - Error Locating
Server/Instance Specified)]
TotalDesk.Controllers.HomeController.Index(User model) +7147
lambda_method(Closure , ControllerBase , Object[] ) +104
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase
controller, Object[] parameters) +14
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext
controllerContext, IDictionary2 parameters) +181
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext
controllerContext, ActionDescriptor actionDescriptor, IDictionary2
parameters) +27
System.Web.Mvc.Async.<>c__DisplayClass42.b__41()
+28 System.Web.Mvc.Async.<>c__DisplayClass81.<BeginSynchronous>b__7(IAsyncResult
_) +10 System.Web.Mvc.Async.WrappedAsyncResult1.End() +50 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult
asyncResult) +32
System.Web.Mvc.Async.<>c__DisplayClass39.b__33()
+58 System.Web.Mvc.Async.<>c__DisplayClass4f.b__49()
+225 System.Web.Mvc.Async.<>c__DisplayClass37.b__36(IAsyncResult asyncResult) +10 System.Web.Mvc.Async.WrappedAsyncResult1.End()
+50 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult
asyncResult) +34
System.Web.Mvc.Async.<>c__DisplayClass2a.<BeginInvokeAction>b__20()
+24 System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult
asyncResult) +99 System.Web.Mvc.Async.WrappedAsyncResult1.End()
+50 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult
asyncResult) +27
System.Web.Mvc.<>c__DisplayClass1d.b__18(IAsyncResult
asyncResult) +14
System.Web.Mvc.Async.<>c__DisplayClass4.b__3(IAsyncResult
ar) +23 System.Web.Mvc.Async.WrappedAsyncResult1.End() +55
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +39
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult
ar) +23 System.Web.Mvc.Async.WrappedAsyncResult1.End() +55
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +29
System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult
asyncResult) +10
System.Web.Mvc.<>c__DisplayClass8.b__3(IAsyncResult
asyncResult) +25
System.Web.Mvc.Async.<>c__DisplayClass4.b__3(IAsyncResult
ar) +23 System.Web.Mvc.Async.WrappedAsyncResult`1.End() +55
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
+31 System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult
result) +9
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
+9667432 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155

My issue was that I had the inccorect Entity Framework in my project to what was in the GAC. have changed my Entity Framework version to be the same as version in GAC and the issue has been resolved.
If you are doing the same. Please make sure to update the references in config files to the correct version

your problem is with the database -
To begin - there are 4 issues that could be causing the common LocalDb SqlExpress Sql Server connectivity errors SQL Network Interfaces, error: 50 - Local Database Runtime error occurred, before you begin you need to rename the v11 or v12 to (localdb)\mssqllocaldb
You dont have the services running
You don't have the firelwall ports here
configured
Your install has and issue/corrupt (the steps below help give you a nice clean start)
You did not rename the V11 or 12 to mssqllocaldb
I found that the simplest is to do the below - I have attached the pics and steps for help.
First verify which instance you have installed, you can do this by checking the registry and by running cmd
cmd> Sqllocaldb.exe i
cmd> Sqllocaldb.exe s "whicheverVersionYouWantFromListBefore"
if this step fails, you can delete with option d cmd> Sqllocaldb.exe d "someDb"
cmd> Sqllocaldb.exe c "createSomeNewDbIfyouWantDb"
cmd> Sqllocaldb.exe start "createSomeNewDbIfyouWantDb"

Related

Compiler executable file C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe cannot be found

I had an application on .Net Framework 4.0 and MVC2 running on Visual Studio 2010. I decided to move this application to Visual Studio 2015. So First I've upgraded it to MVC3 and then Opened it with Visual Studio 2015 and because the System.Web.MVC and some other dlls were missing. I installed Microsoft.AspNet.Mvc v3.0.50813.1 from Nuget. Now my application are being compiled successfully. But after running it, it displays this error:
Compiler executable file C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe cannot be found.
The file csc.exe exists in my Framework64 directory, but not in Framework directory.
PS: I has some difficulty installing Visual Studio 2015 and I would prefer a solution doesn't need reinstalling Visual Studio.
Stack Trace:
[InvalidOperationException: Compiler executable file C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe cannot be found.]
Microsoft.CSharp.CSharpCodeGenerator.Compile(CompilerParameters options, String compilerDirectory, String compilerExe, String arguments, String& outputFile, Int32& nativeReturnValue, String trueArgs) +6840643
Microsoft.CSharp.CSharpCodeGenerator.FromFileBatch(CompilerParameters options, String[] fileNames) +473
Microsoft.CSharp.CSharpCodeGenerator.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromFileBatch(CompilerParameters options, String[] fileNames) +186
System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromFile(CompilerParameters options, String[] fileNames) +24
System.Web.Compilation.AssemblyBuilder.Compile() +950
System.Web.Compilation.<>c.<PerformBuild>b__22_0(AssemblyBuilder assemblyBuilder) +13
System.Threading.Tasks.<>c__DisplayClass42_0`2.<PartitionerForEachWorker>b__1() +1321
System.Threading.Tasks.Task.InnerInvoke() +43
System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask) +18
System.Threading.Tasks.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object ) +208
System.Web.Compilation.BuildProvidersCompiler.PerformBuild() +132
System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories, Boolean isDirectoryAllowed) +502
System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories) +125
System.Web.Compilation.BuildManager.CompileResourcesDirectory() +32
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +227
[HttpException (0x80004005): Compiler executable file C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe cannot be found.]
System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +62
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +435
System.Web.Compilation.BuildManager.CallAppInitializeMethod() +33
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +545
[HttpException (0x80004005): Compiler executable file C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe cannot be found.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9947444
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +261
Mvc3 is not supported after visual studio 2010
You will have to update to a newer version of mvc

tfs53010 error. TFS Build agent does nothing

just installed a fresh version of TFS 2015 on a box, everything is working fine and now i'm trying to get builds working, but I'm getting the below error repeating on me over and over.
I'm using the default local service auth for the build service, but i get the same error with a custom user as well. The VSO agent is shown as running in services and the TFS admin console, but any time i start a queue it just sits there, waiting for the build service.
All the errors that i find online have stacktraces that seem much more informative than mine. If you're interested here is a gist of the most recent log entry in D:\Program Files\Microsoft Team Foundation Server 14.0\Build_diag .
Does anyone have any ideas?
TF53010: The following error has occurred in a Team Foundation component or extension:
Date (UTC): 12/3/2015 1:24:00 AM
Machine:
Application Domain: TfsJobAgent.exe
Assembly: Microsoft.TeamFoundation.Framework.Server, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a; v4.0.30319
Service Host:
Process Details:
Process Name: TfsJobAgent
Process Id: 1584
Thread Id: 2216
Account name: NT AUTHORITY\LOCAL SERVICE
Detailed Message: There was an error during job agent execution. The operation will be retried. Similar errors in the next five minutes may not be logged.
Exception Message: Exception has been thrown by the target of an invocation. (type TargetInvocationException)
Exception Stack Trace: at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.Activator.CreateInstance[T]()
at Microsoft.TeamFoundation.Framework.Server.ComponentCreator`1.Create(ISqlConnectionInfo connectionInfo, Int32 commandTimeout, Int32 deadlockPause, Int32 maxDeadlockRetries, ITFLogger logger)
at Microsoft.TeamFoundation.Framework.Server.TeamFoundationResourceManagementService.CreateComponentRaw[TComponent](ISqlConnectionInfo connectionInfo, Int32 commandTimeout, Int32 deadlockPause, Int32 maxDeadlockRetries, Boolean handleNoResourceManagementSchema, Boolean verifyServiceVersion, Boolean throwExceptions, ITFLogger logger)
at Microsoft.TeamFoundation.Framework.Server.JobApplication.SetupInternal()
at Microsoft.TeamFoundation.Framework.Server.JobServiceUtil.RetryOperationsUntilSuccessful(RetryOperations operations, Int32 maxTries, Int32& delayOnExceptionSeconds)
Inner Exception Details:
Exception Message: External component has thrown an exception. (type SEHException)
Exception Stack Trace: at Microsoft.TeamFoundation.Framework.Server.DatabaseManagementComponent15..ctor()

The pre-application start initialization method Run on type WebActivator.ActivationManager threw an exception

I'm trying to run an ASP MVC 4 application on IIS. When I publish MVC 4 application from Basic template - without any dependencies apart from these made by the wizard - application works. But when I publish other application, that is using WebActivator and many other libs, I see this error:
Could not load file or assembly 'System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)
And complete stack trace:
[FileLoadException: Could not load file or assembly 'System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)]
System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type) +0
System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) +180
System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments) +192
System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg) +115
System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent) +426
System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType) +103
System.Reflection.RuntimeAssembly.GetCustomAttributes(Type attributeType, Boolean inherit) +64
WebActivator.AssemblyExtensions.GetActivationAttributes(Assembly assembly) +113
WebActivator.ActivationManager.RunActivationMethods() +216
WebActivator.ActivationManager.RunPreStartMethods() +28
WebActivator.ActivationManager.Run() +55
[InvalidOperationException: The pre-application start initialization
method Run on type WebActivator.ActivationManager threw an exception
with the following error message: Could not load file or assembly
'System.Core, Version=2.0.5.0, Culture=neutral,
PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes' or one of its
dependencies. The given assembly name or codebase was invalid.
(Exception from HRESULT: 0x80131047).]
System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1
methods) +423
System.Web.Compilation.BuildManager.CallPreStartInitMethods() +306
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager
appManager, IApplicationHost appHost, IConfigMapPathFactory
configMapPathFactory, HostingEnvironmentParameters hostingParameters,
PolicyLevel policyLevel, Exception appDomainCreationException) +591
[HttpException (0x80004005): The pre-application start initialization
method Run on type WebActivator.ActivationManager threw an exception
with the following error message: Could not load file or assembly
'System.Core, Version=2.0.5.0, Culture=neutral,
PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes' or one of its
dependencies. The given assembly name or codebase was invalid.
(Exception from HRESULT: 0x80131047).]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8946484
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +97
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
+258
Is is IIS6 related issue, or I'm missing something on the server?

Catching wcf-exceptions on iPhone with MonoTouch

i've been running into problems with exceptions thrown on the server and catching them on the client (iPhone).
The interface of the service has a method declared with the
[FaultContract(typeof(SecurityException))]
In the method I throw a SecurityException. On the phone I get the following error:
{System.Net.WebException: Error getting response stream (ReadDone1): ReceiveFailure
---> System.IO.IOException: EndRead failure
---> System.Net.Sockets.SocketException: Connection reset by peer
at System.Net.Sockets.Socket.EndReceive (IAsyncResult result) [0x0002d] in /Developer/MonoTouch/Source/mono/mcs/class/System/System.Net.Sockets/Socket_2_1.cs:1979
at System.Net.Sockets.NetworkStream.EndRead (IAsyncResult ar) [0x0002f] in /Developer/MonoTouch/Source/mono/mcs/class/System/System.Net.Sockets/NetworkStream.cs:338 --- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.EndRead (IAsyncResult ar) [0x0003d] in /Developer/MonoTouch/Source/mono/mcs/class/System/System.Net.Sockets/NetworkStream.cs:340
at System.Net.WebConnection.ReadDone (IAsyncResult result) [0x0002a] in /Developer/MonoTouch/Source/mono/mcs/class/System/System.Net/WebConnection.cs:429 --- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult) [0x0005e] in /Developer/MonoTouch/Source/mono/mcs/class/System/System.Net/HttpWebRequest.cs:852
at System.ServiceModel.Channels.HttpRequestChannel.GotResponse (IAsyncResult result) [0x0001f] in /Developer/MonoTouch/Source/mono/mcs/class/System.ServiceModel/System.ServiceModel.Channels/HttpRequestChannel.cs:218 }
Now I browsed through the questions about this, and it seems that this bug was reported already and fixed in a version of monotouch. I am using the latest (6.0.4) version of monotouch, but still experience the error.
Any ideas what I may be doing wrong?

MVC .NET + Server deployment issue

I have uploaded my database as well as files to server using FTP995. I am using the hosting server Go Daddy and they have trust level as Medium for all applications they support,
When I try to run my site, it is not even showing me a login page...
throwing exception
System.Security.Policy.PolicyException: Required permissions cannot be acquired.
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:
[PolicyException: Required permissions cannot be acquired.]
System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Boolean checkExecutionPermission) +7606579
System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Int32& securitySpecialFlags, Boolean checkExecutionPermission) +57
[FileLoadException: Could not load file or assembly 'Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)]
System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +43
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +127
System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +142
System.Reflection.Assembly.Load(String assemblyString) +28
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +46
[ConfigurationErrorsException: Could not load file or assembly 'Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +613
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +203
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +105
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178
System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath configPath, Boolean supportLocalization, String outputAssemblyName) +54
System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories, Boolean isDirectoryAllowed) +600
System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories) +128
System.Web.Compilation.BuildManager.CompileResourcesDirectory() +31
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +304
[HttpException (0x80004005): Could not load file or assembly 'Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)]
System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +58
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +512
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters) +729
[HttpException (0x80004005): Could not load file or assembly 'Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8894031
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +85
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +259
....................................................................................
After that I have put trust level = "Medium", <trust level="Medium" /> into my web.config and deployed again..
Then showing error as
Description: An error occurred during the processing of a
configuration file required to service this request. Please review the
specific error details below and modify your configuration file
appropriately.
Parser Error Message: This configuration section cannot be used at
this path. This happens when the site administrator has locked access
to this section using from an
inherited configuration file.
Source Error:
Line 157: <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
Line 158: </httpModules>
Line 159: <trust level="Full" />
Line 160: </system.web>
Line 161: <system.codedom>
Source File: D:\Hosting\7734726\html\web.config Line: 159
Read the error message.
[FileLoadException: Could not load file or assembly 'Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)]
Your trying to use an assembly in medium trust that won't work in medium trust. (Microsoft.ReportViewer.Common)
3 solutions
A) Ask your hosting provider to install the Microsoft.ReportViewer assemblies into the GAC (this may help), but they will probably be reluctant to do this
B)Find a new hosting environment with full trust or similar
or
B)Rewrite your application to not depend on that assembly.
If you are developing an application that will be deployed into a medium trust environment, you should of set trust="medium" while you were developing the application, so that you would of discovered any such issues during development instead of deployment.
Have you tried deploying your site directly from your visual studio publishing feature?
It may be that your FTP client is setting the wrong permissions.
If your reporting assembly can't run in media trust then go get a better hosting provider there are lots of them out there :)

Resources