MVC 3 WCF Rest Service In Partial Trust - wcf

I have created a MVC 3 WCF Rest project using the tutorial described here. The only problem is that am able to run the project and access the rest api when the application is running at high trust level but when i change the trust level to medium i get the following when i access the service
[SecurityException: Request for the permission of type 'System.Configuration.ConfigurationPermission, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed.]
System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap, StackCrawlMark& stackMark) +31
System.Security.CodeAccessPermission.Demand() +46
System.ServiceModel.Description.ConfigLoader.CheckAccess(IConfigurationContextProviderInternal element) +12116253
System.ServiceModel.Description.ConfigLoader.LookupServiceBehaviors(String behaviorName, ContextInformation context) +12238226
System.ServiceModel.Description.ConfigLoader.LoadServiceDescription(ServiceHostBase host, ServiceDescription description, ServiceElement serviceElement, Action`1 addBaseAddress) +137
System.ServiceModel.ServiceHostBase.LoadConfigurationSectionInternal(ConfigLoader configLoader, ServiceDescription description, ServiceElement serviceSection) +67
System.ServiceModel.ServiceHostBase.ApplyConfiguration() +108
System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses) +192
System.ServiceModel.ServiceHost.InitializeDescription(Type serviceType, UriSchemeKeyedCollection baseAddresses) +49
System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses) +151
Microsoft.ApplicationServer.Http.HttpServiceHost..ctor(Type serviceType, Uri[] baseAddresses) +63
Microsoft.ApplicationServer.Http.Activation.HttpConfigurableServiceHost..ctor(Type serviceType, IHttpHostConfigurationBuilder builder, Uri[] baseAddresses) +40
Microsoft.ApplicationServer.Http.Activation.HttpConfigurableServiceHostFactory.CreateServiceHost(Type serviceType, Uri[] baseAddresses) +79
System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) +420
System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +1440
System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +44
System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +615
Please Help.. any ideas on how to solve this

The Web API project currently doesn't work in partial trust. PT support is planned, but it hasn't been implemented yet.

Related

entlib wcf integration is throwing exception when trying to pass argument by reference

using the Enterprise Library in a WCF service application, we encounter the following exception when we try to use validation on an operation that has arguments passed in by reference:
The operation contract:
Hubs GetRoute(
string sourceDepotId,
[NotNullValidator(MessageTemplate = "...")]
[RegexValidator("[a-zA-Z]", MessageTemplate = "...")]
[StringLengthValidator(2, RangeBoundaryType.Inclusive, 2, RangeBoundaryType.Inclusive, MessageTemplate = "...")]
string countryCode,
string zipCode,
DateTime shippingDate,
DateTime? deliveryDate,
ref RoutingCodes routingCode,
out string errorMessage);
The exception:
The type 'RoutingCodes&' may not be used as a type argument.
[ArgumentException: The type 'RoutingCodes&' may not be used as a type argument.]
System.RuntimeType.ThrowIfTypeNeverValidGenericArgument(RuntimeType type) +14240432
System.RuntimeType.SanityCheckGenericArguments(RuntimeType[] genericArguments, RuntimeType[] genericParamters) +57
System.RuntimeType.MakeGenericType(Type[] instantiation) +218
Microsoft.Practices.EnterpriseLibrary.Validation.ValidatorFactory.WrapAndInstrumentValidator(Validator validator, Type type) +87
Microsoft.Practices.EnterpriseLibrary.Validation.ValidatorFactory.FindOrCreateValidator(ValidatorCacheKey cacheKey, Func`3 wrapAndInstrument) +190
Microsoft.Practices.EnterpriseLibrary.Validation.ValidatorFactory.CreateValidator(Type targetType, String ruleset) +176
Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WCF.ValidationParameterInspector.CreateInputParameterValidator(ParameterInfo param, String ruleSet) +99
Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WCF.ValidationParameterInspector..ctor(OperationDescription operation, String ruleSet) +221
Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WCF.ValidationBehavior.ApplyDispatchBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint, DispatchRuntime dispatchRuntime) +161
System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(ServiceDescription description, ServiceHostBase serviceHost) +5106
System.ServiceModel.ServiceHostBase.InitializeRuntime() +85
System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout) +48
System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +293
System.ServiceModel.HostingManager.ActivateService(ServiceActivationInfo serviceActivationInfo, EventTraceActivity eventTraceActivity) +129
System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) +733
The type stated is a enumeration type. I know that you actually can pass arguments by ref in WCF and it works, as stated in the documentation.
Is this a bug in the Enterprise Library Validation Block or what are we doing wrong? How do you circumvent the exception besides not using the validation block?

