Assembly must be registered in isolation error - plugins

I'm trying to load a custom workflow activity onto a crm server. I loaded the project onto the server and have been using the CRM Plug-in Registration Tool. The server is CRM2011 and thus supports .NET 4.0 activities. However, when I press the "Register" button (After the assembly has successfully loaded onto the Tool) the following error occurs:
`Unhandled Exception: System.ServiceModel.FaultException'1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Action failed for assembly 'ExecuteSQLJob, Version=1.0.0.0, Culture=neutral, PublicKeyToken=914788311ab3af7d': **Assembly must be registered in isolation**.
Detail: <OrganizationServiceFault xmlns="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<ErrorCode>-2147220906</ErrorCode>
<ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
<Message>Action failed for assembly 'ExecuteSQLJob, Version=1.0.0.0, Culture=neutral, PublicKeyToken=914788311ab3af7d': Assembly must be registered in isolation.</Message>
<Timestamp>2012-06-21T19:50:30.5216535Z</Timestamp>
<InnerFault>
<ErrorCode>-2147220906</ErrorCode>
<ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
<Message>Action failed for assembly 'ExecuteSQLJob, Version=1.0.0.0, Culture=neutral, PublicKeyToken=914788311ab3af7d': Assembly must be registered in isolation.</Message>
<Timestamp>2012-06-21T19:50:30.5216535Z</Timestamp>
<InnerFault i:nil="true" />
<TraceText i:nil="true" />
</InnerFault>
<TraceText i:nil="true" />
</OrganizationServiceFault>`
`Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)`
`Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Microsoft.Xrm.Sdk.IOrganizationService.Create(Entity entity)
at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.CreateCore(Entity entity)
at PluginRegistrationTool.RegistrationHelper.RegisterAssembly(CrmOrganization org, String pathToAssembly, CrmPluginAssembly assembly) in C:\hbs\apps\prod\hbs\downloads\crm2011\crm2011_MicrosoftDynamicsCRM2011SDK\sdk\tools\pluginregistration\RegistrationHelper.cs:line 227
at PluginRegistrationTool.PluginRegistrationForm.btnRegister_Click(Object sender, EventArgs e) in C:\hbs\apps\prod\hbs\downloads\crm2011\crm2011_MicrosoftDynamicsCRM2011SDK\sdk\tools\pluginregistration\PluginRegistrationForm.cs:line 452`
What does registering in isolation mean? Is it simply a matter of where the assembly is saved on the server or is it more complicated?
I've been following MSDN's tutorial's so far but can't find an explanation for this.
Thanks!

If you aren't a Deployment Administrator then you will need to register it in isolation mode.
http://blogs.msdn.com/b/crminthefield/archive/2011/08/17/error-message-assembly-must-be-registered-in-isolation-when-registering-plugins-in-microsoft-dynamics-crm-2011.aspx

Related

Unexpected exception chain after updating EF 6.x

