Adding permission management module for customization - abp

I have abp .Net Core Application and I have added permission module using command
abp add-module Volo.PermissionManagement --with-source-code --add-to-solution-file
then when I open application then found permission module added in solution under modules folder and solution build success but when I run application I get error in browser
HTTP Error 500.30 - ASP.NET Core app failed to start
and error in log is
System.IO.FileNotFoundException: Could not load file or assembly 'Volo.Abp.PermissionManagement.Application.Contracts, Version=5.3.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
File name: 'Volo.Abp.PermissionManagement.Application.Contracts, Version=5.3.0.0, Culture=neutral, PublicKeyToken=null'
at System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, RuntimeType type, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs)
at System.Reflection.CustomAttribute.CreateCaObject(RuntimeModule module, RuntimeType type, IRuntimeMethodInfo ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs)
at System.Reflection.CustomAttribute.AddCustomAttributes(ListBuilder`1& attributes, RuntimeModule decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, ListBuilder`1 derivedAttributes)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit)
at System.RuntimeType.GetCustomAttributes(Type attributeType, Boolean inherit)
at System.Attribute.GetCustomAttributes(MemberInfo element, Boolean inherit)
at Volo.Abp.Modularity.AbpModuleHelper.FindDependedModuleTypes(Type moduleType)
at Volo.Abp.Modularity.AbpModuleHelper.AddModuleAndDependenciesRecursively(List`1 moduleTypes, Type moduleType, ILogger logger, Int32 depth)
at Volo.Abp.Modularity.AbpModuleHelper.AddModuleAndDependenciesRecursively(List`1 moduleTypes, Type moduleType, ILogger logger, Int32 depth)
at Volo.Abp.Modularity.AbpModuleHelper.AddModuleAndDependenciesRecursively(List`1 moduleTypes, Type moduleType, ILogger logger, Int32 depth)
at Volo.Abp.Modularity.AbpModuleHelper.AddModuleAndDependenciesRecursively(List`1 moduleTypes, Type moduleType, ILogger logger, Int32 depth)
at Volo.Abp.Modularity.AbpModuleHelper.FindAllModuleTypes(Type startupModuleType, ILogger logger)
at Volo.Abp.Modularity.ModuleLoader.FillModules(List`1 modules, IServiceCollection services, Type startupModuleType, PlugInSourceList plugInSources)
at Volo.Abp.Modularity.ModuleLoader.GetDescriptors(IServiceCollection services, Type startupModuleType, PlugInSourceList plugInSources)
at Volo.Abp.Modularity.ModuleLoader.LoadModules(IServiceCollection services, Type startupModuleType, PlugInSourceList plugInSources)
at Volo.Abp.AbpApplicationBase..ctor(Type startupModuleType, IServiceCollection services, Action`1 optionsAction)
at Volo.Abp.AbpApplicationFactory.CreateAsync[TStartupModule](IServiceCollection services, Action`1 optionsAction)
at Microsoft.Extensions.DependencyInjection.ServiceCollectionApplicationExtensions.AddApplicationAsync[TStartupModule](IServiceCollection services, Action`1 optionsAction)
at Microsoft.Extensions.DependencyInjection.WebApplicationBuilderExtensions.AddApplicationAsync[TStartupModule](WebApplicationBuilder builder, Action`1 optionsAction)
at DCC.Program.Main(String[] args)
although all projects are the same version 5.3.0

The problem in version of packages when you replace packages with code the version of resulted Dll will be different than the other Abp packages
So what you should do is to set the version in csproj for each project in your module
in your case set version to 5.3.0

Related

Sitecore with SOLR: An index with the name "sitecore_marketingdefinitions_master" have already been added

I get this error when configuring SOLR 6.3 with Sitecore 8.1. I have done all steps from the following post, but after complete steps I get the following error:
An index with the name "sitecore_marketingdefinitions_master" have already been added.
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.InvalidOperationException: An index with the name "sitecore_marketingdefinitions_master" have already been added.
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:
[InvalidOperationException: An index with the name "sitecore_marketingdefinitions_master" have already been added.]
Sitecore.Diagnostics.Assert.IsFalse(Boolean condition, String message) +81
Sitecore.ContentSearch.ContentSearchConfiguration.AddIndex(ISearchIndex index) +185
[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) +128
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +146
Sitecore.Configuration.DefaultFactory.AssignProperties(Object obj, Object[] properties) +869
Sitecore.Configuration.DefaultFactory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper) +655
Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +322
Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert) +72
Sitecore.Configuration.DefaultFactory.CreateObject(String configPath, String[] parameters, Boolean assert) +619
Sitecore.ContentSearch.ContentSearchManager.get_SearchConfiguration() +262
Sitecore.ContentSearch.SolrProvider.SolrContentSearchManager.get_Cores() +92
Sitecore.ContentSearch.SolrProvider.SolrNetIntegration.DefaultSolrStartUp.Initialize() +255
(Object , Object[] ) +71
Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +484
Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +22
Sitecore.Nexus.Web.HttpModule.Application_Start() +259
Sitecore.Nexus.Web.HttpModule.Init(HttpApplication app) +704
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +618
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +402
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +343
[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +579
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +112
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +712
You might still have .Lucene. configs in your App_Config/Include folder that have not yet been disabled. Need to add .disabled to all Lucene config files.

Could not load file or assembly 'CMS.OutputFilter' or one of its dependencies opening index.html in browser from VS2013

This problem occurs when my source files are on my E drive, but not when they are in my C: MyDocuments folder.
I am working through Deborah Kurata's AngulaJS Line of Business Applications course on Pluralsight.
I have the following Index.html open in VS2013
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8"/>
<title>Acme Product Management</title>
<script src="js/angular.js"></script>
</head>
<body ng-app>
</body>
</html>
When I right click the code and select
view in browser (Chrome)
I get the following error
This seems to relate to Kentico, which I do have installed.
How do I fix it?
Server Error in '/' Application.
Could not load file or assembly 'CMS.OutputFilter' or one of its dependencies. The system cannot find the file specified.
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.IO.FileNotFoundException: Could not load file or assembly 'CMS.OutputFilter' or one of its dependencies. The system cannot find the file specified.
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.
Assembly Load Trace: The following information can be helpful to determine why the assembly 'CMS.OutputFilter' could not be loaded.
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].
Stack Trace:
[FileNotFoundException: Could not load file or assembly 'CMS.OutputFilter' or one of its dependencies. The system cannot find the file specified.]
System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) +0
System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName) +70
System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +39
System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +37
System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +65
System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +38
[ConfigurationErrorsException: Could not load file or assembly 'CMS.OutputFilter' or one of its dependencies. The system cannot find the file specified.]
System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +348
System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, Boolean checkAptcaBit) +19
System.Web.Configuration.Common.ModulesEntry.SecureGetType(String typeName, String propertyName, ConfigurationElement configElement) +39
System.Web.Configuration.Common.ModulesEntry..ctor(String name, String typeName, String propertyName, ConfigurationElement configElement) +42
System.Web.HttpApplication.BuildIntegratedModuleCollection(List`1 moduleList) +158
System.Web.HttpApplication.GetModuleCollection(IntPtr appContext) +950
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +82
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +336
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296
[HttpException (0x80004005): Could not load file or assembly 'CMS.OutputFilter' or one of its dependencies. The system cannot find the file specified.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9931916
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34249
Web.config files are like CSS files, they inherit one another. So if your AngularJS website is an application below your main Kentico site within IIS, it's inheriting those values in the web.config file of the Kentico site. In the web.config file of the AngularJS site, you need to add
<remove name="XHtmlModule"/>
In the <system.webServer><modules> node. This will tell your AngularJS project to not inherit that module.

DNN exception on Site Settings or Host Settings pages "Could not load file or assembly 'protobuf-net"

I upgraded my DNN from version 7.0.0 to 7.1.1. After that I'm getting an exception every time that I enter page Site Settings or Host Settings of DNN in my site. The exception is:
Could not load file or assembly 'protobuf-net, Version=2.0.0.447, Culture=neutral, PublicKeyToken=257b51d87d2e4d67' or one of its dependencies. The system cannot find the file specified.
Here is the full Inner Exception:
DotNetNuke.Services.Exceptions.PageLoadException: Could not load file or assembly 'protobuf-net, Version=2.0.0.447, Culture=neutral, PublicKeyToken=257b51d87d2e4d67' or one of its dependencies. The system cannot find the file specified.
---> System.IO.FileNotFoundException: Could not load file or assembly 'protobuf-net, Version=2.0.0.447, Culture=neutral, PublicKeyToken=257b51d87d2e4d67' or one of its dependencies. The system cannot find the file specified.
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.ModuleHandle.ResolveTypeHandle(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.IsCustomAttributeDefined(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Boolean mustBeInheritable)
at System.Reflection.CustomAttribute.IsDefined(RuntimeType type, RuntimeType caType, Boolean inherit)
at System.ComponentModel.Composition.AttributedModel.AttributedModelDiscovery.CreatePartDefinitionIfDiscoverable(Type type, ICompositionElement origin)
at System.ComponentModel.Composition.Hosting.TypeCatalog.get_PartsInternal()
at DotNetNuke.ExtensionPoints.SafeDirectoryCatalog..ctor(String directory)
at DotNetNuke.ExtensionPoints.ExtensionPointManager.get_MefCompositionContainer()
at DotNetNuke.ExtensionPoints.ExtensionPointManager.ComposeParts(Object[] attributeParts)
at DotNetNuke.ExtensionPoints.EditPagePanelExtensionControl.OnInit(EventArgs e)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.AddedControl(Control control, Int32 index)
at System.Web.UI.Control.EnsureChildControls()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace ---
I have already searched everything about protobuf-net and DNN but I have not found anything.
Anyone know anything about it?
EDIT
Finally, problem solved. The problem was a module that I installed that reference the protobuf-net. The module calls ZeneXa Newsletter Autoresponder. Somehow this module is not compatible with DNN versions newer than 7.0.0. I contacted the module for more information about that.
I have absolutely no knowledge of how DNN is making use of this, but at the simplest level you could try adding a reference to an appropriate version of protobuf-net (probably from NuGet is the simplest), and see if it works. This can be done via the UI or in the package manager console:
PM> Install-Package protobuf-net
If the problem is actually "fusion", then a binding redirect may help - for example, to redirect everything to r668 (assuming you are using protobuf-net r668):
<dependentAssembly>
<assemblyIdentity name="protobuf-net" publicKeyToken="257b51d87d2e4d67"
culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.0.668" newVersion="2.0.0.668" />
</dependentAssembly>

What causes a TypeLoadException on Migrate.exe for EF6?

I'm trying to run EF's migrate.exe from the command line as part of our build process. This is my actual command:
migrate.exe Hydrogen.Data.dll /startupConfigurationFile:..\..\..\Hydrogen.Web\Web.config
/verbose
And it continually throws this exception:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'System.Data.Entity.SqlServer.SqlProviderServices' threw an exception. ---> System.TypeLoadException: Method 'ExecuteAsync' in type 'System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy' from assembly 'EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' does not have an implementation.
at System.Data.Entity.SqlServer.SqlProviderServices..ctor()
at System.Data.Entity.SqlServer.SqlProviderServices..cctor()
--- End of inner exception stack trace ---
at System.Data.Entity.SqlServer.SqlProviderServices.get_Instance()
--- 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 System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index)
at System.Data.Entity.Config.ProviderServicesFactory.GetInstance(Type providerType)
at System.Data.Entity.Internal.AppConfig.<.ctor>b__2(ProviderElement e)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at System.Data.Entity.Internal.AppConfig.<.ctor>b__1()
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at System.Data.Entity.Internal.AppConfig.get_DbProviderServices()
at System.Data.Entity.Config.AppConfigDependencyResolver.RegisterDbProviderServices()
at System.Data.Entity.Config.AppConfigDependencyResolver.GetServiceFactory(Type type, String name)
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
at System.Data.Entity.Config.AppConfigDependencyResolver.GetService(Type type, Object key)
at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
at System.Data.Entity.Config.CompositeResolver`2.GetService(Type type, Object key)
at System.Data.Entity.Config.IDbDependencyResolverExtensions.GetService[T](IDbDependencyResolver resolver, Object key)
at System.Data.Entity.DbContext.InitializeLazyInternalContext(IInternalConnection internalConnection, DbCompiledModel model)
at Hydrogen.Data.HydrogenData..ctor() in c:\code\Hydrogen\Hydrogen.Data\HydrogenData.cs:line 18
--- End of inner exception stack trace ---
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)
at System.Data.Entity.Infrastructure.DbContextInfo.<CreateActivator>b__2()
at System.Data.Entity.Infrastructure.DbContextInfo..ctor(Type contextType, DbProviderInfo modelProviderInfo, AppConfig config, DbConnectionInfo connectionInfo)
at System.Data.Entity.Infrastructure.DbContextInfo..ctor(Type contextType, DbConnectionInfo connectionInfo)
at System.Data.Entity.Migrations.DbMigrator..ctor(DbMigrationsConfiguration configuration, DbContext usersContext)
at System.Data.Entity.Migrations.DbMigrator..ctor(DbMigrationsConfiguration configuration)
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)
ERROR: Exception has been thrown by the target of an invocation.
When I run Update-Database from within Visual Studio everything works fine, so I know the migrations themselves are working.
This is on a SQL Server database.
I just ran into this today. This can happen when you used the wrong sets of DLL when you run migrate.exe.
In my case, I used the .Net 4.5 version in migrate.exe but compiled my project using .Net 4.0's version.
After changing the dlls the problem went away.

xamlparser error after clickonce deployment.Application crashing after installation

I've built an WPF application with visual studio 2008 and created an installer for it.Works fine so far.I realized it lacks the automatic updates feature, and after trying several solutions, i decided to give a try to clickonce deployment.After a successful deployment on a network server, i 've noticed that the application crashes after installation of the downloaded app.It complains about this:
Cannot create instance of 'Login' defined in assembly 'MyApplication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Exception has been thrown by the target of an invocation. Error in markup file 'MyApplication;component/login.xaml' Line 1 Position 9.
here is the stacktrace
at System.Windows.Markup.XamlParseException.ThrowException(String message, Exception innerException, Int32 lineNumber, Int32 linePosition, Uri baseUri, XamlObjectIds currentXamlObjectIds, XamlObjectIds contextXamlObjectIds, Type objectType)
at System.Windows.Markup.XamlParseException.ThrowException(ParserContext parserContext, Int32 lineNumber, Int32 linePosition, String message, Exception innerException)
at System.Windows.Markup.BamlRecordReader.ThrowExceptionWithLine(String message, Exception innerException)
at System.Windows.Markup.BamlRecordReader.CreateInstanceFromType(Type type, Int16 typeId, Boolean throwOnFail)
at System.Windows.Markup.BamlRecordReader.GetElementAndFlags(BamlElementStartRecord bamlElementStartRecord, Object& element, ReaderFlags& flags, Type& delayCreatedType, Int16& delayCreatedTypeId)
at System.Windows.Markup.BamlRecordReader.BaseReadElementStartRecord(BamlElementStartRecord bamlElementRecord)
at System.Windows.Markup.BamlRecordReader.ReadElementStartRecord(BamlElementStartRecord bamlElementRecord)
at System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord)
at System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord)
at System.Windows.Markup.TreeBuilderBamlTranslator.ParseFragment()
at System.Windows.Markup.TreeBuilder.Parse()
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
at System.Windows.Application.LoadBamlStreamWithSyncInfo(Stream stream, ParserContext pc)
at System.Windows.Application.LoadComponent(Uri resourceLocator, Boolean bSkipJournaledProperties)
at System.Windows.Application.DoStartup()
at System.Windows.Application.<.ctor>b__0(Object unused)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.Run()
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
at myApplication.App.Main()
here is just the region the debugger is pointing to
<Window x:Class="MyApplication.Login"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:src="clr-namespace:MyApplication"
xmlns:UI="clr-namespace:UI;assembly=UI"
Title="My Application" Height="400" Width="550" ResizeMode="NoResize" WindowStyle="ThreeDBorderWindow" WindowStartupLocation="CenterScreen" Name="Logine" Loaded="Logine_Loaded" Closed="Logine_Closed" Icon="orLogo.ico">
But the installer version as in the msi from setup project works fine.so i cannot see where the error is comming from since i can have design view.
Question 1 : Does any one have a similar issue, or is that a known issue?
Question 2 : If it's a known issue then what are alternative.I might give up on the clickonce but then i my automatic update feature will be lost (as in there is none which is not ovekill or seriously outdated that i can find right now).
thanks for reading this and for pointing me to the right direction.
If you go to the ClickOnce cache and find the executable for your application and double-click on it, does it still fail? If so, then it is not a ClickOnce problem per se. It could be that you are missing some assembly in your deployment that is required. Or you are doing something that ClickOnce doesn't allow, such as accessing a folder that requires administrative privileges.
You can also try running it from your \bin\release folder after doing a build, but that won't tell you if you have an assembly on your machine that you're using that is not being deployed.
The ClickOnce cache on windows 7 (and vista) is here:
C:\Users\username\AppData\Local\Apps\2.0\obfuscatedfolder\obfuscatedfolder
From there, for a win forms app, it creates two folders, one called xxxx...exe_etc and one called xxxx...tion_etc... The one that starts with xxxx_tion (where xxxx = 1st four characters of your assembly name) is the one where the app is run from. I'm not sure if the folder names are the same for a WPF app, but hopefully they're not too different. The executable will only be in one folder. (And yes, you'd think it would be in the xxxx...exe_etc folder, but it's not.)
EDIT -- ADDED INFO
For the issue of missing images: Are they included in the project as files? If so, make sure the build action is 'content' and the 'copy to output directory' property is set to 'copy always'. Otherwise, it won't include them in the deployment.
For the database, same issue. It needs to be included in the project, and the properties must be set accordingly (set 'copy...' to 'copy if newer'). ALSO, open the Application Files dialog and see if it is marked as Include(Data). If it is, then it is being deployed to the Data directory. If you deploy it that way, when you publish a new version, it will copy the data forward to the new folders. You can find it programmatically using the ApplicationDeployment.DataDirectory property.
I generally don't recommend trusting your data to ClickOnce. If you deploy something as data, and the date/time stamp on your local version changes, ClickOnce will deploy the new version, and put the old version in a subfolder called .\pre. To me, this is dangerous, because you could modify the data accidentally. SQLCE changes the date/time stamp if you just open the database to look at the table structures. So I move the data and handle the updating of the database myself. If you want more information about this, check out my blog post on keeping your data safe from ClickOnce updates.

Resources