How do I make my application run in Full Trust mode - .NET 4.0 Console Application - security

We are having an issue with a command line (batch) application and full/partial trust.
Our previous release (version number 7.13.0.63) works fine, however, when we install the new version (7.13.0.249) we get a “That assembly does not allow partially trusted callers.”
Exception:
Stack Trace (edited):
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache)
at System.Activator.CreateInstance[T]()
at <Company>.Service.<Product>.Proxy.Factories.ControllerProxyFactory.Create[T]()
<Stack Trace that leads to creation of a WCF client> ...
Inner Exception:
An error occurred creating the configuration section handler for system.serviceModel/behaviors: That assembly does not allow partially trusted callers. (C:\Program Files (x86)\InsuranceLine\ListLoader\InsuranceLine.ListLoader.Launcher.exe.Config line 53)
Stack Trace:
at System.Configuration.BaseConfigurationRecord.EvaluateOne(String[] keys, SectionInput input, Boolean isTrusted, FactoryRecord factoryRecord, SectionRecordsectionRecord, Object parentResult)
at System.Configuration.BaseConfigurationRecord.Evaluate(FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult, Boolean getLkg, Boolean getRuntimeObject, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String sectionName)
at System.Configuration.ConfigurationManager.GetSection(String sectionName)
at System.ServiceModel.Activation.AspNetEnvironment.UnsafeGetSectionFromConfigurationManager(String sectionPath)
at System.ServiceModel.Activation.AspNetEnvironment.UnsafeGetConfigurationSection(String sectionPath)
at System.ServiceModel.Configuration.ConfigurationHelpers.UnsafeGetAssociatedSection(ContextInformation evalContext, String sectionPath)
at System.ServiceModel.Description.ConfigLoader.LookupChannel(ContextInformation configurationContext, String configurationName, ContractDescription contract, EndpointAddress address, Boolean wildcard, Boolean useChannelElementKind, ServiceEndpoint& serviceEndpoint)
at System.ServiceModel.ChannelFactory.InitializeEndpoint(String configurationName, EndpointAddress address)
at System.ServiceModel.ChannelFactory`1..ctor(String endpointConfigurationName, EndpointAddress remoteAddress)
<Stack Trace that determines the correct WCF factory to create>
Inner Exception:
That assembly does not allow partially trusted callers.
Stack Trace:
at System.Security.CodeAccessSecurityEngine.ThrowSecurityException(RuntimeAssembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandleInternal rmh, SecurityAction action, Object demand, IPermission permThatFailed)
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.ServiceModel.Configuration.ServiceModelExtensionCollectionElement`1.CreateNewSection(String name)
at System.ServiceModel.Configuration.ServiceModelExtensionCollectionElement`1.DeserializeElementCore(XmlReader reader)
at System.ServiceModel.Configuration.ServiceModelExtensionCollectionElement`1.DeserializeElement(XmlReader reader, Boolean serializeCollectionKey)
at System.Configuration.ConfigurationElementCollection.OnDeserializeUnrecognizedElement(String elementName, XmlReader reader)
at System.Configuration.ConfigurationElement.DeserializeElement(XmlReader reader, Boolean serializeCollectionKey)
at System.Configuration.ConfigurationElement.DeserializeElement(XmlReader reader, Boolean serializeCollectionKey)
at System.Configuration.ConfigurationSection.DeserializeSection(XmlReader reader)
at System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory.CreateSectionImpl(RuntimeConfigurationRecord configRecord, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentConfig, ConfigXmlReader reader)
at System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory.CreateSectionWithRestrictedPermissions(RuntimeConfigurationRecord configRecord, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentConfig, ConfigXmlReader reader)
at System.Configuration.RuntimeConfigurationRecord.CreateSection(Boolean inputIsTrusted, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentConfig, ConfigXmlReader reader)
at System.Configuration.BaseConfigurationRecord.CallCreateSection(Boolean inputIsTrusted, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentConfig, ConfigXmlReader reader, String filename, Int32 line)
In regards to the process that we use to deploy our product, we use a MSI created through WiX. We perform the following steps:
Uninstall the previous version of the product
Copy the msi from a network share (same share for both versions, different subdirectory based on versions)
Install the msi as an administrator
This installs to C:\Program Files (x86)
The only changes between the 2 versions are:
The inclusion of an extra AppSettings item in the app.config file (myapp.exe.config) to specify a transaction timeout
Changing a “using new TransactionScope()” to “using New TransactionScope(TransactionScopeOption.Required, timeoutValueReadFromAppSettingsAndStoredInLocalVariable)”
The creation of the WCF client is outside of this Transaction Scope.
Additional Information:
The exception does not occur in any of our dev/staging/qa/pre production environments. It only happens on our production application server.
We are in the process of rolling out Windows 7 to our organisation, so it is possible that enterprise policy has changed.
The application targets the .Net Framework 4.0
If we uninstall the new version, and reinstall the old version (including the copy from network share) the old version works fine still
The machine being installed to is Windows Server 2008 R2
The machine is a Virtual Machine that is hosted in a VMWare environment
Ideally I’d like to know a few things:
How to alter the assembly (or set permissions after install) so that it can run in a full trust mode
How to replicate the issue in dev/staging/QA environments
Explicitly "untrusting" the assembly might reproduce it, but I want to reproduce it in the same way as production so that when it is installed it is identified as untrusted, it seems to me that the way to do this would have something to do with “untrusting” the network share I copy the MSI from, or possibly “untrusting” the publisher information in the MSI/assembly.
How to configure the production application server/security policy so that future installs are fully trusted (Answering item 2 will most likely answer this)
Thanks

