Avatar billede maze- Nybegynder
12. marts 2008 - 13:30 Der er 1 kommentar

ADO.NET Dataservice hosting på IIS

Hej alle eksperter!

Jeg har lige lavet en dataservice som jeg prøver at hoste på en ekstern IIS. Så får jeg følgende fejl.

Exception has been thrown by the target of an invocation.
  at System.RuntimeMethodHandle._InvokeConstructor(Object[] args, SignatureStruct& signature, IntPtr declaringType)
  at System.RuntimeMethodHandle.InvokeConstructor(Object[] args, SignatureStruct signature, RuntimeTypeHandle declaringType)
  at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
  at Microsoft.Data.Web.Providers.BaseServiceProvider.CreateNewInstance(Type type)
  at Microsoft.Data.Web.Providers.ObjectContextServiceProvider.get_ObjectContext()
  at Microsoft.Data.Web.Providers.ObjectContextServiceProvider.PopulateMetadata(Dictionary`2 knownTypes, Dictionary`2 entitySets)
  at Microsoft.Data.Web.Providers.BaseServiceProvider.PopulateMetadata()
  at Microsoft.Data.Web.WebDataService`1.CreateProvider(Type dataServiceType)
  at Microsoft.Data.Web.WebDataService`1.CreateProviderForRequest()
  at Microsoft.Data.Web.WebDataService`1.ProcessIncomingRequest()
The given connection string is not valid because it contains insufficient mapping or metadata information.
Parameter name: connectionString
  at System.Data.Objects.ObjectContext..ctor(EntityConnection connection, Boolean isConnectionConstructor)
  at System.Data.Objects.ObjectContext..ctor(String connectionString, String defaultContainerName)
  at GASDB.Entities..ctor() in e:\dokumenter\Visual Studio 2008\Projects\GASWebDataService\GASWebDataService\GASDB.Designer.cs:line 336
Unable to determine application context. The ASP.NET application path could not be resolved.
  at System.Data.Metadata.Edm.MetadataArtifactLoader.MapWebPath(String path)
  at System.Data.Metadata.Edm.MetadataArtifactLoader.NormalizeFilePaths(String path)
  at System.Data.Metadata.Edm.MetadataArtifactLoader.Create(String path, ExtensionCheck extensionCheck, String validExtension, ICollection`1 uriRegistry)
  at System.Data.EntityClient.EntityConnection.SplitPaths(String paths)
  at System.Data.EntityClient.EntityConnection.CreateMetadataWorkspace(DbConnectionOptions connectionOptions, DbConnection storeConnection, EdmMetadataEntry& edmMetadataEntry, StoreMetadataEntry& storeMetadataEntry)
  at System.Data.EntityClient.EntityConnection.GetMetadataWorkspace()
  at System.Data.Objects.ObjectContext..ctor(EntityConnection connection, Boolean isConnectionConstructor)
Exception has been thrown by the target of an invocation.
  at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
  at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
  at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
  at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
  at System.Data.Metadata.Edm.MetadataArtifactLoader.MapPath(MethodInfo mi, Object instance, Object[] parameters)
  at System.Data.Metadata.Edm.MetadataArtifactLoader.MapWebPath(String path)
Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
  at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
  at System.Security.CodeAccessPermission.Demand()
  at System.Web.Hosting.HostingEnvironment.MapPath(VirtualPath virtualPath)
  at System.Web.Hosting.HostingEnvironment.MapPath(String virtualPath)

Når jeg kører det fra Visual Studio virker det fint. Nogen der har en idé om hvad problemet er?

Så det er når jeg publisher det til en IIS fejlen kommer.

Håber i kan hjælpe!

Hilsen
Mads
Avatar billede maze- Nybegynder
12. marts 2008 - 14:40 #1
Hej alle.

Fandt ud af det slet ikke var i forbindelse med dataservice, men et gennemgående problem.

Security Exception
Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

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:


[SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
  System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
  System.Security.CodeAccessPermission.Demand() +59
  System.Web.HttpRequest.MapPath(VirtualPath virtualPath, VirtualPath baseVirtualDir, Boolean allowCrossAppMapping) +156
  System.Web.HttpRequest.MapPath(VirtualPath virtualPath) +30
  System.Web.HttpServerUtility.Execute(String path, TextWriter writer, Boolean preserveForm) +208
  System.Web.HttpServerUtility.Transfer(String path, Boolean preserveForm) +56
  GASWeb.Business.Portal.ModuleHttpHandler.ProcessRequest(HttpContext context) in D:\Afgangsprojekt\Project\GASWebPrototype\GASWeb.Business\Portal\ModuleHttpHandler.cs:50
  System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +358
  System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64


Så det er åbenbart en eller anden sikkerhedsinstilling på IIS jeg ikke fatter at sætte rigtig op, nogen der har en idé om hvor fejlen kan være?
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
IT-kurser om Microsoft 365, sikkerhed, personlig vækst, udvikling, digital markedsføring, grafisk design, SAP og forretningsanalyse.

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester



IT-JOB

Danske Commodities A/S

Data technician trainee

Cognizant Technology Solutions Denmark ApS

Test Manager