activity could not be loaded because of errors in the XAML - workflow-foundation-4

Considering the following scenario:
Create MyCodeActivity1 with argument MyArgument1
Add this activity to a myworkflow.xaml
Rename MyArgument1 in MyCodeActivity1 to MyRenamedArgument1
If you open myworkflow.xaml, visual studio will show this error:
activity could not be loaded because of errors in the XAML
Is there a facility where visual studio can give more information about the error please?
For now I have created a small windows application that tries to execute the workflow and shows an error message if invalid. This does give a clear message. But it would be great if visual studio provided this functionality directly.

No.
Nope.
Nuh uh.
Visual Studio's refactoring can't handle change in Activity code => change in XamlAppDef XML. Its not surprising, such a chain of logic would be complex to achieve. So whenever you do this you must expect your workflows will have to be fixed. Either plan ahead, or...
Any time a workflow won't compile, or if it shows the red box of pain in the design surface, you should always right click on the workflow file, select Open With... and select the XML (text) editor. You will see the squiggly error lines and more detail about the error in this view.

I got the same error("activity could not be loaded because of errors in the XAML"), But in my case, I had created a Code Activity and used that in a State Machine. But, I found out that the defined Code Activity had not been shown in the Toolbox. It means that the Code Activity is not identifiable to Windows Work Flow.

Related

Development and debugging in Dynamics 365

I’ve upgraded a custom model to Dynamics 365, from Ax2012. I’ve created deploy-able package and imported into an on-prem environment.
The machine on which I developed is different from the on-prem environment (TEST-env).
There is some functionality that is not working as it should, which I need to debug, and this is where I get stuck.
I’ve been developing in Ax from version 3 to 2012. I am struggling to get comfortable and find my way in Visual Studio.
In a broad sense I guess my question is: how do I debug something as simple as a button click event on a form? Can I run the form from Visual Studio and debug it there, without having to open the Dynamics 365 website?
Since my development environment and the on-prem D365 website (TEST-env) are on two different machines, is there an easy way to make changes to the code and have the TEST-env updated, or do I have to create a deployment package and import it into TEST-env for each change?
To debug, you just create a project with your objects, right click on a form and click "Set as Startup Object" then go put a breakpoint (F9) on whatever line of code, and press F5 to run.
You could connect your Test version to VSTS and do code moves that way via branch/merging.
Your development environment is an entirely isolated version meaning typically your database and the application all live on the same box and all the D365 services run from that one box. IIS is configured to run your instance so when you browser to D365 you are viewing your development environment.
Typical debugging involves placing break points in the code, normally if you know there is code behind a button click you want to break into you would find the form where the button is right-click and get the form name. Then open visual studio 2015 which is the exclusive IDE for development. Find the AOT explorer and paste in the form name. Then open the form once it is in the explorer, find the button and look at the methods, events of that and view the code. From there you can put break points and you just have to attach the debugger to w3wp.exe. Make sure you go into the options under the Dynamics 365 menu and find debugging and make sure to uncheck "Load symbols only for items in the solution" or your break point won't get unless it is something in your project.
The other option you have with debugging is to create what is called a runnable class in D365. You create a new class and add a void main entry and then right-click on the class from the solution explorer and select "set as startup object". Then you can just press the start button from visual studio and that class will fire. This allows you to easily debug scenarios where you are checking what a select in X++ returns or items like that. You can't run the D365 site from pressing start, only simple runnable classes.
Example of a runnable class in D365
class TestClass
{
public static void main(Args _args)
{
Info("hello world");
}
}

Tridion Copy/Paste In the same org item causes TCM54 Error