This is really quite odd given that the .NET 4.0 CLR does not apply CAS security policy by default, so you would actually have to make a some sort of (hopefully) deliberate change to get a locally installed command line application to be partially trusted.
Before trying to dig too deep for potential causes, could you please verify the following:
Does your app.config file contain a NetFx40_LegacySecurityPolicy element?
Is your application actually running under the 4.0 CLR on the problem machine? (If you can't modify the source to output the value of Environment.Version before the exception is thrown, Process Explorer should allow you to determine which CLR version(s) are running in your process.)

Related

Opening Office Application Error: Microsoft.Office.Interop.Excel / Microsoft.Office.Interop.Word

I am hoping that someone can give a little insight and/or instance.
I am experiencing an error trying to create an instance of an Excel or Word application. The application I am working on is using interop assemblies to manipulate Excel and Word. In both cases, I have been successful in doing so in the past, the problems/errors began only recently. I've noticed multiple posts about similar error messages and have looked through them, but none addressed a similar issue or provided relevant insights.
In attempting to create an instance of Excel, the resulting error is similar to the following:
{System.Runtime.InteropServices.COMException (0x80080005): Retrieving
the COM class factory for component with CLSID
{00024500-0000-0000-C000-000000000046} failed due to the following
error: 80080005 Server execution failed (Exception from HRESULT:
0x80080005 (CO_E_SERVER_EXEC_FAILURE)). at
System.Runtime.Remoting.RemotingServices.AllocateUninitializedObject(RuntimeType
objectType) at
System.Runtime.Remoting.Activation.ActivationServices.CreateInstance(RuntimeType
serverType) at
System.Runtime.Remoting.Activation.ActivationServices.IsCurrentContextOK(RuntimeType
serverType, Object[] props, Boolean bNewObj) at
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean
publicOnly, Boolean noCheck, Boolean& canBeCached,
RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) at
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean
skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) at
System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly,
Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, Boolean nonPublic) at
System.Activator.CreateInstance(Type type)
I am encountering a similar error when trying to create an instance of Word. Again, my code has been doing this with no problem, until recently.
I'm thinking this may have started with possibly with recent upgrades to the Office instance on my development machine.
The references for both Interop assemblies (Microsoft.Office.Interop.Excel and Microsoft.Office.Interop.Word) associated with my project have Embed Interop Types set to TRUE)
If I am interpreting the error text correctly, the code is looking for the typelib/class id (i.e., {00024500-0000-0000-C000-000000000046}) to be in the current machine's registry and cannot find it. I did search the \HKEY_CLASSES_ROOT\TypeLib folder in the registry and did not see it. My question would be, why is it looking for that particular id? Of course, I may be completely out in left field on this line of reasoning.
Since I am seeing similar effects in both contexts, I have to believe that the issue's cause here is on the Office level, rather than either application. To the best of my knowledge, no change was made to the code or the Interop assembly references in the project.
Any insights and/or suggestions would, of course, be greatly appreciated.
I am using VS 2017 (64-bit) on Windows 10.

