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