I updated from EF6.2 to EF6.4 and I encountered this exception chain:
[VerificationException: Operation could destabilize the runtime.]
System.Data.Entity.Core.Metadata.Edm.FacetDescription.Validate(String declaringTypeName) +70
System.Data.Entity.Core.Metadata.Edm.FacetDescription..ctor(String facetName, EdmType facetType, Nullable`1 minValue, Nullable`1 maxValue, Object defaultValue, Boolean isConstant, String declaringTypeName) +103
System.Data.Entity.Core.SchemaObjectModel.FacetDescriptionElement.CreateAndValidateFacetDescription(String declaringTypeName) +115
System.Data.Entity.Core.SchemaObjectModel.TypeElement.ResolveTopLevelNames() +119
System.Data.Entity.Core.SchemaObjectModel.Schema.ResolveTopLevelNames() +206
System.Data.Entity.Core.SchemaObjectModel.Schema.Resolve() +16
System.Data.Entity.Core.SchemaObjectModel.SchemaManager.ParseAndValidate(IEnumerable`1 xmlReaders, IEnumerable`1 sourceFilePaths, SchemaDataModelOption dataModel, AttributeValueNotification providerNotification, AttributeValueNotification providerManifestTokenNotification, ProviderManifestNeeded providerManifestNeeded, IList`1& schemaCollection) +554
System.Data.Entity.Core.SchemaObjectModel.SchemaManager.ParseAndValidate(IEnumerable`1 xmlReaders, IEnumerable`1 sourceFilePaths, SchemaDataModelOption dataModel, DbProviderManifest providerManifest, IList`1& schemaCollection) +156
System.Data.Entity.Core.SchemaObjectModel.SchemaManager.LoadProviderManifest(XmlReader xmlReader, String location, Boolean checkForSystemNamespace, Schema& schema) +151
System.Data.Entity.Core.Common.DbXmlEnabledProviderManifest.Load(XmlReader reader) +75
System.Data.Entity.Core.Common.DbXmlEnabledProviderManifest..ctor(XmlReader reader) +116
System.Data.Entity.SqlServer.SqlProviderManifest..ctor(String manifestToken) +37
System.Data.Entity.SqlServer.<>c.<GetDbProviderManifest>b__29_0(String s) +25
System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory) +65
System.Data.Entity.SqlServer.SqlProviderServices.GetDbProviderManifest(String versionHint) +125
System.Data.Entity.Core.Common.DbProviderServices.GetProviderManifest(String manifestToken) +55
[ProviderIncompatibleException: The provider did not return a ProviderManifest instance.]
System.Data.Entity.Core.Common.DbProviderServices.GetProviderManifest(String manifestToken) +187
System.Data.Entity.Utilities.DbConnectionExtensions.GetProviderInfo(DbConnection connection, DbProviderManifest& providerManifest) +119
System.Data.Entity.DbModelBuilder.Build(DbConnection providerConnection) +43
System.Data.Entity.Internal.LazyInternalContext.CreateModel(LazyInternalContext internalContext) +159
System.Data.Entity.Internal.RetryLazy`2.GetValue(TInput input) +124
System.Data.Entity.Internal.LazyInternalContext.InitializeContext() +678
System.Data.Entity.Internal.InternalContext.Initialize() +20
Website.Db.Context..ctor(DbConnection Connection) in Context.vb:15
Website._Default.GetNewsItems() in Default.aspx.vb:13
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +92
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +191
System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +19
lambda_method(Closure , MethodInfo , Object , Object[] ) +39
System.Web.UI.WebControls.ModelDataSourceView.InvokeMethod(ModelDataSourceMethod method, Boolean isAsyncMethod) +326
System.Web.UI.WebControls.ModelDataSourceView.InvokeMethod(ModelDataSourceMethod method) +7
System.Web.UI.WebControls.ModelDataSourceView.GetSelectMethodResult(DataSourceSelectArguments arguments) +68
System.Web.UI.WebControls.ModelDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +14
System.Web.UI.WebControls.Repeater.GetData() +233
System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) +207
System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +62
System.Web.UI.WebControls.Repeater.DataBind() +131
System.Web.UI.WebControls.Repeater.EnsureDataBound() +114
System.Web.UI.WebControls.Repeater.OnPreRender(EventArgs e) +16
System.Web.UI.Control.PreRenderRecursiveInternal() +166
System.Web.UI.Control.PreRenderRecursiveInternal() +236
System.Web.UI.Control.PreRenderRecursiveInternal() +236
System.Web.UI.Control.PreRenderRecursiveInternal() +236
System.Web.UI.Control.PreRenderRecursiveInternal() +236
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4722
Here's line 15 of Context.vb:
Database.SetInitializer(New MigrateDatabaseToLatestVersion(Of Context, Migrations.Configuration))
A pretty straightforward database call, I'd say.
However, when I bumped back down to EF6.2, the error stopped.
I'm finding plenty of references to the individual exceptions here on SO, but nothing I've found so far quite fits the context of the combination of the three taken together with what the code is doing (general database access).
Do I need to alter my DAL code somehow in order to accommodate the EF6.4 update? Were there some breaking changes?
--EDIT--
Running locally under an explicit setting of Medium Trust, I get a different chain:
[PolicyException: Execution permission cannot be acquired.]
System.Security.CodeAccessSecurityEngine.TryResolveGrantSet(Evidence evidence, PermissionSet& grantSet) +14092083
System.Security.CodeAccessSecurityEngine.ResolveGrantSet(Evidence evidence, Int32& specialFlags, Boolean checkExecutionPermission) +60
[FileLoadException: Could not load file or assembly 'Microsoft.WebTools.BrowserLink.Runtime, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. PolicyException thrown. (Exception from HRESULT: 0x80131416)]
System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +232
System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark) +176
System.Reflection.Assembly.LoadFrom(String assemblyFile) +53
Microsoft.VisualStudio.Web.PageInspector.Runtime.Loader.RuntimeLoader.GetRuntimeAssemblyFromSetupConfiguration(Assembly& runtime) +27
Microsoft.VisualStudio.Web.PageInspector.Runtime.Loader.RuntimeLoader.LoadRuntime() +26
Microsoft.VisualStudio.Web.PageInspector.Runtime.Loader.RuntimeLoader.PreApplicationStart() +45
[InvalidOperationException: The pre-application start initialization method PreApplicationStart on type Microsoft.VisualStudio.Web.PageInspector.Runtime.Loader.RuntimeLoader threw an exception with the following error message: Could not load file or assembly 'Microsoft.WebTools.BrowserLink.Runtime, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. PolicyException thrown. (Exception from HRESULT: 0x80131416).]
System.Web.Compilation.BuildManager.InvokePreStartInitMethodsCore(ICollection`1 methods, Func`1 setHostingEnvironmentCultures) +919
System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +169
System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +172
System.Web.Compilation.BuildManager.ExecutePreAppStart() +172
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +854
[HttpException (0x80004005): The pre-application start initialization method PreApplicationStart on type Microsoft.VisualStudio.Web.PageInspector.Runtime.Loader.RuntimeLoader threw an exception with the following error message: Could not load file or assembly 'Microsoft.WebTools.BrowserLink.Runtime, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. PolicyException thrown. (Exception from HRESULT: 0x80131416).]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +532
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +111
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +724
This occurs under both EF6.2 and EF6.4.
If this is occurring on your remote deployment and not your local development environment after upgrading the EF version then I would suspect there is an issue with the deployment process.
Check the web.config in the deployed build to ensure that there are no EF-related runtime version dependency version overrides. (EntityFramework.dll and EntityFramework.SqlServer.dll)
Check the EntityFramework.dll assembly version between the deployed file on the remote server and your working local instance.
Copy the deployment from the remote server into a local folder, point IIS at it and then hook VS up running your project using Attach to Process on w3wp.exe. Set a breakpoint somewhere in the code and check that it remains a "hot" hit-able breakpoint and not an inactive one stating something along the lines of "The breakpoint will not currently be hit. The source line does not match..." This would indicate that the deployed code does not reflect a current, complete rebuild of what you are running in VS.
If you are using an automated build:
Check that dependency DLLs are not being checked in and that the build machine is actively resolving NuGet packages properly.
Check your references for EF, both before you upgrade the EF version (Source control revert all changes, use what was last built and deployed) Under the project explorer under References, select EntityFramework and check the path listed. It should be pointing to:
{Your solution folder}\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll
If it is pointing to anything like a \bin\debug etc. folder, remove the reference and repair to point at the NuGet package.
If NuGet packages folder is checked in, make sure this folder is complete and up to date in source control. When checking in nuget folders (as opposed to package version locking) I find this needs to be done from Explorer / TFS as normal VS checkins won't include them in pending changes. (unlike /bin folder changes if you accommodate them.) package folder updates can be skipped when initial checkins were made but then things like .ignore files are added/updated causing newer .dll files not to be updated.
Check for any stale or mismatched project files (.csproj/.vbproj) in your local environment vs. what is in source control. Often these can get flagged at some point as "Excluded Files" resulting in the automated build using out of date references.
Have a check through these and see if that identifies anything.

Trying to run EF Code first Migrate.exe tool on production environment failed

I'm using EntityFramework version 6.1.3.
I copied migrate.exe from EntityFramework version 6.1.3 package tool folder to bin folder of my website.
My web site is compiled and published to production environment with x86 CPU and target framework 4.5.1
I run the following command:
D:\Sites\MatrixPortal\bin>migrate.exe
d:\sites\MatrixPortal\bin\MatrixPortal.BL.dll
/startUpDirectory="d:\Sites\MatrixPortal\bin"
/startUpConfigurationFile="d:\Sites\MatrixPortal\Web.config"
and i get the following error:
ERROR: Could not load file or assembly
'd:\sites\MatrixPortal\bin\MatrixPortal.BL' or one of its
dependencies. The given assembly name or codebase was invalid.
(Exception from HRESULT: 0x80131047)
EDIT:
when i try this:
migrate MatrixPortal.BL.dll /verbose
i get other error:
System.BadImageFormatException: Could not load file or assembly
'MatrixPortal.BL' or one of its dependencies. An attempt was made to
load a program with an incorrect format. File name: 'MatrixPortal.BL'
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName,
String codeBase, Evidence assemblySecurity, RuntimeAssembly
locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder,
Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean
suppressSecurityChecks) at
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName
assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly,
StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean
throwOnFileNotFound, Boolean forIntrospection, Boolean
suppressSecurityChecks) at
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString,
Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr
pPrivHostBinder, Boolean forIntrospection) at
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
forIntrospection) at System.Reflection.Assembly.Load(String
assemblyString) at
System.Data.Entity.Migrations.Design.ToolingFacade.BaseRunner.LoadAssembly(String
name) at
System.Data.Entity.Migrations.Design.ToolingFacade.BaseRunner.FindConfiguration()
at
System.Data.Entity.Migrations.Design.ToolingFacade.UpdateRunner.Run()
at System.AppDomain.DoCallBack(CrossAppDomainDelegate
callBackDelegate) at
System.Data.Entity.Migrations.Console.Program.Run() at
System.Data.Entity.Migrations.Console.Program.Main(String[] args)
=== Pre-bind state information === LOG: DisplayName = MatrixPortal.BL (Partial) WRN: Partial binding information was supplied for an
assembly: WRN: Assembly Name: MatrixPortal.BL | Domain ID: 2 WRN: A
partial bind occurs when only part of the assembly display name is
provided. WRN: This might result in the binder loading an incorrect
assembly. WRN: It is recommended to provide a fully specified textual
identity for the assembly, WRN: that consists of the simple name,
version, culture, and public key token. WRN: See whitepaper
http://go.microsoft.com/fwlink/?LinkId=109270 for more information and
common solutions to this issue. LOG: Appbase =
file:///D:/Sites/MatrixPortal/bin/ LOG: Initial PrivatePath = NULL
Calling assembly : EntityFramework, Version=6.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089.
=== LOG: This bind starts in default load context. LOG: Using application configuration file:
C:\Users\guy_b\AppData\Local\Temp\tmpC402.tmp LOG: Using host
configuration file: LOG: Using machine configuration file from
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private,
custom, partial, or location-based assembly bind). LOG: Attempting
download of new URL
file:///D:/Sites/MatrixPortal/bin/MatrixPortal.BL.DLL. ERR: Failed to
complete setup of assembly (hr = 0x8007000b). Probing terminated.
ERROR: Could not load file or assembly 'MatrixPortal.BL' or one of its
dependencies. An attempt was made to load a program with an incorrect
format.
also tried this:
http://www.azurefromthetrenches.com/command-line-entity-framework-code-first-migrations/
and created a file called Redirect.config with the following content:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0-6.1.3" newVersion="6.1.3" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
but got the same error as above :(
In my case I got the error because I wrote migrate .\MyAssembly.dll instead of migrate MyAssembly.dll.
See Common Problems documentation section.
SOLVED!
I've Published the web site project with x86 target cpu, and apparently it wasn't really x86, i don't know why, maybe a bug?
After changing Publish to any cpu it worked. i was able to run migrate.exe without an error using the following arguments:
migrate.exe MatrixPortal.BL.dll /verbose /startUpDataDirectory="D:\Sites\MatrixPortal" /startUpConfigurationFile="D:\Sites\MatrixPortal\Web.config"

CRM 2011/2013 Workflow or Plugin gives "Access Denied. Reference number for administrators or support"

since i dint found any forum here goes the solution for this problem, this goes for people how work with also ADXSTUDIO, ADXSTUDIO have several plugins and workflows that is registed as to run as Calling User, and for so, we sometimes need to change this permissions.
"Access Denied. Reference number for administrators or support: #xxxxxx"
Plugin Trace:
[Microsoft.Xrm.Sdk.Workflow: Microsoft.Xrm.Sdk.Workflow.Activities.CreateEntity]
[CreateStep1: Create Record as Activity]
[Adxstudio.Xrm.Plugins.Productivity: Adxstudio.Xrm.Plugins.Productivity.Utilities.IdentifierRequestPlugin]
[e0ebe1fa-b46e-e111-a0dc-00155d03a708: Adxstudio.Xrm.Plugins.Productivity.Utilities.IdentifierRequestPlugin: Create of adx_identifierrequest]
Error Message:
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Access Denied. Reference number for administrators or support: #536DBC1EDetail:
<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
<ErrorCode>-2147187707</ErrorCode>
<ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
<Message>Access Denied. Reference number for administrators or support: #536DBC1E</Message>
<Timestamp>2014-05-01T14:35:38.9130605Z</Timestamp>
<InnerFault i:nil="true" />
<TraceText>[Microsoft.Xrm.Sdk.Workflow: Microsoft.Xrm.Sdk.Workflow.Activities.CreateEntity]
[CreateStep1: Create Record as Activity]
[Adxstudio.Xrm.Plugins.Productivity: Adxstudio.Xrm.Plugins.Productivity.Utilities.IdentifierRequestPlugin]
[e0ebe1fa-b46e-e111-a0dc-00155d03a708: Adxstudio.Xrm.Plugins.Productivity.Utilities.IdentifierRequestPlugin: Create of adx_identifierrequest]
</TraceText>
</OrganizationServiceFault>
at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.Create(Entity entity, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType)
at Microsoft.Crm.Extensibility.InprocessServiceProxy.CreateCore(Entity entity)
at Microsoft.Crm.Workflow.Services.CreateActivityService.<>c__DisplayClass1.<CreateInternal>b__0(IOrganizationService sdkService)
at Microsoft.Crm.Workflow.Services.ActivityServiceBase.ExecuteInTransactedContext(ActivityDelegate activityDelegate)
at Microsoft.Crm.Workflow.Services.CreateActivityService.CreateInternal(Entity entity, String StepId)
at Microsoft.Crm.Workflow.Services.CreateActivityService.ExecuteInternal(ActivityContext executionContext, CreateEntity createEntity)
at Microsoft.Crm.Workflow.Services.CreateActivityService.Execute(ActivityContext executionContext, CreateEntity createEntity)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
Solution (This works for any plugin or workflow where gives the access error) :

Azure deployment with 2 websites is cycling for a long time

I'm deploying with azure in visual studio 2010 and I have this problem when I have 2 websites.
With only 1 website the deploy runs sucessfully.
Help!!!!!!!!!
<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="RIS2048.ConsultaClick.Web.Azure1" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition">
<WebRole name="RIS2048.ConsultaClick.Web" vmsize="Small">
<Sites>
<Site name="PT" physicalDirectory="..\RIS2048.ConsultaClick.WWWPacientes">
<VirtualDirectory name="images" physicalDirectory="..\RIS2048.ConsultaClick.WWWPacientes\imgpt" />
<Bindings>
<Binding name="Endpoint1" endpointName="Endpoint1" hostHeader="pt.consultaclick.com" />
</Bindings>
</Site>
<Site name="RO" physicalDirectory="..\RIS2048.ConsultaClick.WWWPacientes">
<VirtualDirectory name="images" physicalDirectory="..\RIS2048.ConsultaClick.WWWPacientes\imgro" />
<Bindings>
<Binding name="Endpoint1" endpointName="Endpoint1" hostHeader="ro.consultaclick.com" />
</Bindings>
</Site>
</Sites>
<Endpoints>
<InternalEndpoint name="Endpoint1" protocol="http" port="80" />
</Endpoints>
<Imports>
<Import moduleName="Diagnostics" />
<Import moduleName="RemoteAccess" />
<Import moduleName="RemoteForwarder" />
</Imports>
</WebRole>
</ServiceDefinition>
After using intellitrace and remote desktop found the following in event viewer:
https://picasaweb.google.com/112383217404623421937/Dropbox#
In system section:
NtpClient was unable to set a manual peer to use as a time source because of DNS resolution error on 'time.windows.com,0x9'. NtpClient will try again in 15 minutes and double the reattempt interval
thereafter. The error was: No such host is known. (0x80072AF9)
VSP rejected attempt to use protocol version '3.2'.
The application '/' belonging to site '1' has an invalid AppPoolId 'DefaultAppPool' set. Therefore, the application will be ignored.
Site 1 was disabled because the root application defined for the site is invalid. See the previous event log message for information about why the root application is invalid.
Error communicating with the Spooler system service. Open the Services snap-in and confirm that the Print Spooler service is running.
The SLUINotify service terminated with the following error:
The specified module could not be found.
Azure section:
An unhandled exception occurred. Process ID: 3024
Process Name: WaIISHost
Thread ID: 1
AppDomain Unhandled Exception
Exception: E:\sitesroot\3
Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at IConfigurator.Deploy(String roleId, WebAppModel webAppModelPath, String roleRootDirectory, String sitesDestinationRootDirectory, String diagnosticsRootDirectory, String roleGuid, Dictionary2 globalEnvironment)
at ConfiguratorClient.Deploy(String roleId, WebAppModel webAppModelPath, String roleRootDirectory, String sitesDestinationRootDirectory, String diagnosticsRootDirectory, String roleGuid, Dictionary2 globalEnvironment)
at Microsoft.WindowsAzure.Hosts.WaIISHost.Program.Main(String[] args)
You should try to figure out what is causing the issue. Could you try configuring Remote Desktop and connect to one of your instance? Verify the Event Viewer to see if you have any errors or warnings in the Application log.
In these situations I often experienced a disconnect from the Remote Desktop session because of the cycling, but you should still try it and with a little luck you'll be able to find out the cause of the issue.
Alternatively you could try configuring the DiagnosticsManager to ship the Windows logs ever 1 minute to track down the issue.
The problem was that I was parsing the request on host header (pt.example.com) and accessing from cck.azure.com so the host header was invalid (I should access from pt.example.com and have a domain that I bought redirecting pt.example.com to cck.azure.com).......

iis7.5 mvc2 404 and 500.24 error

This is my first time deploying an MVC2 app (.NET4) on IIS7.5. I'm using StructureMap and Fluent NHibernate, and everything runs fine locally using integrated security. The application does render the first page (controllername/pagename), but throws an error on the next one which is (controllername/pagename/id).
I have ran %windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -ir.
HttpRedirection and HttpExceptions are enabled.
This is the 404 error from View Source:
[HttpException]: The controller for path '/conrollername/pagename/1' was not found or does not implement IController.
at System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType)
at CustomerResponses.Infrastructure.StructureMapControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType) in C:\Apps\Development Source\CustomerResponsesApplication\trunk\CustomerResponses\Infrastructure\StructureMapControllerFactory.cs:line 19
at System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName)
at System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory)
at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Another link gives me 500.24 error:
HTTP Error 500.24 - Internal Server Error
An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.
Does anyone have any ideas?
Thanks
Part on Web.Config
system.webServer - section
<validation validateIntegratedModeConfiguration="false"/>
<modules runAllManagedModulesForAllRequests="true"/>
<handlers>
<add name="UrlRoutingHandler"
preCondition="integratedMode"
verb="*" path="UrlRouting.axd"
type="System.Web.HttpForbiddenHandler,
System.Web, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a" />
</handlers>
<!--<handlers>
<remove name="MvcHttpHandler" />
<add name="MvcHttpHandler" preCondition="integratedMode" verb="*" path="*.mvc" type="System.Web.Mvc.MvcHttpHandler" />
<add name="UrlRoutingHandler" preCondition="integratedMode" verb="*" path="UrlRouting.axd" type="System.Web.HttpForbiddenHandler, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</handlers>-->
Global.asax
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("{resource}.aspx/{*pathInfo}");
routes.IgnoreRoute("{resource}.gif/{*pathInfo}");
routes.IgnoreRoute("{*datepick}",
new { datepick = #"(.*/)?jquery.datepick.css(/.*)?" });
// ignore datepick.css file
routes.IgnoreRoute("{*favicon}",
new { favicon = #"(.*/)?favicon.ico(/.*)?" });
routes.IgnoreRoute("{*chevron}",
new { chevron = #"(.*/)?Images/Chevron.gif(/.*)?" });
routes.IgnoreRoute("{*iconhome}",
new { iconhome = #"(.*/)?Images/IconHome.gif(/.*)?" });
routes.MapRoute("test", "testroute",
new { controller = "compresponses", action = "list" });
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new {
controller = "compresponses",
action = "list",
id = UrlParameter.Optional
} // Parameter defaults
);
One of the problems is:
your web.config file contains too much information.
IIS 7.5 when runs in intergated mode does not require any additional settings.
I would recomend to create blank mvc application and publish it onto webserver.
also i have seen
the error :
[HttpException]: The controller for path '/conrollername/pagename/1' was not found or does not implement IController. at System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType) at
where it says that the dll either system.web or system.web.mvc is not referenced from project.
My solution( might be not the best) but is: Right button on project where the error occured and copy the dlls local and this should help with the error.
as for error:
Another link gives me 500.24 error: HTTP Error 500.24 - Internal Server Error An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.
the best is to have iis console installed and open the project using iis console.
Change your application pool properties to:
.NET Framework Version
-- .NET Framework *version*
Pipeline Mode
-- Classic