We are experiencing a strange issue after upgrading from Tridion 2011 GA to 2011 SP1 HR1. When doing a copy-paste of components within the same folder we normally get a popup asking if we want to paste with a different name, however, in our case we see an error message as follows:
/WebUI/Models/TCM54/Services/General.svc/CopyPasteItem failed to execute. STATUS (500): Internal Server Error The page cannot be displayed because an internal server error has occurred.
The only thing that is visible in the Event Viewer logs are warnings, which are expected (because my test VM gets them too). We don't actually see any errors other than the one in the GUI.
When copy/pasting components within a folder:
Unable to paste the item into this Folder.
Name must be unique for items of type: Component within this Folder and its BluePrint context. Source or sources of conflict: tcm:4-81455.
Error Code:
0x80040329 (-2147220695)
Call stack:
UtilitiesBL.AssertUniqueTitle
UtilitiesBL.CloneItem
ComponentBL.Clone
Tridion.ContentManager.ContentManagement.RepositoryLocalObject.Copy(OrganizationalItem,Boolean)
Tridion.ContentManager.BLFacade.ContentManagement.RepositoryLocalObjectFacade.Clone(UserContext,String,String,Boolean)
Folder.PasteItem
When copy/pasting Pages in Structure Groups:
It is not possible to paste this item into a Structure Group.
Name and File name both must be unique for items of type: Page within this Structure Group and its BluePrint context. Source or sources of conflict: tcm:5-82986-64.
Error Code:
0x80040329 (-2147220695)
Call stack:
UtilitiesBL.AssertUniqueTitleAndFileName
UtilitiesBL.AssertUniqueTitleAndFilename
UtilitiesBL.CloneItem
PageBL.Clone
Tridion.ContentManager.ContentManagement.RepositoryLocalObject.Copy(OrganizationalItem,Boolean)
Tridion.ContentManager.BLFacade.ContentManagement.RepositoryLocalObjectFacade.Clone(UserContext,String,String,Boolean)
StructureGroup.PasteItem
As mentioned above, these are normal warnings generated in the Event log, but we should be getting a popup, not the error.
We have tried restarting the server thinking it's a one-off type of quirk, but that didn't help. I understand that "TCM54" as mentioned in the error message refers to code running through COM+. Can anyone please offer some advice?
Take a look at this post: Unable to save Publication Targets in Tridion 2011 SP1
I seem to recall that pasting uses the old (COM based) code like Publication Targets do.

What is causing intermittent "Object reference not set to an instance of an object" at compile time in VS 2010?

I am sorry if this is not really a coding question (it depends on if its my code causing the problem I suppose).
I have seen this question: Tracking down intermittent 'Object reference not set to an instance of an object.' error on build
However, it has not been of much help (although if you read the comments, you will see that I thought it did help for a while there).
When I try publish my website, occasionally, I will get an error with no file or line reference:
Pre-compiling Web Site
Building directory '/App_Code/'.
Building directory '/'.: Publication (web): Object reference not set to an instance of an object.
Pre-compilation Complete
------ Skipped Publish: Project X:\, Configuration: Debug Any CPU ------
I know the usual causes of "Object reference not set to an instance of an object" but this seems a bit different, isn't it supposed to be a runtime error? Not a build error?
What is weird is that it happens, seemingly at random (about 25%-33% of the time). I can try to publish it and have it fail. Then try again straight after, without changing anything and it works fine.
I started getting this error after moving some of my functions (VB.net btw) to a new file in the App_Code folder so they can be accessed by all pages of the site.
If you need any more info, please let me know.
Thanks,
EDIT: After further investigation, it seems to only happen if I try to publish the website within a few seconds of saving changes to any file within it. What could cause this?
The same error occurred for me to, I deleted the dlls of the custom controls in the web site that are already in the bin, then i published the web site, and succeeded
IF you have any custom/usercontrols in your project, they are actually running at design time and can give object ref errors. This can occur during builds too. In that case, a property is being referenced that is NOTHING and throws the error.
I had a similar problem with a Windows Form project.
Wherever I try to move a custom control on the windows form, and then try to save the form, VS2010 comes back with "Object not set to an instance of an object".
I suspected the error was deep down in the layers of abstraction in my inherited code, but couldn't work out how deep to go, without reviewing every line of code.
My solution to this problem is this.
Open up another instance of Visual Studio 2010
Menu: Debug | Attach to Process..
Search for "devenv.exe xxx YourApplicationName..." and select it
Click "Attach"
Menu: Debug | Exceptions..
Tick all the boxes in the thrown column, then "OK"
Your second instance of VS2010 is not debugging your first instance, including all the custom controls.
Return to the first instance of VS2010, and repeat the actions that caused the error in the first place, the second instance of VS2010 will break at the line of code that has the error.
You may want to look at this link there is a bug in vs2012
https://connect.microsoft.com/VisualStudio/feedback/details/749901/error-when-i-click-publish-object-reference-not-set-to-an-instance-of-an-object