WindowsIdentity.Impersonate throws ''Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))' after April 2018 (1803) update

Our installer app uses the following code to verify service account permissions:
try
{
using (svcIdentity.Impersonate())
{
using (SqlConnection conn = new SqlConnection(builder.ConnectionString)) // <<<
{
conn.Open();
...
Omitted for brevity:
The svcIdentity WindowsIdentity is obtained by using the Win32 LSA LogonUser function in advapi32.dll and LOGON32_LOGON_SERVICE.
builder is a SqlConnectionStringBuilder that builds a connectionstring to a local SQL Server database.
Targeting .Net Framework 4.6.
The app runs elevated (requestedExecutionLevel level='requireAdministrator' in the app.manifest).
This code ran flawless until Windows 10 version 1803 (April 2018 update). Since then, the SqlConnection constructor (marked <<<) throws an exception:
The type initializer for 'System.Data.SqlClient.SqlConnection' threw an exception.
The inner exception provides more insight:
Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
Stack trace:
at System.Security.Policy.PEFileEvidenceFactory.GetLocationEvidence(SafePEFileHandle peFile, SecurityZone& zone, StringHandleOnStack retUrl)
at System.Security.Policy.PEFileEvidenceFactory.GenerateLocationEvidence()
at System.Security.Policy.PEFileEvidenceFactory.GenerateEvidence(Type evidenceType)
at System.Security.Policy.AssemblyEvidenceFactory.GenerateEvidence(Type evidenceType)
at System.Security.Policy.Evidence.GetHostEvidenceNoLock(Type type)
at System.Security.Policy.Evidence.GetHostEvidence(Type type, Boolean markDelayEvaluatedEvidenceUsed)
at System.Security.Policy.AppDomainEvidenceFactory.GenerateEvidence(Type evidenceType)
at System.Security.Policy.Evidence.GetHostEvidenceNoLock(Type type)
at System.Security.Policy.Evidence.RawEvidenceEnumerator.MoveNext()
at System.Security.Policy.Evidence.EvidenceEnumerator.MoveNext()
at System.Configuration.ClientConfigPaths.GetEvidenceInfo(AppDomain appDomain, String exePath, String& typeName)
at System.Configuration.ClientConfigPaths.GetTypeAndHashSuffix(AppDomain appDomain, String exePath)
at System.Configuration.ClientConfigPaths..ctor(String exePath, Boolean includeUserConfig)
at System.Configuration.ClientConfigPaths.GetPaths(String exePath, Boolean includeUserConfig)
at System.Configuration.ClientConfigurationHost.RequireCompleteInit(IInternalConfigRecord record)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
at System.Configuration.ConfigurationManager.GetSection(String sectionName)
at System.Data.SqlClient.SqlConnection..cctor()
The stack trace indicates the SqlConnection constructor fails to open a configuration section. Our app.config does not have a connectionstrings section and machine.config and security.config on the tested computers haven't changed since 2017.
The code works when:
Commenting out using (svcIdentity.Impersonate),
or
when setting a breakpoint on the line immediately above the SqlConnection constructor ({) and stepping through the code (???),
or
when adding our application to the registry key mentioned at the end of KB945701
That KB article about a fix for Internet Explorer 9 seems unrelated, except that GetLocationEvidence on the first line of the stack trace seems to take a SecurityZone into account, which applications listed in the corresponding registry key seem to ignore.
Now my question:
Can anybody help me understand what exactly is going wrong, and if there is a better way to fix this than with an obscure registry key? It seems a 'coincidence' that this registry change works and I'm afraid our code might break again if we don't understand exactly why it fails.
Thx.

WP Silverlight BackgroundTask Communication with Azure

Hello I have a silverlight project for WP8.1 that is a game. I use a backgroundTask to alert the user about when he last played, if he is too slow to comply I would like to make a call to the server from the bagroundTask to resign from the games.
The backgroundTask is made using stackoverflow and this blog, just basic implementations of the backgroundTask.
I then install the NuGet Package Microsoft.Azure.Mobile.Client and everything is fine, I then do a compile, everything succeeds.
The app installs and splashscreen appears, then I get an error in the main project at the initialization of MobileServiceClient in App.xaml.cs
public MobileServiceClient MobileService = new MobileServiceClient(
"https://xxxxx.azurewebsites.net"
);
The exception in the above line states:
An exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.ni.dll but was not handled in user code
Additional information: Could not load file or assembly 'System.Runtime.InteropServices, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
The only change was the install of the NuGet package in the backgroundTask project. The stack trace output for the exception above.
at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type)
at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean isDecoratedTargetSecurityTransparent)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType)
at System.Reflection.RuntimeAssembly.GetCustomAttributes(Type attributeType, Boolean inherit)
at System.Attribute.GetCustomAttributes(Assembly element, Type attributeType, Boolean inherit)
at Microsoft.WindowsAzure.MobileServices.PlatformInformationExtensions.GetVersionFromAssemblyFileVersion(IPlatformInformation platformInformation)
at Microsoft.WindowsAzure.MobileServices.PlatformInformation.get_Version()
at Microsoft.WindowsAzure.MobileServices.MobileServiceHttpClient.GetUserAgentHeader()
at Microsoft.WindowsAzure.MobileServices.MobileServiceHttpClient..ctor(IEnumerable`1 handlers, Uri applicationUri, String installationId)
at Microsoft.WindowsAzure.MobileServices.MobileServiceClient..ctor(Uri mobileAppUri, HttpMessageHandler[] handlers)
at Microsoft.WindowsAzure.MobileServices.MobileServiceClient..ctor(String mobileAppUri, HttpMessageHandler[] handlers)
at BC_Menu.App..ctor()
I have not been able to solve this issue.
Extra
I am able to do normal http calls to the web by using the proposed code, replicated here:
BackgroundTaskDeferral _deferral;
public async void Run(IBackgroundTaskInstance taskInstance)
{
_deferral = taskInstance.GetDeferral();
// your async code
_deferral.Complete();
}
Update based on Adrian Halls Answer
The code works, my front application can communicate with the server and everything. The backgroundTask, can extract information from the device everything is fine, everything compiles and runs.
I then add the NuGet package to the backgroundTask and suddenly the above error appears, when I deploy this solution to the client.
I am running VS2015, Win10, and have v2.0.1 installed of Microsoft.Azure.Mobile.Client. I have seen some odd behaviours with silverlight projects on win10 before.
The error indicates a problem with your .NET setup - the error is in mscorlib (the basic library for .NET). Try to add a reference to the specific library that you need. Also, ensure that you have installed v2.0.1 (or later) or the Microsoft.Azure.Mobile.Client library.

Azure Mobile Services and Application Insights

I hava added Azure Application Insights to a new Azure Mobile Services (.NET backend) project. When I running it on my local machine it's sending data to insights. But when I deploy it to Azure it will not work. In the log at the portal I get the message below. Anyone that know how to solve this?
Message='Could not load assembly 'D:\home\site\wwwroot\bin\Microsoft.ApplicationInsights.Extensions.Intercept_x86.dll'. Error received: 'Could not load file or assembly 'file:///D:\home\site\wwwroot\bin\Microsoft.ApplicationInsights.Extensions.Intercept_x86.dll' or one of its dependencies. The module was expected to contain an assembly manifest.'.', Exception=System.BadImageFormatException: Could not load file or assembly 'file:///D:\home\site\wwwroot\bin\Microsoft.ApplicationInsights.Extensions.Intercept_x86.dll' or one of its dependencies. The module was expected to contain an assembly manifest.
File name: 'file:///D:\home\site\wwwroot\bin\Microsoft.ApplicationInsights.Extensions.Intercept_x86.dll'
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.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.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at Microsoft.WindowsAzure.Mobile.Service.Config.WebHostAssemblyResolver.LoadAssembly(String assemblyFilePath)
at Microsoft.WindowsAzure.Mobile.Service.Config.WebHostAssemblyResolver.GetApplicationAssemblies(ICollection1 asmPaths, ISet1 excludedAssemblyNames)
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
, Id=00000000-0000-0000-0000-000000000000, Category='Service.Hosting'
This exception is a first chance exception and does not affect monitoring in general. AI does not work because Azure Mobile Services infrastructure blocks http module so application insights http module cannot be loaded. There is no workaround how you could enable autocollection right now. You can only manually instrument your code.

Orchard 1.8 CMS Meta Description and keyword (Vandelay Module 1.8) Installation Error

I am using Orchard 1.8 and I installed the "Vandelay Industries - Version: 1.8" module from the Gallery onto my development box (running an VS Orchard project) and enabled just the "Vandelay Meta" (it's all I need at the moment). I added the "Meta" part to the "Page" content type and all that worked fine. I as able to add both a "Description" and "Keywords" to pages.
When I did the module installation to my production server (our server) which is the same version of Orchard (it was set up from the dev copy a month or so ago), I am getting a message "Some features need to be upgraded: Vandelay.Industries" at the top of the Admin "Modules" - "Features" screen and there is a red box around the "Vandelay Meta" feature and there is also a "Upgrade" link next to the feature's "Disable" link. If I click it the page just refreshes and nothing changes.
The part is also not available for adding to the page content type.
The is also an error in the Orchard Log
2014-10-08 14:10:58,385 [13] Orchard.Exceptions.DefaultExceptionPolicy - Default - An unexpected exception was caught
...servername/Packaging/PackagingServices/InstallPackageDetails?packageId=Orchard.Module.Vandelay.Industries&version=1.8&sourceId=1&redirectUrl=%2FPackaging%2FGallery%2FModules
Orchard.OrchardCoreException: Unable to make room for file "C:\inetpub\A1_Website-OrchardCMS\App_Data\RecipeQueue\38a6aedb4c514ea1866be2138d14c99e\0" in "App_Data" folder ---> System.UnauthorizedAccessException: Access to the path 'C:\inetpub\A1_Website-OrchardCMS\App_Data\RecipeQueue\38a6aedb4c514ea1866be2138d14c99e\0' is denied.
The App_Data and it's child folders has Read Execute Write permission IIS 7 IIS_IUSRS account.
There are also some errors "CREATE TABLE permission denied in database " i.e.
2014-10-08 14:12:19,332 [7] Orchard.Data.Migration.DataMigrationManager - Default - Error while running migration version 0 for Vandelay.Industries
../Admin/Modules/Features
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.SqlClient.SqlException: CREATE TABLE permission denied in database 'Orchard_ProductionDB'.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Orchard.Data.Migration.Interpreters.DefaultDataMigrationInterpreter.RunPendingStatements()
at Orchard.Data.Migration.Interpreters.DefaultDataMigrationInterpreter.Visit(CreateTableCommand command)
at Orchard.Data.Migration.Interpreters.AbstractDataMigrationInterpreter.Visit(ISchemaBuilderCommand command)
at Orchard.Data.Migration.Schema.SchemaBuilder.CreateTable(String name, Action1 table)
at Vandelay.Industries.MetaMigrations.Create()
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Orchard.Data.Migration.DataMigrationManager.Update(String feature)
And the "Vandelay_Industries_MetaRecord" "Vandelay_Industries_SettingsRecord" are not in the production database (they are in the dev DB)
I have tried reinstalling the module and it does not fix it.
Any way to fix this? If so how?
Thanks in advance,
K.E.
Ensure the migration module is enabled before installing Vandelay_Industries_*, I found that to a be a cause as well.

Resources