I have exported the plugins from prod server, and getting the following error message when importing into the test server.
Unhandled Exception: System.Web.Services.Protocols.SoapException:
Server was unable to process request.
Detail:
0x80040237
Cannot insert duplicate key.
Platform
at
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage
message, WebResponse response, Stream responseStream, Boolean
asyncCall)
at
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters)
at PluginRegistrationTool.CrmSdk.CrmService.Create(BusinessEntity
entity)
at
PluginRegistrationTool.RegistrationHelper.RegisterAssembly(CrmOrganization
org, String pathToAssembly, CrmPluginAssembly assembly)
at
PluginRegistrationTool.ImportExport.ImportSolution(CrmOrganization
org, ICollection1 assemblies, ICollection1 checkedTreeNodes,
IDictionary`2 pathList)
at PluginRegistrationTool.ImportExportForm.btnExecute_Click(Object
sender, EventArgs e)
On your test server check if plugins/steps/images by the same name are already existing. If yes, then delete them first before attempting the import.
I would recommend that you delete all registered plungins first before attempting to import.
When you create a new plugin Visual Studio will automatically create the step/class name for you based on the Pipeline Stage (Pre-Validation, Pre-Operation, Post-Operation) the Primary Entity (Contact, Organization) and the Message (Create, Update, etc) For example, PostContactUpdate or PreOrganizationUpdate, so if you happen to be making another plugin with same message, pipeline stage and primary entity and you accepted the default class names that could explain why you are getting the error. Changing the class name and redeploying should fix it for you.
Related
In the local environment (Windows 7, Kestrel, AspNetCore 2.0) everything works great no errors. However, when I deploy to AWS as a LAMBDA function using API Gateway I get the bellow error.
[HttpPost]
[Route("Temp")]
public IActionResult PostTest(IFormFile file)
{
using (SpreadsheetDocument document = SpreadsheetDocument.Open(file.OpenReadStream(), false))
{
}
return Ok();
}
Unknown error responding to request: FileFormatException:
System.IO.FileFormatException: File contains corrupted data.
at System.IO.Packaging.ZipPackage..ctor(Stream s, FileMode packageFileMode, FileAccess packageFileAccess)
at System.IO.Packaging.Package.Open(Stream stream, FileMode packageMode, FileAccess packageAccess)
at DocumentFormat.OpenXml.Packaging.OpenXmlPackage.OpenCore(Stream stream, Boolean readWriteMode)
at DocumentFormat.OpenXml.Packaging.SpreadsheetDocument.Open(Stream stream, Boolean isEditable, OpenSettings openSettings)
at api.Controllers.SKUController.Post2Async(IFormFile file) in \lambda\api\Controllers\SKUController.cs:line 72
at lambda_method(Closure , Object , Object[] )
at Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(Object target, Object[] parameters)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeActionMethodAsync>d__12.MoveNext()
I am able to post the excel just fine to AWS, (And even read it using system io) but the method for SpreedsheetDocument.Open is not working. (Also checked on that I can write a text file to a temp directory that seemed to work also)
Microsoft.AspNetCore.All 2.0.3 & NETStandard.Library 2.0.1
System.IO.Packaging 4.4.1
DocumentFormat.OpenXml 2.8.1
Check to see if the excel file you are attempting to open is password protected. If it is, remove the password protection, re save it and try to read the file again.
I found an MSDN post where users were experiencing the same error. After their research it was determined that the File contains corrupted data. exception can be caused by reading a password protected excel 2007 file with OpenXml.
Turns out that the API Gateway was encoding it as base64, it needed to be passed in as binary and not encoded. One thing I forgot to do was also deploy it API Gateway.
I am trying to reduce app size and enabled "Link All Assemblies", but my app crashes with following error
MvvmCross.Platform.Exceptions.MvxException: Failed to construct and initialize ViewModel for type Japam.Core.ViewModels.MantraasViewModel from locator MvxDefaultViewModelLocator - check InnerException for more information
I tried
--linkskip=mvvmcross.platform.ios
--linkskip=mvvmcross.core
--linkskip=mvvmcross.platform
but no luck, kept preserve attribute at assembly level of my core pcl project.
Also added a couple of more methods in LinkerPleaseIncludefile
public void Include(MvvmCross.Platform.IoC.MvxPropertyInjection injection)
{
injection = new MvvmCross.Platform.IoC.MvxPropertyInjection();
}
public void Include(MvxDefaultViewModelLocator locator)
{
locator = new MvxDefaultViewModelLocator();
}
but no use, could somebody help me find out what is missing
MvvmCross.Platform.Exceptions.MvxException: Failed to construct and initialize ViewModel for type
Japam.Core.ViewModels.MantraasViewModel from locator
MvxDefaultViewModelLocator - check InnerException for more information
---> MvvmCross.Platform.Exceptions.MvxException: Problem creating viewModel of type MantraasViewModel --->
MvvmCross.Platform.Exceptions.MvxIoCResolveException: Failed to
construct MantraasViewModel --->
System.Reflection.TargetInvocationException: Exception has been thrown
by the target of an invocation. --->
MvvmCross.Platform.Exceptions.MvxIoCResolveException: Failed to
resolve parameter for parameter sqliteConnectionFactory of type
IMvxSqliteConnectionFactory when creating
Japam.Core.Services.DataServices.MantraService
at MvvmCross.Platform.IoC.MvxSimpleIoCContainer.GetIoCParameterValues
(System.Type type, System.Reflection.ConstructorInfo firstConstructor)
[0x00036] in D:\git\MvvmCross\MvvmCross\Platform\Platform\IoC\
Finally I found the issue, it's SQLite problem so I added below three commands and it started working hope this helps someone else
--linkskip=MvvmCross.Plugins.Sqlite
--linkskip=SQLite-net
--linkskip=MvvmCross.Plugins.Sqlite.iOS
I should kept SQLite earlier it self my last project I did kept SQLite but forgot this time
I have an MVC3 application using the Entity Framework. I haven't used this application in about a year. Recently, I opened it up on a new PC and tried to run in debug mode and hit the following exception/stack trace in debug. The main exceptions seem to be "Cannot attach the file as database" and "The underlying provider failed on Open". I searched for these errors on stack overflow and the answers I found don't seem to match this situation. For example, one of the answers for "Cannot attach the file as database" suggests that an old version of the db might be lying around on the local db, but I don't see any databases in the local database when I browse to localdb in visual studio.
I am looking for guidance about what to investigate next to troubleshoot this issue. Any suggestions?
The actual code where it fails is:
var currentHunt = (from ph in this.repo.GetAllPuzzleHunts()
orderby ph.PuzzleHuntId descending
select ph).FirstOrDefault();
This is the first time the web app tries to get data from the db via the Entity Framework.
FWIW this machine has Entity Framework 6.0, and I'm using Visual Studio 2012.
Exception/Stack trace follow:
System.Data.DataException was unhandled by user code
HResult=-2146233087
Message=An exception occurred while initializing the database. See the InnerException for details.
Source=EntityFramework
StackTrace:
at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)
at System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization()
at System.Data.Entity.Internal.LazyInternalContext.<InitializeDatabase>b__4(InternalContext c)
at System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input)
at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action)
at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabase()
at System.Data.Entity.Internal.InternalContext.Initialize()
at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
at System.Data.Entity.Internal.Linq.InternalSet`1.GetEnumerator()
at System.Data.Entity.Infrastructure.DbQuery`1.System.Collections.Generic.IEnumerable<TResult>.GetEnumerator()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.OrderedEnumerable`1.<GetEnumerator>d__0.MoveNext()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
at GutolMvcApp.Controllers.HomeController.Index() in c:\Users\jordanat\Documents\Visual Studio 2012\Projects\Gutol\Gutol\GutolMvcApp\Controllers\HomeController.cs:line 25
at lambda_method(Closure , ControllerBase , Object[] )
at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters)
at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass42.<BeginInvokeSynchronousActionMethod>b__41()
at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.End()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.<>c__DisplayClass39.<BeginInvokeActionMethodWithFilters>b__33()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49()
InnerException: System.Data.Entity.Core.EntityException
HResult=-2146233087
Message=The underlying provider failed on Open.
Source=EntityFramework
StackTrace:
at System.Data.Entity.Core.EntityClient.EntityConnection.Open()
at System.Data.Entity.Core.Objects.ObjectContext.EnsureConnection()
at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
at System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClassb.<GetResults>b__9()
at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func`1 operation)
at System.Data.Entity.Core.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
at System.Data.Entity.Core.Objects.ObjectQuery`1.<System.Collections.Generic.IEnumerable<T>.GetEnumerator>b__0()
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at System.Lazy`1.get_Value()
at System.Data.Entity.Internal.LazyEnumerator`1.MoveNext()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
at System.Data.Entity.Core.Objects.ELinq.ObjectQueryProvider.<GetElementFunction>b__1[TResult](IEnumerable`1 sequence)
at System.Data.Entity.Core.Objects.ELinq.ObjectQueryProvider.ExecuteSingle[TResult](IEnumerable`1 query, Expression queryRoot)
at System.Data.Entity.Core.Objects.ELinq.ObjectQueryProvider.System.Linq.IQueryProvider.Execute[TResult](Expression expression)
at System.Data.Entity.Internal.Linq.DbQueryProvider.Execute[TResult](Expression expression)
at System.Linq.Queryable.FirstOrDefault[TSource](IQueryable`1 source)
at System.Data.Entity.Internal.EdmMetadataRepository.QueryForModelHash(Func`2 createContext)
at System.Data.Entity.Internal.InternalContext.QueryForModelHash()
at System.Data.Entity.Internal.ModelCompatibilityChecker.CompatibleWithModel(InternalContext internalContext, ModelHashCalculator modelHashCalculator, Boolean throwIfNoMetadata)
at System.Data.Entity.Internal.InternalContext.CompatibleWithModel(Boolean throwIfNoMetadata)
at System.Data.Entity.Database.CompatibleWithModel(Boolean throwIfNoMetadata)
at System.Data.Entity.CreateDatabaseIfNotExists`1.InitializeDatabase(TContext context)
at System.Data.Entity.Internal.InternalContext.<>c__DisplayClasse`1.<CreateInitializationAction>b__d()
at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)
InnerException: System.Data.SqlClient.SqlException
HResult=-2146232060
Message=Cannot attach the file 'C:\Users\...\Visual Studio 2012\Projects\Gutol\Gutol\GutolMvcApp\App_Data\PuzzleCollateral.mdf' as database 'PuzzleCollateral'.
Thanks for your help!
Try it this way:
https://stackoverflow.com/a/16339164/1390999
Open the "Developer Command Propmpt for VisualStudio" under your
start/programs menu. Run the following commands:
sqllocaldb.exe stop v11.0
sqllocaldb.exe delete v11.0
After that, try to Start your MVC Application
Check your connection strings. If you're on a new computer you may need to change them somewhat or open a port in the firewall.
One simple way to get the proper connection string is to connect to the DB Server and view the properties.
Open SQL Server Object Explorer (View > SQL Server Object Explorer)
Connect to the DB Server (Click "Connect to Server" and enter "(LocalDB)\v11.0")
Right click on the appropriate DB and select "Properties"
View the connection string
I'm struggling to the maximum trying to get DB deployment done from a remote client.
Let me fire you some details.
Problem
System.Runtime.Serialization.SerializationException: Member 'ClassName' was not found.
Occurs during a publish to the remote IIS server from Visual studio 2012.
Server
Windows Server 2008 R2
IIS 7.5
SQL SERVER 2012 Express
What goes wrong
I select publish on my web application (within visual studio 2012 / windows 8 pro)
I publish my web application no problem to my remote web server (confirmed web page deployed and is accessible from www).
I open publish again, this time selecting DB publish.
Exception occurs on the server, message is propagated to client.
=> application publishing is fine, just not DB.
What i've tried
Every guide, faq, step by step guide I can find online.
I've uninstalled and re-installed all the deployment packages for IIS (DAC framework, Web Deployment 3, Web deployment tools 2.1 - server)
Re install all client side DAC libraries on client.
Uninstall, re-install, rebooting, punching my keyboard and monitor (not my main DELL ultrasharp 24..just my 21" acer thing).
Nothing is helping (except the keyboard punching..which made me feel slightly relieved), i've just spent 10 hours, no joy. Service Delegation entries are setup for the correct DAC based provider.
Seems to be some fundamental problem, based on my understanding, an assembly is being reflected on, and is expecting to have a member called 'ClassName'..but it doesn't exist..i.e....the assembly must not be in sync with the consumer.
But there are no clear guidelines on line to confirm/ diagnose this..and nothing in the exception log except for this error (see below).
I've found a similar post on here with the same exception message, except the guys suggestions didn't help for me at all - tried them.
Please help, i've turned to chocolate biscuits and plain hambugers to drown out the pain...i'll need to drown myself again tomorrow at the gym (this time in sweat).
Thank you,
Karl
A tracing deployment agent exception occurred that was propagated to the client. Request ID '7dd5089d-4e51-4f27-aecc-c8044754a01e'. Request Timestamp: '10/11/2012 8:55:08 PM'. Error Details:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.Serialization.SerializationException: Member 'ClassName' was not found.
at System.Runtime.Serialization.SerializationInfo.GetElement(String name, Type& foundType)
at System.Runtime.Serialization.SerializationInfo.GetString(String name)
at System.Exception..ctor(SerializationInfo info, StreamingContext context)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._SerializationInvoke(Object target, SignatureStruct& declaringTypeSig, SerializationInfo info, StreamingContext context)
at System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object obj, SerializationInfo info, StreamingContext context)
at System.Runtime.Serialization.ObjectManager.FixupSpecialObject(ObjectHolder holder)
at System.Runtime.Serialization.ObjectManager.DoFixups()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, IMethodCallMessage methodCallMessage)
at Microsoft.Web.Deployment.Base64EncodingHelper.DeserializeHelper(BinaryFormatter formatter, Byte[] buffer)
at Microsoft.Web.Deployment.Base64EncodingHelper.Deserialize(String str, Exception& handledException)
at Microsoft.Web.Deployment.SerializationHelper.Deserialize(String str)
at Microsoft.Web.Deployment.SqlDacPacProvider.ProcessExeOutput()
at Microsoft.Web.Deployment.SqlDacPacProvider.RunExecutableAsync(String exeName, String arguments, Int32 waitInterval, Int32 retryAttempts)
at Microsoft.Web.Deployment.SqlDacPacProvider.Add(DeploymentObject source, Boolean whatIf)
at Microsoft.Web.Deployment.DeploymentObject.Add(DeploymentObject source, DeploymentSyncContext syncContext)
at Microsoft.Web.Deployment.DeploymentSyncContext.HandleAdd(DeploymentObject destObject, DeploymentObject sourceObject)
at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildren(DeploymentObject dest, DeploymentObject source)
at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildrenOrder(DeploymentObject dest, DeploymentObject source)
at Microsoft.Web.Deployment.DeploymentSyncContext.ProcessSync(DeploymentObject destinationObject, DeploymentObject sourceObject)
at Microsoft.Web.Deployment.DeploymentObject.SyncToInternal(DeploymentObject destObject, DeploymentSyncOptions syncOptions, PayloadTable payloadTable, ContentRootTable contentRootTable, Nullable1 syncPassId)
at Microsoft.Web.Deployment.DeploymentAgent.HandleSync(DeploymentAgentAsyncData asyncData, Nullable1 passId)
at Microsoft.Web.Deployment.DeploymentAgent.HandleRequestWorker(DeploymentAgentAsyncData asyncData)
at Microsoft.Web.Deployment.DeploymentAgent.HandleRequest(DeploymentAgentAsyncData asyncData)
I've been struggling with getting an application endpoint working on UCMA 3.0. I am trying to run an application on a server separate from the Lync server which uses a registered ApplicationEndpoint to monitor presence and act as a bot which can send other users messages. I used to have my code working with a UserEndpoint (which was fine for monitoring presence), but did not have the capabilities to send IMs to other Lync users.
After searching the web, I'm finally at the point where I'm getting this error when running my code:
System.ArgumentException was unhandled
Message=An ApplicationEndpoint can be registered only if proxy and Multual Tls have been specified.
Source=Microsoft.Rtc.Collaboration
StackTrace:
at Microsoft.Rtc.Collaboration.ApplicationEndpoint..ctor(CollaborationPlatform platform, ApplicationEndpointSettings settings)
at Waldo.endpointHelper.CreateApplicationEndpoint(ApplicationEndpointSettings applicationEndpointSettings) in C:\Users\l1m5\Desktop\waldoproject\trunk\WaldoSoln\waldoGrabPresence\endpointHelper.cs:line 117
at Waldo.endpointHelper.CreateEstablishedApplicationEndpoint(String endpointFriendlyName) in C:\Users\l1m5\Desktop\waldoproject\trunk\WaldoSoln\waldoGrabPresence\endpointHelper.cs:line 228
at Waldo.waldoGrabPresence.Run() in C:\Users\l1m5\Desktop\waldoproject\trunk\WaldoSoln\waldoGrabPresence\waldoGrabPresence.cs:line 60
at Waldo.waldoGrabPresence.Main(String[] args) in C:\Users\l1m5\Desktop\waldoproject\trunk\WaldoSoln\waldoGrabPresence\waldoGrabPresence.cs:line 42
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
After some searching, I followed the instructions here: http://blogs.claritycon.com/blogs/michael_greenlee/archive/2009/03/21/installing-a-certificate-for-ucma-v2-0-applications.aspx to import a certificate onto the server that I'm trying to run the application on, but to no avail.
So at this point, I think that there must be something wrong with how I'm setting up the ApplicationEndpointSettings, CollaberationPlatform or ApplicationEndpoint objects. Here's how I'm doing it:
ApplicationEndpointSettings settings = new ApplicationEndpointSettings(_ownerURIPrompt, _serverFQDNPrompt, _trustedPortPrompt);
ServerPlatformSettings settings = new ServerPlatformSettings(null, _serverFQDNPrompt, _trustedPortPrompt, _trustedApplicationGRUU);
_collabPlatform = new CollaborationPlatform(settings);
_applicationEndpoint = new ApplicationEndpoint(_collabPlatform, applicationEndpointSettings);
Does anyone see any problems with what I'm doing? Or, better yet, does anyone know of a blog that walks you through establishing an application endpoint in the situation I'm in? I work really well with tutorials or samples, but have not found one that seems to accomplish what I'm trying to do.
Thanks for the help!
The procedure to get a certificate in Lync is very different than OCS2007, and much easier. The link you posted is for UCMA2, and OCS, I believe. In Lync, it's basically two powershell statements.
1) Request-CSCertificate -Action new -Type default -CA -Verbose
2) Save the results of that statement, take the thumbprint, use it as the parameter to:
Set-CsCertificate -Type Default -Thumbprint XXXXXXXXXXXXXXXXXXXX
Installing UCMA 3.0 and Creating a Lync Server 2010 Trusted Application Pool
use powershell to provision a trusted application endpoint. The command to explore is new-trustedapplicationendpoint. The error you are getting is due to no trusted endpoint being registered, even though you may have your trusted application registered, it needs an endpoint to work and that endpoint must be first registered before you provision the platform.
The SDK CHM file should be your friend here! This section is about app activation and provisioning
Pass the certificate to the ServerPlatformSettings object, then it works. I had the similar problem, and the problem is resolved after using the ServerPlatformSettings(string applicationUserAgent, string localhost, int port, string gruu, string certificateIssuerName, byte[] certificateSerialNumber) constructor for the ServerPlatformSettings.