WorkFlow designer fails to load in VS 2013 - workflow

We are using Work Flow's in our project and it is developed in VS 2010. Recently we migrated to VS 2013 Professional. Now when we try to open a Work Flow Activity in VS 2013, we get the following error message:
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.SharePoint.WorkflowExtensions, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. File name: 'Microsoft.VisualStudio.SharePoint.WorkflowExtensions, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'"
We could find the "Microsoft.VisualStudio.SharePoint.WorkflowExtensions.dll" under "C:\Program Files\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\WorkflowDesigner", but still when we open the WF designer, we get the FileNotFound exception.
When we close and open the WF again, we get the below error message :
System.ArgumentException: An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at Microsoft.VisualStudio.Activities.EditorPane.set_FileName(String value)
at Microsoft.VisualStudio.Activities.EditorPane.Microsoft.VisualStudio.Shell.Interop.IPersistFileFormat.Load(String fileName, UInt32 formatMode, Int32 readOnly)
Any idea what is causing the issue?

The exception is related to missing Workflow Manager or Workflow Manager Tools on the machine which might not have installed successfully with VS installation at first.
However, you can fix this issue by installing/reinstalling them and dependencies. You might need to restart the machine as well.
Here is the link to download the installers separately: http://www.microsoft.com/en-my/download/details.aspx?id=35375

Looks like we got the root cause now. There were some internet restrictions imposed on the PC's when VS 2013 was installed for which some of the WF related stuffs didn't get downloaded/updated properly.
We tried to re-install VS 2013 without Internet restrictions, and things started to work fine.
Hope this helps someone in need. :)

This worked for me: my workflow was referencing a custom activity I did not have in the /bin folder. Once I placed that custom activity (.dll) into the bin folder, I had no problems.

Related

Connecting DevExpress XtraReports with PostgreSQL in Visual Studio