MVC razor debug and release

I am developping an application in MVC 4 (.Net 4.5.2) using Visual Studio 2012. My application is to fill forms and save it into SQL database
What's happen is when I test on Localhost I don't have any error but when I publish on the server from time to time I have error message
Server Error in '/' Application.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: The compiler failed with error code 1.
Show Detailed Compiler Output:
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34248
it's been many days and I am not able to find what's going one, Sometimes I have this error and sometimes not, I am not able to see where is the problem, Any help please??
[HttpCompileException]: External component has thrown an exception.
at System.Web.Compilation.AssemblyBuilder.Compile() at
System.Web.Compilation.BuildProvidersCompiler.PerformBuild() at
System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath
virtualPath) at
System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath
virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean
allowBuildInPrecompile, Boolean throwIfNotFound, Boolean
ensureIsUpToDate) at
System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext
context, VirtualPath virtualPath, Boolean noBuild, Boolean
allowCrossApp, Boolean allowBuildInPrecompile, Boolean
throwIfNotFound, Boolean ensureIsUpToDate) at
System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath
virtualPath, HttpContext context, Boolean allowCrossApp, Boolean
throwIfNotFound) at
System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath
virtualPath, Type requiredBaseType, HttpContext context, Boolean
allowCrossApp) at
System.Web.WebPages.BuildManagerWrapper.CreateInstanceOfType[T](String
virtualPath) at
System.Web.WebPages.VirtualPathFactoryExtensions.CreateInstance[T](IVirtualPathFactory
factory, String virtualPath) at
System.Web.WebPages.VirtualPathFactoryManager.CreateInstanceOfType[T](String
virtualPath) at
System.Web.WebPages.VirtualPathFactoryExtensions.CreateInstance[T](IVirtualPathFactory
factory, String virtualPath) at
System.Web.WebPages.WebPageBase.CreatePageFromVirtualPath(String
virtualPath, HttpContextBase httpContext, Func`2 virtualPathExists,
DisplayModeProvider displayModeProvider, IDisplayMode displayMode)
at
System.Web.WebPages.WebPageBase.<>c__DisplayClass3.b__2(TextWriter
writer) at System.Web.WebPages.HelperResult.WriteTo(TextWriter
writer) at System.Web.WebPages.WebPageBase.Write(HelperResult
result) at System.Web.WebPages.WebPageBase.RenderSurrounding(String
partialViewName, Action 1 body) at
System.Web.WebPages.WebPageBase.PopContext() at
System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext
pageContext, TextWriter writer, WebPageRenderingBase startPage) at
System.Web.Mvc.RazorView.RenderView(ViewContext viewContext,
TextWriter writer, Object instance) at
System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext
viewContext, TextWriter writer) at
System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
at
System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext
controllerContext, ActionResult actionResult) at
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList
1 filters, Int32 filterIndex, ResultExecutingContext preContext,
ControllerContext controllerContext, ActionResult actionResult) at
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList
1 filters, Int32 filterIndex, ResultExecutingContext preContext,
ControllerContext controllerContext, ActionResult actionResult) at
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext
controllerContext, IList 1 filters, ActionResult actionResult) at
System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<>c__DisplayClass2b.b__1c()
at
System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.b__1e(IAsyncResult
asyncResult) at
System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult
1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase 1.End()
at
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult
asyncResult) at
System.Web.Mvc.Controller.b__1d(IAsyncResult
asyncResult, ExecuteCoreState innerState) at
System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid
1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase 1.End()
at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)
at System.Web.Mvc.Controller.b__15(IAsyncResult
asyncResult, Controller controller) at
System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid
1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase 1.End()
at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult)
at
System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult
asyncResult) at
System.Web.Mvc.MvcHandler.b__5(IAsyncResult
asyncResult, ProcessRequestState innerState) at
System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid
1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase 1.End()
at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult
asyncResult) at
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult
result) at
System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step,
Boolean& completedSynchronously)

How to make schemas unique in entity framework because of Error: Schema specified is not valid. Errors:0019 ..?

I have created one EDMX type file in my Models folder in Class Library Project. In that Class Library Project I created it as a MVC project with Controllers,Models,Views. In that Models Folder I created the EDMX file named as Model1.EDMX. When I run the project the following error is thrown. I dont know why it is happening. I have only one EDMX file in my project.
The Error is:
Server Error in '/' Application.
Schema specified is not valid. Errors:
Models.Model1.csdl(3,4) : error 0019: The EntityContainer name must be unique. An EntityContainer with the name 'PivotEntities' is already defined.
Models.Model1.csdl(8,4) : error 0019: Each type name in a schema must be unique. Type name 'PivotModel.Plan_S' was already defined.
Models.Model1.csdl(16,4) : error 0019: Each type name in a schema must be unique. Type name 'PivotModel.PlanDetail' was already defined.
Models.Model1.csdl(26,4) : error 0019: Each type name in a schema must be unique. Type name 'PivotModel.PlanFeature' was already defined.
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.Data.MetadataException: Schema specified is not valid. Errors:
Models.Model1.csdl(3,4) : error 0019: The EntityContainer name must be unique. An EntityContainer with the name 'PivotEntities' is already defined.
Models.Model1.csdl(8,4) : error 0019: Each type name in a schema must be unique. Type name 'PivotModel.Plan_S' was already defined.
Models.Model1.csdl(16,4) : error 0019: Each type name in a schema must be unique. Type name 'PivotModel.PlanDetail' was already defined.
Models.Model1.csdl(26,4) : error 0019: Each type name in a schema must be unique. Type name 'PivotModel.PlanFeature' was already defined.
Source Error:
Line 12: #if (!String.IsNullOrEmpty(Model.ConfigurationActionName))
Line 13: {
Line 14: #Html.Action(Model.ConfigurationActionName, Model.ConfigurationControllerName, Model.ConfigurationRouteValues);
Line 15: }
Line 16: else
Source File: c:\Users\rajesh.kannan\Downloads\nopcomnew\Presentation\Nop.Web\Administration\Views\Plugin\ConfigureMiscPlugin.cshtml Line: 14
Stack Trace:
[MetadataException: Schema specified is not valid. Errors:
Models.Model1.csdl(3,4) : error 0019: The EntityContainer name must be unique. An EntityContainer with the name 'PivotEntities' is already defined.
Models.Model1.csdl(8,4) : error 0019: Each type name in a schema must be unique. Type name 'PivotModel.Plan_S' was already defined.
Models.Model1.csdl(16,4) : error 0019: Each type name in a schema must be unique. Type name 'PivotModel.PlanDetail' was already defined.
Models.Model1.csdl(26,4) : error 0019: Each type name in a schema must be unique. Type name 'PivotModel.PlanFeature' was already defined.]
System.Data.Metadata.Edm.EdmItemCollection.LoadItems(IEnumerable`1 xmlReaders, IEnumerable`1 sourceFilePaths, SchemaDataModelOption dataModelOption, DbProviderManifest providerManifest, ItemCollection itemCollection, Boolean throwOnError) +8404337
System.Data.Metadata.Edm.EdmItemCollection.Init(IEnumerable`1 xmlReaders, IEnumerable`1 filePaths, Boolean throwOnError) +119
System.Data.Metadata.Edm.EdmItemCollection..ctor(IEnumerable`1 xmlReaders, IEnumerable`1 filePaths) +157
System.Data.Metadata.Edm.EdmMetadataEntry.LoadEdmItemCollection(MetadataArtifactLoader loader) +87
System.Data.Metadata.Edm.EdmItemCollectionLoader.LoadItemCollection(EdmMetadataEntry entry) +12
System.Data.Metadata.Edm.MetadataCache.LoadItemCollection(IItemCollectionLoader`1 itemCollectionLoader, T entry) +163
System.Data.Metadata.Edm.MetadataCache.GetOrCreateEdmItemCollection(String cacheKey, MetadataArtifactLoader loader, Object& entryToken) +132
System.Data.EntityClient.EntityConnection.LoadEdmItemCollection(MetadataWorkspace workspace, MetadataArtifactLoader artifactLoader) +103
System.Data.EntityClient.EntityConnection.GetMetadataWorkspace(Boolean initializeAllCollections) +377
System.Data.Objects.ObjectContext.RetrieveMetadataWorkspaceFromConnection() +25
System.Data.Objects.ObjectContext..ctor(EntityConnection connection, Boolean isConnectionConstructor) +165
System.Data.Objects.ObjectContext..ctor(EntityConnection connection) +61
System.Data.Entity.Internal.InternalConnection.CreateObjectContextFromConnectionModel() +128
System.Data.Entity.Internal.LazyInternalConnection.CreateObjectContextFromConnectionModel() +44
System.Data.Entity.Internal.LazyInternalContext.InitializeContext() +292
System.Data.Entity.Internal.InternalContext.Initialize() +31
System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +39
System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() +137
System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext() +38
System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider() +84
System.Linq.Queryable.Select(IQueryable`1 source, Expression`1 selector) +66
Nop.Plugin.Widgets.Settings.Controllers.EditController.Configure() +1300
lambda_method(Closure , ControllerBase , Object[] ) +101
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +59
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +435
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +60
System.Web.Mvc.Async.AsyncControllerActionInvoker.InvokeSynchronousActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +50
System.Web.Mvc.Async.<>c__DisplayClass42.<BeginInvokeSynchronousActionMethod>b__41() +75
System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +44
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +139
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +102
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +49
System.Web.Mvc.Async.<>c__DisplayClass39.<BeginInvokeActionMethodWithFilters>b__33() +126
System.Web.Mvc.Async.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() +323
System.Web.Mvc.Async.<>c__DisplayClass37.<BeginInvokeActionMethodWithFilters>b__36(IAsyncResult asyncResult) +44
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +139
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +102
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +50
System.Web.Mvc.Async.<>c__DisplayClass2a.<BeginInvokeAction>b__20() +68
System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +184
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +136
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +56
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +40
System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +40
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +47
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +151
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +59
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +40
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +44
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +47
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +151
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +59
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +40
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +39
System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +39
System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +45
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +47
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +151
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +59
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +40
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +40
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +38
System.Web.Mvc.<>c__DisplayClassa.<EndProcessRequest>b__9() +44
System.Web.Mvc.<>c__DisplayClass4.<Wrap>b__3() +34
System.Web.Mvc.ServerExecuteHttpHandlerWrapper.Wrap(Func`1 func) +69
System.Web.Mvc.ServerExecuteHttpHandlerWrapper.Wrap(Action action) +123
System.Web.Mvc.ServerExecuteHttpHandlerAsyncWrapper.EndProcessRequest(IAsyncResult result) +133
System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) +1464
[HttpException (0x80004005): Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'.]
System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) +3123183
System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage) +76
System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm) +28
System.Web.HttpServerUtilityWrapper.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm) +19
System.Web.Mvc.Html.ChildActionExtensions.ActionHelper(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues, TextWriter textWriter) +985
System.Web.Mvc.Html.ChildActionExtensions.Action(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues) +112
ASP._Page_Administration_Views_Plugin_ConfigureMiscPlugin_cshtml.Execute() in c:\Users\rajesh.kannan\Downloads\nopcomnew\Presentation\Nop.Web\Administration\Views\Plugin\ConfigureMiscPlugin.cshtml:14
System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +197
System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +119
System.Web.WebPages.StartPage.RunPage() +17
System.Web.WebPages.StartPage.ExecutePageHierarchy() +62
System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +76
System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +743
System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +382
System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +431
System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +39
System.Web.Mvc.<>c__DisplayClass1a.<InvokeActionResultWithFilters>b__17() +74
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +388
System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +72
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +388
System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +72
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +388
System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +72
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +388
System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +72
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +303
System.Web.Mvc.Async.<>c__DisplayClass2a.<BeginInvokeAction>b__20() +155
System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +184
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +136
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +56
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +40
System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +40
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +47
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +151
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +59
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +40
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +44
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +47
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +151
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +59
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +40
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +39
System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +39
System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +45
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +47
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +151
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +59
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +40
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +40
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +38
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9629296
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18034
What is the problem..?
Please help me on this issue.
Thanks in Advance.
I have solved the problem.
I had two class library projects and I created the EDMX file on both these projects, also they have the same Entity container Name as "PivotEntities" that is autogenerated by EDMX.
For eg. the two library projects named as Nop.Plugin.settings and Nop.Plugin.admin.
Cause of the error:
1.I added EDMX to the above projects and then the .dll of the Nop.Plugin.settings or added it's reference to the MVC main project.
2.Then deleted the dll of that project (Nop.Plugin.Settings) or it's reference from the main project or startup project.
3.Then I added the .dll of Nop.Plugin.admin project or it's reference to the MVC main project.
4.When I run the Main Mvc project, it throws the Error.
Solution:
1.I went to the Main Mvc project and clicked show all files.
2.So that it shows the hidden files in the references and there I found Nop.Plugin.settings.dll,Nop.Plugin.settings.pdb,Nop.Plugin.admin.dll and Nop.Plugin.admin.pdb.
3.Actually I have deleted the reference of the project Nop.Plugin.Setttings from the startup MVC project, but it is still residing in the startup project which causes the problem.
So now I need only the dll and pdb of Nop.Plugin.admin project and I deleted Nop.Plugin.settings.pdb and Nop.Plugin.settings.dll in the hidden BIN FOLDER.
:)
I also faced this problem, I just open the solution folder, manually deleted all dlls & pdb from bin folder and rebuild the solution. That solved the problem. Looks like this problem would have caused when I rearranged models across projects in the solution.
In our case the fix involved manually editing the edmx xml (open it as an xml file, not a diagram, using the "open with" option).
The automagical generator assumes the name "Model" for some wrappers if you do not provide your own. This then messes up your entire project if you do this for two or more entities. The sections you need to amend are these:
<Schema Namespace="Model.Store" (there is one in the file)
<EntityContainer Name="ModelStoreContainer"> (there are two in the file)
So, for example, you can change them to:
<Schema Namespace="WarehouseClientModel.Store"
<EntityContainer Name="WarehouseClientModelStoreContainer">
If you do this in all the edmx files where the unaltered Model keyword was used, you should have your problem solved.
Note that you should also provide your own namespace when generating the edmx, or alter it in the properties of the diagram view. Basically don't rely on any placeholder names provided by the wizzard.
For some people, please clear out your bin folder ON THE SERVER and try again. For me, I was getting this error when deploying to a server 2003 site. I had renamed a project, and the old assembly (.dll) was there (at the site, not my local bin - which I already cleaned). Since the connection string started with "res://*;...", it searched ALL assemblies (even non-loaded ones) for the resource and found duplicates (obviously).

Moving to https = Could not find a base address that matches scheme

I've created a simple WCF service in an existing web site. I've tested it and all seems well. I've now made the site require https but now when I visit the svc via a browser (or any client) I get --
Could not find a base address that matches scheme https for the endpoint with binding MetadataExchangeHttpsBinding. Registered base address schemes are [http].
Stack trace is as follows:
[InvalidOperationException: Could not find a base address that matches scheme https for the endpoint with binding MetadataExchangeHttpsBinding. Registered base address schemes are [http].]
System.ServiceModel.ServiceHostBase.MakeAbsoluteUri(Uri relativeOrAbsoluteUri, Binding binding, UriSchemeKeyedCollection baseAddresses) +12907656
System.ServiceModel.Description.ConfigLoader.LoadServiceDescription(ServiceHostBase host, ServiceDescription description, ServiceElement serviceElement, Action`1 addBaseAddress, Boolean skipHost) +12905313
System.ServiceModel.ServiceHostBase.LoadConfigurationSectionInternal(ConfigLoader configLoader, ServiceDescription description, ServiceElement serviceSection) +69
System.ServiceModel.ServiceHostBase.ApplyConfiguration() +178
Microsoft.IdentityModel.Protocols.WSTrust.WSTrustServiceHost.ApplyConfiguration() +46
System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses) +184
System.ServiceModel.ServiceHost.InitializeDescription(Type serviceType, UriSchemeKeyedCollection baseAddresses) +46
System.ServiceModel.ServiceHost.InitializeDescription(Object singletonInstance, UriSchemeKeyedCollection baseAddresses) +43
System.ServiceModel.ServiceHost..ctor(Object singletonInstance, Uri[] baseAddresses) +247
Microsoft.IdentityModel.Protocols.WSTrust.WSTrustServiceHost..ctor(WSTrustServiceContract serviceContract, Uri[] baseAddresses) +72
Microsoft.IdentityModel.Protocols.WSTrust.WSTrustServiceHost..ctor(SecurityTokenServiceConfiguration securityTokenServiceConfiguration, Uri[] baseAddresses) +70
Microsoft.IdentityModel.Protocols.WSTrust.WSTrustServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) +280
System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) +1434
System.ServiceModel.HostingManager.ActivateService(ServiceActivationInfo serviceActivationInfo, EventTraceActivity eventTraceActivity) +52
System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) +598
You need to change the configuration for the service so that the HTTPS enabled bindings are used. You may want to check out this blog post: http://weblogs.asp.net/srkirkland/archive/2008/02/20/wcf-bindings-needed-for-https.aspx
The suggested solution there is to define a custom binding within web.config/app.config and set its security mode to Transport:
<bindings>
<webHttpBinding>
<binding name="webBinding">
<security mode="Transport" />
</binding>
</webHttpBinding>
</bindings>
Then use this binding in the binding configuration for the endpoint:
<endpoint address="" behaviorConfiguration="..." binding="webHttpBinding" bindingConfiguration="webBinding" contract="..." />

