Error started after updating to CRM 2015. Using the new 2015 SDK, the following command:
CrmSvcUtil.exe /url:https://<organizationUrlName>.api.crm.dynamics.com/XRMServices/2011/Organization.svc /out:<outputFilename>.cs /username:<username> /password:<password> /namespace:<outputNamespace> /serviceContextName:<serviceContextName> /generateActions
Returns the following error:
Exiting program with exception: Could not load file or assembly 'Microsoft.Xrm.Sdk, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
It asks for Version 6 but if I try to run SDK 2013 I get the same error asking for version 7.
Any idea how to get it to work?
Thanks in advance
It's a bug inside the CRM 2015 SDK.
Currently you need to use the CrmSvcUtil.exe from SDK 2013 if you run the command against a CRM 2013 instance and the CrmSvcUtil.exe from SDK 2015 if you run the command against a CRM 2015 instance.
Related
When I am trying to create a Xamarin project I get the following error:
Could not load the file or assembly 'Xamarin.VisualStudio.Contracts',Version=16.8.4.0, Culture=neutral,
PublicKeyToken=0738eb9f132ed756'3 or one of its dependencies. The system cannot find the file specified
I am unable to use the Add... REST API Client... option in Visual Studio 2015 with all the latest updates and Azure Tools v2.9 installed. When I select the option I am presented with the proper dialog to provide either a url or the file path for the swagger json file. Regardless of which option I select I get the following error message:
Generating client code and adding to project started
Generate client code for REST API with following parameters:
REST API Name: ToDoListAPIClient, Base namespace: ToDoListAPI, Metadata file path: C:\Users\ken\AppData\Local\Temp\WebToolsAutoRest\ToDoListAPIClient\201702032141192827\swagger.json
Exception: Could not load file or assembly 'Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.
Generating client code and adding to project failed
Adding REST API client for failed
How can I resolve this problem?
Make sure you download the proper version of the Newtonsoft.Json package by running the command:
PM> install-package Newtonsoft.Json -Version 7.0.1
Then copy the Newtonsoft.Json assembly (version 7.0.0.0) to C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE.
This should work around the issue.
I got the same problem as Build Error + Creating VSTO addin for excel 2010
After making the change according to the solution, I got the new error:
The "InitializeDefaultProperties" task could not be loaded from the
assembly
Microsoft.VisualStudio.Tools.Office.BuildTasks, Version=11.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. Could not load file or
assembly 'Microsoft.VisualStudio.Tools.Office.BuildTasks,
Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one
of its dependencies. The system cannot find the file specified. Confirm
that the <UsingTask> declaration is correct, that the assembly and all its
dependencies are available, and that the task contains a public class that
implements Microsoft.Build.Framework.ITask.
I have installed VS2013 on the same machine so I change version=12.0.0.0 but I got a new error:
Error 2 The "SetInclusionListEntry" task could not be instantiated from
the assembly "Microsoft.VisualStudio.Tools.Office.BuildTasks,
Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Please verify the task assembly has been built using the same version of
the Microsoft.Build.Framework assembly as the one installed on your
computer and that your host application is not missing a binding redirect
for Microsoft.Build.Framework. Unable to cast object of type Micro
soft.VisualStudio.Tools.Office.BuildTasks.SetInclusionListEntry' to type
'Microsoft.Build.Framework.ITask'.
I know it's an old post, but maybe I have a solution for you...
I ran into exactly the same problem and I have to tell you that the "InitializeDefaultProperties" exception is not fix-able for VS2010.
First of all:
Make sure that your Visual Studio 2010 installation is not modified, anyway make a clean install just to be sure.
If you modified the C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets revert your changes.
If you now try to build your VSTO Project the following error should apppear:
The "FindRibbons" task could not be loaded from the assembly
Microsoft.VisualStudio.Tools.Office.BuildTasks, Version=10.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. Could not load file
or assembly 'Microsoft.VisualStudio.Tools.Office.BuildTasks,
Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or
one of its dependencies. The system cannot find the file specified.
Confirm that the <UsingTask> declaration is correct, that the
assembly and all its dependencies are available, and that the task
contains a public class that implements
Microsoft.Build.Framework.ITask.
My Solution:
--> Open Visual Studio 2010 (you dont need to load a Project)
--> Go to Help an click About Microsoft Visual Studio
--> Check Version
Microsoft Visual Studio 2010 Version 10.0.40219.1 SP1Rel Microsoft
.NET Framework Version 4.5.51209 SP1Rel
If it says RTMRel download the Microsoft Visual Studio 2010 SP1 from here: http://go.microsoft.com/fwlink/?LinkId=210710
It includes the necessary VSTO and VSTO 4.0 Runtime.
If thats not the Problem, I'm sorry...
As I encountered the same problem upgrading our build server... I am gonna put the solution here in case anyone needs it.
I think the way to solve this is to fix your GAC.
Open the .target file of that tool by notepad and take a look at the UsingTask tag, you should get something like
<UsingTask TaskName="InitializeDefaultProperties" AssemblyName=" Microsoft.VisualStudio.Tools.Office.BuildTasks", Version=11.0.0.0,..., PublicKeyToken=sthsthsth
Then, go to your GAC files, e.g. C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.VisualStudio.Tools.Office.BuildTasks
Then, create a new folder: v4.0_11.0.0.0_sthsthsth,
which is:
v<.NETFramework Version, mostly 4.0>_<Assembly Version>_<PublicKeyToken>
And then, put the .dll file of Microsoft.VisualStudio.Tools.Office.BuildTasks in it.
This dll should be obtained when you install VSTO either by directly install (VSTO2010) or by Visual Studio installer
e.g.
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft\VisualStudio\v15.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.BuildTasks.dll
for Visual Studio 2017 and then directly place the dll inside the folder created
Then this issue should be fixed. Good luck
I have a clean, Windows 7 x64 box setup to build and run Windows Phone 7 projects. I installed Windows Phone Developer Tools 7.0, January 2011 Update and Windows Phone Developer Tools Fix as per the MSDN App Hub page. My WP7 applications build fine in VisualStudio, yet when I try to use MSBuild.exe, even on the simplest Visual Studio project
c:\Windows\Microsfot.NET\Framework64\v4.0.30319\MSBuild.exe .\SimpleWP7.sln
I get the following errors (with added space between lines for readability)
... verbose.output ...
C:\Program Files
(x86)\MSBuild\Microsoft\Silverlight
for
Phone\v4.0\Microsoft.Silverlight.Common.targets(185,9):
error MSB4018: The "CompileXaml" task
failed unexpectedly.\r
[C:\Users\alasdair.mccall\vs_workspace\SimpleWP7\SimpleWP7\SimpleWP7.csproj]
C:\Program Files
(x86)\MSBuild\Microsoft\Silverlight
for
Phone\v4.0\Microsoft.Silverlight.Common.targets(185,9):
error MSB4018:
System.IO.FileLoadException: Could not
load file or assembly
'PresentationCore, Version=3.0.0.0,
Culture=neutral,
PublicKeyToken=31bf3856ad364e35' or
one of its dependencies. The given
assembly name or codebase was invalid.
(Exception from HRESULT: 0x80131047)\r
[C:\Users\alasdair.mccall\vs_workspace\SimpleWP7\SimpleWP7\SimpleWP7.csproj]
C:\Program Files
(x86)\MSBuild\Microsoft\Silverlight
for
Phone\v4.0\Microsoft.Silverlight.Common.targets(185,9):
error MSB4018: File name:
'PresentationCore, Version=3.0.0.0,
Culture=neutral,
PublicKeyToken=31bf3856ad364e35'\r
[C:\Users\alasdair.mccall\vs_workspace\SimpleWP7\SimpleWP7\SimpleWP7.csproj]
...
What am I missing here? I have Silverlight 3 and 4 installed and I've installed everything as documented on the App Hub. Please let me know if there is any additional information required.
Cheers,
Alasdair.
I was using the wrong msbuild executable, I should have been using
c:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
I'm unsure why, on Windows 7 64bit I should've been using what appears to be msbuild for 32bit applications. Thanks to #keyboardP for directing me to Visual Studio command prompt which helped diagnose this.
I just installed Sharepoint 2010 stand-alone on Windows 7 and I'm trying to deploy a web part by simply selecting Build->Deploy. The web part doesn't contain anything; I just wanted to test if I can at least deploy an empty one.
Here's the output I get before Visual Studio crashes with "Visual Studio has encountered a problem and needs to close":
------ Deploy started: Project: SharePointProject3, Configuration:
Debug Any CPU ------ Active Deployment
Configuration: Default
Run Pre-Deployment Command: Skipping
deployment step because a
pre-deployment command is not
specified.
Recycle IIS Application Pool:
Skipping application pool recycle
because no matching package on the
server was found.
Retract Solution: Skipping package
retraction because no matching package
on the server was found. Add Solution:
This is the entry in the application log:
Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
Stack:
at EnvDTE.ProjectItem.get_Properties()
at Microsoft.VisualStudio.SharePoint.ProjectUtils.GetFullPath(EnvDTE.ProjectItem)
at Microsoft.VisualStudio.SharePoint.HierarchyItem.get_FullPath()
at Microsoft.VisualStudio.SharePoint.ProjectMember.get_FullPath()
at Microsoft.VisualStudio.SharePoint.ProjectExtensions.VSPackage.WebPartCommon.b__0(Microsoft.VisualStudio.SharePoint.ISharePointProjectItemFile)
at System.Linq.Enumerable+WhereEnumerableIterator1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext()
at Microsoft.VisualStudio.SharePoint.ProjectExtensions.VSPackage.ProjectItemTypeProvider.HasAnyFileChanged(System.Collections.Generic.IEnumerable1)
Does anyone have an idea what the problem could be?
I ended up reinstalling VS2010. Now it works.