flex3 autoupdater error

Dear all, I am working on flex3 and want to update my application by flex3 autoupdate. When my installed application runs, my checkUpdate function calls the autoUpdater code. It starts but when it reaches to 100%, it shows this error: "There was an error downloading the update. Error# 16824"
My mxml code is here http://tinypaste.com/92138b and server xml code is here http://tinypaste.com/e3792
Please guide me.
Many Thanks
Google is your friend for this one; it looks like you forgot to update the application descriptor version number in the updated version on the interweb.
http://dezeloper.wordpress.com/2010/01/21/adobe-air-updater-error-16824/
I was unable to see your code as our work router blocks tinypaste. That said, however, I can tell you that air updates done via the ApplicationUpdater class are all based upon the updater xml file that you create/copy-out-there, and the xml file used for the compiler that sets the filename, version, application ID, etc. (most of which is used for the exe-compiler/exe-wrapper that facilitates the "bridge" between the OS and your compiled actionscript code). This link, might help: dezeloper.wordpress.com.
All-in-all keep debugging. The ApplicationUpdater class is one that was relatively well-written and is pretty self-explainable... once you get past this bug, there are a couple more that might be a sync-the-xml-text pain-in-the-butt. For example... I can tell you that in AIR 1.0 (and this may still be true in recent releases) if you made a change to your application xml file, and you're compiling from eclipse/flexBuilder/flashBuilder, you had to "project > clean" for those xml options to get picked up.
Best of luck,
Jeremy

Link from ASP.NET yellow error page directly to VS source code

When an ASP.NET application errors out and generates the yellow-screen display, I'd like to create some kind of link from the error page which would jump directly to the correct line of code in Visual Studio.
I'm not sure how to approach this, or if there are any tools already in existence which accomplish it - but I'd love some feedback on where to start.
In the event that generating a new error page is necessary, is it possible to replace the standard yellow screen across an entire webserver, rather than having to configure the customized error output for each application?
You would probably need to embed an ActiveX control in the page for something like that to be possible.
The yellow screen of death is served by the default ASP.NET HTTPHandler.
In order to intercept it, you would need to add another HTTPHandler in front of it that intercepts all uncaught exceptions.
At that point, you could do whatever you want for your error layout.
Creating a way to directly jump to Visual Studio would be tricky. I could see it done in IE via a COM/ActiveX object.
The yellow screen of death is just a 500 error as far as the server is concerned, you can redirect to a custom screen using the error section of the web.config. To make a whole server change in the same manner you could probably override it at the iis level? Or perhaps even set the default behaviour in the machine.config file (not 100% sure about that one though)
The yellow screen of death is just a 500 error as far as the server is concerned, you can redirect to a custom screen using the error section of the web.config. To make a whole server change in the same manner you could probably override it at the iis level? Or perhaps even set the default behaviour in the machine.config file (not 100% sure about that one though)
If you let it bubble up all the way to IIS you will not have any way to access the Exception information. Its better to catch the Exception before the YSOD and serve your own.
This can be done at the application level.
Don't forget that you need the Program Debug Database (pdb) file to find the source code line number. An application in release mode won't have the same level of information as a debug release.
The easiest, laziest thing I could think of would be to have the process happen thusly:
The yellow screen is modified so the line is source code is clickable. When clicked it delivers a small text file with the source file name and line number.
A small program on the PC is tied to the extension of the small file the yellow screen let you download. The program uses visual studio's extensibility model to open the source file and goto that line. The program may need to know where your source code is.
A simple Google search
gives helpful pointers on how to manipulate VS with an external program such as this post on MSDN.
If you want to go snazzier, then there are certainly other methods, but I'd rather write out a quick and dirty program, and get it out of my way so I can be about my business.
Don't let the tools become projects...
-Adam

Resources