ASP.Net MVC3 SQL Connection String

I am creating an app on APPHARBOR and I have an entity model for querying the SQL server. The following String is givving me error:
<add name="TraxzDBEntities"
connectionString="metadata=res://*/Models.DBModel.csdl|res://*/Models.DBModel.ssdl|res://*/Models.DBModel.msl;
provider=System.Data.SqlClient;
provider connection string='Data Source=d5d3955e-1183-4e10-8892-9f9d005af0a8.sqlserver.sequelizer.com;
User ID=**;
Password=**;
Initial Catalog=dbd5d3955e11834e1088929f9d005af0a8;Integrated Security=true;
MultipleActiveResultSets=True'"
providerName="System.Data.EntityClient" />
Here is the stack trace:
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.ArgumentException: Keyword not supported: 'server'.
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:
[ArgumentException: Keyword not supported: 'server'.]
System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey) +5110868
System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules) +98
System.Data.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString) +112
System.Data.EntityClient.EntityConnection..ctor(String connectionString) +77
System.Data.Entity.Internal.LazyInternalConnection.TryInitializeFromAppConfig(String name, ConnectionStringSettingsCollection connectionStrings) +309
System.Data.Entity.Internal.LazyInternalConnection.Initialize() +52
System.Data.Entity.Internal.LazyInternalConnection.get_ConnectionHasModel() +10
System.Data.Entity.Internal.LazyInternalContext.InitializeContext() +265
System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +18
System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() +62
System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext() +15
System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider() +37
System.Linq.Queryable.Where(IQueryable`1 source, Expression`1 predicate) +63
Traxz.Models.TraxzRepository.getListOfUserExerciseSessions(Guid userID) in d:\temp\lhvy3m2t.j0d\input\Traxz\Models\TraxzRepository.cs:77
Traxz.Controllers.ExerciseSessionController.listSessions(Nullable`1 page, Nullable`1 SessionID) in d:\temp\lhvy3m2t.j0d\input\Traxz\Controllers\ExerciseSessionController.cs:34
lambda_method(Closure , ControllerBase , Object[] ) +164
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +17
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +208
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27
System.Web.Mvc.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12() +55
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +263
System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +19
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +191
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +343
System.Web.Mvc.Controller.ExecuteCore() +116
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +97
System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10
System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +37
System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +21
System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +12
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +50
System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7
System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +60
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8963149
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184
I wasted numerous hours on this, and idk what is wrong.. Please help.
There is seemingly some other connect string being used here. Are you setting a connect string in code as well?
in your asp.net mvc project what are all the connect strings in the web.config? Just the above?
Search your entire solution for the word "server"
To add to Adam's suggestion (which is probably the answer), in your code snippet you don't have a ; after Password=** (maybe you do in the real code though). And you are also using both username and password and Integrated Security=true; which doesn't make sense to me since Integrated Security=true; means to use the currently logged on user.