c# - What do I do when my ASP.Net website is not allowed to perform some operations defined by the security policy of my web hosting service? -


my asp.net site coded in c# running fine on local system when uploaded files on httpdocs folder through plesk getting following error:

server error in '/' application. ________________________________________ compilation error description: error occurred during compilation of resource required service request. please review following specific error details , modify source code appropriately.   compiler error message: cs0246: type or namespace name 'xyz' not found (are missing using directive or assembly reference?)  source error:   line 1:  <%@ application language="c#" %> line 2:  <%@ import namespace="xyz" %> line 3:  <%@ import namespace="system.web.optimization" %> line 4:  <%@ import namespace="system.web.routing" %>  source file: g:\pleskvhosts\xyz.com\httpdocs\xyz\global.asax    line: 2   show detailed compiler output:   c:\windows\syswow64\inetsrv> "c:\windows\microsoft.net\framework\v4.0.30319\csc.exe" /t:library /utf8output /r:"c:\windows\microsoft.net\assembly\gac_msil\system.core\v4.0_4.0.0.0__b77a5c561934e089\system.core.dll" /r:"c:\windows\microsoft.net\assembly\gac_32\system.web\v4.0_4.0.0.0__b03f5f7f11d50a3a\system.web.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\system.web.webpages.deployment\v4.0_2.0.0.0__31bf3856ad364e35\system.web.webpages.deployment.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\microsoft.csharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\microsoft.csharp.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\system.web.services\v4.0_4.0.0.0__b03f5f7f11d50a3a\system.web.services.dll" /r:"c:\windows\microsoft.net\assembly\gac_32\system.enterpriseservices\v4.0_4.0.0.0__b03f5f7f11d50a3a\system.enterpriseservices.dll" /r:"c:\windows\microsoft.net\framework\v4.0.30319\mscorlib.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\system.web.extensions\v4.0_4.0.0.0__31bf3856ad364e35\system.web.extensions.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\system.workflowservices\v4.0_4.0.0.0__31bf3856ad364e35\system.workflowservices.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\system.drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\system.drawing.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\system.servicemodel\v4.0_4.0.0.0__b77a5c561934e089\system.servicemodel.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\system.servicemodel.web\v4.0_4.0.0.0__31bf3856ad364e35\system.servicemodel.web.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\system.web.dynamicdata\v4.0_4.0.0.0__31bf3856ad364e35\system.web.dynamicdata.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\system.activities\v4.0_4.0.0.0__31bf3856ad364e35\system.activities.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\system.xml\v4.0_4.0.0.0__b77a5c561934e089\system.xml.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\system.web.applicationservices\v4.0_4.0.0.0__31bf3856ad364e35\system.web.applicationservices.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\system.runtime.serialization\v4.0_4.0.0.0__b77a5c561934e089\system.runtime.serialization.dll" /r:"c:\windows\microsoft.net\assembly\gac_32\system.data\v4.0_4.0.0.0__b77a5c561934e089\system.data.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\system.identitymodel\v4.0_4.0.0.0__b77a5c561934e089\system.identitymodel.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\system.data.datasetextensions\v4.0_4.0.0.0__b77a5c561934e089\system.data.datasetextensions.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\system.servicemodel.activation\v4.0_4.0.0.0__31bf3856ad364e35\system.servicemodel.activation.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\system.xml.linq\v4.0_4.0.0.0__b77a5c561934e089\system.xml.linq.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\system\v4.0_4.0.0.0__b77a5c561934e089\system.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\system.configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\system.configuration.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\system.componentmodel.dataannotations\v4.0_4.0.0.0__31bf3856ad364e35\system.componentmodel.dataannotations.dll" /r:"c:\windows\microsoft.net\assembly\gac_msil\system.servicemodel.activities\v4.0_4.0.0.0__31bf3856ad364e35\system.servicemodel.activities.dll" /out:"c:\windows\microsoft.net\framework\v4.0.30319\temporary asp.net files\root\ba70df64\8ad7fdd9\app_global.asax.8gpjfmvi.dll" /debug- /optimize+ /w:4 /nowarn:1659;1699;1701;612;618 /warnaserror-  "c:\windows\microsoft.net\framework\v4.0.30319\temporary asp.net files\root\ba70df64\8ad7fdd9\app_global.asax.8gpjfmvi.0.cs" "c:\windows\microsoft.net\framework\v4.0.30319\temporary asp.net files\root\ba70df64\8ad7fdd9\app_global.asax.8gpjfmvi.1.cs"   microsoft (r) visual c# compiler version 4.0.30319.17929  microsoft (r) .net framework 4.5 copyright (c) microsoft corporation. rights reserved.  g:\pleskvhosts\xyz.com\httpdocs\xyz\global.asax(2,11): error cs0246: type or namespace name 'xyz' not found (are missing using directive or assembly reference?) g:\pleskvhosts\xyz.com\httpdocs\xyz\global.asax(3,22): error cs0234: type or namespace name 'optimization' not exist in namespace 'system.web' (are missing assembly reference?) g:\pleskvhosts\xyz.com\httpdocs\xyz\web.config(24,21): error cs0234: type or namespace name 'aspnet' not exist in namespace 'microsoft' (are missing assembly reference?)   ________________________________________ version information: microsoft .net framework version:4.0.30319; asp.net version:4.0.30319.18056 

any great.

## new error

****server error in '/' application.

security exception  description: application attempted perform operation not allowed security policy.  grant application required permission please contact system administrator or change application's trust level in configuration file.   exception details: system.security.securityexception: request permission of type 'system.security.permissions.reflectionpermission, mscorlib, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089' failed.  source error:   unhandled exception generated during execution of current web request. information regarding origin , location of exception can identified using exception stack trace below.  stack trace:    [securityexception: request permission of type 'system.security.permissions.reflectionpermission, mscorlib, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089' failed.]    system.delegate.delegateconstruct(object target, intptr slot) +0    owin.loader.defaultloader..ctor(func`3 next, func`2 activator, ienumerable`1 referencedassemblies) +69    microsoft.owin.host.systemweb.owinbuilder.getappstartup() +65    microsoft.owin.host.systemweb.owinhttpmodule.initializeblueprint() +28    system.threading.lazyinitializer.ensureinitializedcore(t& target, boolean& initialized, object& synclock, func`1 valuefactory) +115    microsoft.owin.host.systemweb.owinhttpmodule.init(httpapplication context) +106    system.web.httpapplication.registereventsubscriptionswithiis(intptr appcontext, httpcontext context, methodinfo[] handlers) +418    system.web.httpapplication.initspecial(httpapplicationstate state, methodinfo[] handlers, intptr appcontext, httpcontext context) +172    system.web.httpapplicationfactory.getspecialapplicationinstance(intptr appcontext, httpcontext context) +336    system.web.hosting.pipelineruntime.initializeapplication(intptr appcontext) +296  version information: microsoft .net framework version:4.0.30319; asp.net version:4.0.30319.18056**** 

you need right click on project, , select "publish". can either publish file system can alter web.config before upload godaddy, or set publish godaddy site. i'd choose file system approach. 1 step @ time.

as said in comments, "i added files , folders except solution file in projects folder", doesn't anything. execute that, needs run within visual studio ide. set of files supposed production use, must publish web project.


Comments