I have DevExpress XtraReports v18.1.6 version and PostgreSQL 4 v3.3. Visual studio 2017 v15.3.3 and Windows 7.
Here is scenario: In my project, I have some reports writen in devexpress v17.2. I could not run those reports, because I could not download exactly that version 17.2, I install new 18.1.6. Then in Visual studio main menu "DevExpress" I click on "Project converter to 18.1.." and that action replace my old dlls v17.2 with new 18.1. After that I could run reports (see it in designer).
But problem is with databse connection. I created connection string with "XpoProvider=Postgres".
Every time when I want to get data in report, or rebuild result shema, or manage queries I get error:
Could not load file or assembly 'System.Threading.Tasks.Extensions, Version=4.2.0.0,...
I have that reference, exactly that version. Also I tried with new versions of threading.tasks but unsuccessfully.
My version of Npgsql.dll was 2.2.7, I tried with 3.2.5 (read from some devexpres documentations). Also tried with new 4.0.3.
Did anyone have a similar problem?
we had the same issue when using the DevExpress (18.1) Report Designer with Visual Studio 2017.
I know this might not be an ideal or the best solution but at least it worked for us:
I used ProcMon to determine where it was looking for that specific File, for me it turned out to be C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\Extensions\hhfnlhs1.kna
I downloaded the NuGet Package for System.Threading.Tasks.Extensions from NuGet (https://www.nuget.org/packages/System.Threading.Tasks.Extensions/)
I unzipped the Package and stored the DLL at that path from step 1
I had to active "loadFromRemoteSources" in my machine-config (see https://learn.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/dd409252(v=vs.100))
I had to put another DLL from NuGet (https://www.nuget.org/packages/System.Runtime.CompilerServices.Unsafe/4.5.2) into that folder from step 1
That's it - now I can access the DB again.

Visual Studio 2015 Nuget "There is no working folder mapping" Error

When adding the media services nuget package, VS 2015 is giving me errors about having no working folder mapping, then rolls back.
Here is an example of the message:
There is no working folder mapping for C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\lib\net45.
When I open the same solution from VS 2013, it works as expected.
Does anyone know how to resolve the error is VS 2015, or perhaps why it doesn't work there but does work in VS 2013?
(In VS 2015, I opened the solution by browsing to the sln file locally - not by retrieving the solution from source control.)
This is a known bug: https://github.com/NuGet/Home/issues/1004 Use Visual Studio 2013 for now. In the rush to get it out, Microsoft released a product that was not ready, even though technically this is a NuGet issue.
Not a long term solution, but I unbound from TFS, added the packages I needed, then rebound.
Try to unbound the solution and projects in TFS before updating the nuget packages.
To unbound try this
You should be able to avoid the error if you unbound from TFS. To unbound, go to File->Source Control->Advance->Change Source Control. Select the project and click on the Unbound button\link at top.

Entity Data Model Wizard crashes on Specify connection string dialog

Whenever I try to add an entity data model in Visual Studio 2013 on Windows 8.1 I see the following.
Does anybody have an idea how to fix this? I see the dialog to specify a database connection appear for a split second then dissapears.
I found a solution. Go into view->Server Explorer and remove any "Data Connections". Then this worked again.
I solved it by doing the following.
Make sure the versions of MySql.Data, MySql.Data.Entities, MySql.Web dll files in C:\Program Files (x86)\MySQL\MySQL Connector Net x.x.x\Assemblies\v4.5 and C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PrivateAssemblies are the same.
Make sure your project references the same version of dll
In my case my
MySql connector was 6.9.6
C:\Program Files (x86)\MySQL\MySQL Connector Net x.x.x\Assemblies\v4.5 and C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PrivateAssemblies had it as 6.8.3
Project referenced 6.8.3.
After updating all versions with same dlls, now I am able to update the "Model from database"
Hope this helps someone
Edit: A few weeks after there was some windows update which again screwed up the settings. To resolve it, I had to re-run the My Sql Connector installation and My Sql for Visual Studio, it worked fine after that.
Delete all connections in the Database Explorer Window and in the ADO .Net wizard add a new connection. I was able to solve this problem this way.
you have to delete all other connection from server explorer and delete other connection ss web.config
I Had a similar problem, spent 2 days trying many solutions but I finally solved. I just had to :
- Install MySQL For Visual Studio 2.0.5
- uninstall and install MySQL Connector 6.9.9
Note: Please follow the order VS => Connector and respect the version.
Finally I faced other problem and solved by adding an empty emdx first then changing SSL Generate Template property from SSDLToSQL To SSDLTOMySQL
Install MySql for VS 1.2.9
Install MySql Connector 6.8.3
Add these Nuget Packages to your Project:
EntityFramework // 6.4
Mysql.Data // 6.8.8
Mysql.Data.Entities // 6.8.3
Mysql.Web // 6.8.8
In the Solution Explorer, edit App.config(Add or Replace):
<entityFramework>
<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity.EF6" />
<providers>
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6" />
</providers>
</entityFramework>
rebuild and nothing more
For Anyone having this issue in VS 2019. This is what I did after a week long troubleshooting and googling, I just remove:
EntityFramework
MySql.Data.Framework or MySql.Data (or any other MySQL Nugget Packages you have added)
Then I re-install just this two in same order:
EntityFramework
MySQL.Data.EntityFramework
Then Update you entityframework section in app.config/web.config as follows:
I did not add default connection factory, I also remove version info from MySQL

FxCop indirect reference to System.Core version 2.0.5.0

I've got a project that uses Autofac, and the WebAPI integration
We run FxCop over our solution, and on opening autofac, I get the following:
The following indirectly-referenced assembly could not be found. This
assembly is not required for analysis, however, without it, analysis
results could be incomplete. This assemble was referenced by
Autofac.dll
System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes
This causes the following error on our CI server:
FxCop return code (516): PROJECT_LOAD_ERROR ASSEMBLY_REFERENCES_ERROR
Is there a way to tell FxCop to ignore this?
Had the same issue with AutoMapper 3.1.0 on our project. The real problem is an old version of FxCop. The last official release was FxCop 10.0, but new versions of FxCop have been bundled with Visual Studio since 2012.
I just replaced the FxCop 10.0 with the version that can be found in:
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Team Tools\Static Analysis Tools\FxCop
or
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Team Tools\Static Analysis Tools\FxCop
and the problem was solved.
This is a common FxCop thing when running with Portable Class Libraries. It's not Autofac; you just happen to see it because Autofac is the only PCL you're using. In my experience, this error doesn't seem to happen if you're building on a Windows 8 machine, but on Windows 7 or Server 2008R2 I see this a lot.
It's not a bug, and no, you won't find 2.0.5.0 on your machine. That version is actually for Silverlight and runtime .NET "stuff" handles redirection to the right assembly version. Unfortunately, FxCop is less cooperative.
I see the same thing in my build and solved it using the suggestions from questions like this: How to fix FxCop error code 512?
You must add a reference to the assembly's directory in the FxCop project file. For instance:
<Targets>
<AssemblyReferenceDirectories>
<Directory>C:/Windows/Microsoft.NET/assembly/GAC_MSIL/Microsoft.Web.Infrastructure/v4.0_1.0.0.0__31bf3856ad364e35/</Directory>
<Directory>C:/Windows/Microsoft.NET/assembly/GAC_MSIL/System.Web.Mvc/v4.0_3.0.0.0__31bf3856ad364e35/</Directory>
</AssemblyReferenceDirectories>
Workaround for this issue is to copy the missing System.Core.dll to the project output directory. I made this as a postbuild event to copy System.Core.dll from a shared folder to project\bin directory.
You can get the copy of System.Core.dll from the Silverlight SDK 2 installation.
Now fxcop runs successfully without any issues. Note that I was using Fxcop integrator for Visual Studio 2010.

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Xrm.Client

I am stuck on this exception already for two days.
I am using MS CRM 2011, and got this exception when I try to register CRM custom worklow activity assembly
1. through pluginregistrator tool,
2. or when I deploy the plugin though package project in Visual Studio and after it run the the workflow, and it stops with waiting status, in the details page giving this expcetion. Here is the detailed exception:
Workflow paused due to error: Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Xrm.Client, Version=5.0.9688.1154, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
at ArmenianSoftware.Crm.Spayka.ArmsoftIntegration.Workflows.CreateWorksByPlan.Execute(CodeActivityContext executionContext)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
I am registering assembly on the file system, I have loaded all needed assemblies in the folder %system root%\C$\Program Files\Microsoft Dynamics CRM\Server\bin\assembly. This workflow worked some time, but after I don't know what, next time I deployed the assembly, I got this exception when executing the workflow. This is already third time I am coming across this problem, and spoiling several hours trying to do different things (IIS reset, Async Service restarts, reloading all the assemblies again and redeploying), and after several hours, in a mysterious way, the workflow starts to work. After this works some time, and after some redeployment crashes again. And I can't determine after exactly what steps I solve the problem, and so I spend always several hours on finding out the exception source but to no purpose.
I have looked through some threads in the web but none of them was my case (here are they thread1 , thread2 , thread3)
Have anybody come across this problem? What is the reason of this exception??
Thanks in advance!
I have found the problem in my case!
First thing I have noticed was that the in the Exception the required version of the Microsoft.Xrm.Client assembly was 5.0.9688.1154, but in my project I have the reference to the assembly of version 5.0.9689.1985.
And the next thing was the open ildasm tool, and look what referenced does it have, I opened my custom workflow assembly and I've found that I have two references to Microsoft.Xrm.Client,
first of version 5.0.9688.1154, and the second: 5.0.9689.1985
And a question arose "If I have referenced a assembly the version of wich is 5.0.9689.1985, why there is another version of this assembly? ". And the answer was, definitely, that I had another referenced assembly, which referenced Microsoft.Xrm.Client assembly with version 5.0.9688.1154. I have looked through the assemblies I have reference to in my project. And GOTCHA! In my project I have updated the SDK asseblies to a newer version, but I also had the generated CRM organization Proxy classes assembly, which references Microsoft.Xrm.Client, and I haven't updated this reference to a newer version of CRM SDK. So my custom workflow assembly also needed this version. I changed the references of Proxy dll to newer version, and everything went OK!
If you are reading this post, and you don't have proxy assembly, check your other assemblies, if they all reference the same version of the CRM SDK, if not correct them!
Regards
Gagik Kyurkchyan