Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: hosting webapi
I developed an Asp.net Wep api and it works fine when i run it from Visual studio.
 
But when i publish it to my hosting ,functions which i send my models dont work.But functions
 
which i directly send string work fine.Just get errors from functions which i send a class
 
that i created.What is the problem ?
 
Thanks.
 
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<Error>
<Message>An error has occurred.</Message>
<ExceptionMessage>
Schema specified is not valid. Errors: Models.Model.csdl(2,9) : warning 0005: Could not find schema information for the attribute 'Namespace'. Models.Model.csdl(2,36) : warning 0005: Could not find schema information for the attribute 'Alias'. Models.Model.csdl(2,49) : error 0005: The 'http://schemas.microsoft.com/ado/2009/02/edm/annotation:UseStrongSpatialTypes' attribute is not declared. Models.Model.csdl(2,2) : error 0010: The element Schema in namespace http://schemas.microsoft.com/ado/2009/11/edm was unexpected for the root element. The expected Schema in one of the following namespaces: http://schemas.microsoft.com/ado/2006/04/edm, http://schemas.microsoft.com/ado/2007/05/edm, http://schemas.microsoft.com/ado/2008/09/edm.
</ExceptionMessage>
<ExceptionType>System.Data.MetadataException</ExceptionType>
<StackTrace>
at System.Data.Metadata.Edm.EdmItemCollection.LoadItems(IEnumerable`1 xmlReaders, IEnumerable`1 sourceFilePaths, SchemaDataModelOption dataModelOption, DbProviderManifest providerManifest, ItemCollection itemCollection, Boolean throwOnError) at System.Data.Metadata.Edm.EdmItemCollection.Init(IEnumerable`1 xmlReaders, IEnumerable`1 filePaths, Boolean throwOnError) at System.Data.Metadata.Edm.EdmItemCollection..ctor(IEnumerable`1 xmlReaders, IEnumerable`1 filePaths) at System.Data.Metadata.Edm.MetadataCache.EdmMetadataEntry.LoadEdmItemCollection(MetadataArtifactLoader loader) at System.Data.Metadata.Edm.MetadataCache.EdmItemCollectionLoader.LoadItemCollection(EdmMetadataEntry entry) at System.Data.Metadata.Edm.MetadataCache.LoadItemCollection[T](IItemCollectionLoader`1 itemCollectionLoader, T entry) at System.Data.Metadata.Edm.MetadataCache.GetOrCreateEdmItemCollection(String cacheKey, MetadataArtifactLoader loader, Object& entryToken) at System.Data.EntityClient.EntityConnection.LoadEdmItemCollection(MetadataWorkspace workspace, MetadataArtifactLoader artifactLoader) at System.Data.EntityClient.EntityConnection.GetMetadataWorkspace(Boolean initializeAllCollections) at System.Data.Objects.ObjectContext.RetrieveMetadataWorkspaceFromConnection() at System.Data.Objects.ObjectContext..ctor(EntityConnection connection, Boolean isConnectionConstructor) at System.Data.Objects.ObjectContext..ctor(EntityConnection connection) at System.Data.Entity.Internal.InternalConnection.CreateObjectContextFromConnectionModel() at System.Data.Entity.Internal.LazyInternalConnection.CreateObjectContextFromConnectionModel() at System.Data.Entity.Internal.LazyInternalContext.InitializeContext() at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() at System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext() at System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider() at System.Linq.Queryable.Select[TSource,TResult](IQueryable`1 source, Expression`1 selector) at ModaGuest.Models.Provider.GuestProvider.GetAllItems() at lambda_method(Closure , Object , Object[] ) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass13.<GetExecutor>b__c(Object instance, Object[] methodParameters) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.<>c__DisplayClass5.<ExecuteAsync>b__4() at System.Threading.Tasks.TaskHelpers.RunSynchronously[TResult](Func`1 func, CancellationToken cancellationToken)
</StackTrace>
</Error>
Posted 13-Oct-12 12:45pm
Edited 13-Oct-12 23:40pm
v2
Comments
Wes Aday at 13-Oct-12 18:49pm
   
What errors do you get? What exceptions are thrown? What did you find when you examined your log files?
emrebeysungu at 13-Oct-12 18:51pm
   
It gives a xml output like this

An error has occurred.

i am new to webapi and i cant understand why it gives that.
Wes Aday at 13-Oct-12 19:11pm
   
Well it gives you that because an error occurred. The very first thing to realize is that other people in the forums cannot see your code, your project, your hosting company or anything else. All we know is what you tell us. You need to start debugging. Add some exception handling. Create some log files. Examine the error messages that you are getting.
emrebeysungu at 13-Oct-12 19:16pm
   
it doesnt give an exeption when i debug it from vs.İt works fine on visual studio.But not work well on hosting.
Wes Aday at 13-Oct-12 19:23pm
   
That is exactly why you need to do some exception handling, create some log files, debug your code. No one else but you can do that. "not work well" does not mean anything to anyone but you because only you can see what is going on with your code.
emrebeysungu at 14-Oct-12 5:41am
   
I updated question and put the exception there.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 298
1 Sergey Alexandrovich Kryukov 249
2 Yogesh Kumar Tyagi 165
3 ChauhanAjay 156
4 ClimerChinna 150
0 Sergey Alexandrovich Kryukov 6,205
1 OriginalGriff 5,333
2 CPallini 2,473
3 Richard MacCutchan 1,617
4 Abhinav S 1,530


Advertise | Privacy | Mobile
Web02 | 2.8.140814.1 | Last Updated 14 Oct 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100