Revit Addin Template2020 - revit-api

I used the Revit Add-In Template but when I run the application I get this error. Do you know why I am getting this error?
the error I get is Revit cannot run ExternalApplication.
do you know why it cannot run the External Application?
The Error Message
External Tools- External Tool Failure = Revit Cannot run External application "Application NewRibbon01"

This message indicates that you have installed an add-in manifest *.addin file in the Revit AddIns folder that refers to an external application NewRibbon01 that cannot be loaded for some reason.
One possible reason is that it cannot be found.
For instance, the add-in .NET DLL assembly file may not be located in the same AddIns folder, or an invalid path to the add-in DLL may have been specified.
Please read and follow the basic information about Revit add-in integration in the Revit developers guide. It explains in full how to set up your add-in manifest correctly.
The previous link refers to the Revit 2022 developer guide. The same information applies to Revit 2020 as well: Revit 2020 add-in integration
The easiest way to get to grips with the fundamentals of Revit add-in installation, framework architecture and more advanced usage is to work through the Revit API getting started material. That will answer this question of yours in full and innumerable others as well.

Related

Is there a simple "hello world" sample Office 365 Excel add-in guide?

Is there a simple "hello world" sample for coding an Office 365 Excel add-in that I can follow and customize?
I am assuming that you would like to build an Excel add-in that can be run in Windows/Mac and Online. So you could use Yeoman generator to build "hello world" sample code easily. The Yeoman generator creates a Node.js project that can be managed with Visual Studio Code or any other editor, whereas Visual Studio creates a Visual Studio solution. Select the tab for the one you'd like to use and then follow the instructions to create your add-in and test it locally.
This article will walk you through the process of building an Excel Taskpane Add-in in Yeoman generator.
You could also explore API capability using Script Lab.
Script Lab is a useful tool for anyone who wants to learn how to develop Office Add-ins using the Office JavaScript API in Excel, Word, or PowerPoint. It provides IntelliSense so you can see what's available and is built on the Monaco framework, the same framework used by Visual Studio Code. Through Script Lab, you can access a library of samples to quickly try out features or you can use a sample as the starting point for your own code. You can even use Script Lab to try preview APIs.
Well it depends on what you mean by an Excel add-in I guess. There are a lot of options here.
If you're talking about a simple add-in written in VBA, which doesn't require any additional tools to get started, there are lots of tutorials available online.
You could take a look at this simple getting started tutorial:
How to Create and Use an Excel Add-in
If you want to know more about there is to developing office (excel) add-ins i'd encourage you to take a look at the developer docs from microsoft:
https://learn.microsoft.com/en-us/office/dev/add-ins/
https://learn.microsoft.com/en-us/office/dev/add-ins/excel/
The nice thing about this approach is that it's designed to be cross-platform and enables you to create add-ins by using web dev technology. If you're more interested in using visual studio and VB.NET / C# I'd start by exploring the VSTO Add-ins route. Start at the docs or use google for getting started tutorials yourself. The VSTO docs can be found here:
https://learn.microsoft.com/en-us/visualstudio/vsto/excel-solutions?view=vs-2019
Or jump right in and start here: https://learn.microsoft.com/en-us/visualstudio/vsto/walkthrough-creating-your-first-vsto-add-in-for-excel?view=vs-2019
There are three common ways to create an Excel 365 JavaScript Add-in:
(1) You could use the Yeoman Generator (with Visual Studio Code)
(2) You could use the Office Templates (with Visual Studio 2019)
(3) You could use NPM and Webpack (with Notepad)
You can find simple "Hello World" examples of all three here:
https://bettersolutions.com/javascript/excel-api/index.htm

Office VSTO Add-ins vs Office Add-ins using Office JS API

Recently Microsoft introduced the Office Add-ins architecture which allows for developing add-ins hosted remotely and run within IFrames inside office. I have read a lot trying to understand whether this architecture is meant as a replacement for VSTO or do they have separate use-cases. VS 2015 has templates for both.
In my specific case, I want to develop an add-in that extends Excel 2016 with custom import functionality (e.g. custom CSVs, TSV, or even XLSX). I can't tell which type of project I should go with.
Given the amount of legacy applications developed as COM and VSTO add-ins I find it hard to believe Microsoft would drop support within the next 10 years.
For me the most important differentiators of one approach vs. the other are:
COM/VSTO Office add-ins
Access to complete object model
Local machine interaction, e.g. file system
Available on Windows since Office 2007
JavaScript Office Add-ins
Portable between Windows, OS X, iOS etc. (not complete everywhere yet though)
Easy integration with online services
Easy distribution, no need to worry about installers
In your case I'd ask myself these questions:
Will there be a need to support other platforms besides Windows in the future? > JavaScript API
Are the requirements covered by the current JavaScript API implementation?
I've found that VSTO isn't 100% implemented either. I've given up developing VSTO for Project, got hit by too many issues. Instead I've developed everything in VBA and have perfected some neat ways to install, distribute and update VBA macros.

How do you prevent Visual studio code analysis from running on a dll?

A project contains a runtime callable wrapper generated from a COM dll. I have Code analysis rules enabled on the project. The problem is that VS runs code analysis on the RCW dll too!
How do I stop VS from running code analysis only for that dll?
Turns out that I wasn't looking hard enough.
To disable code analysis on generated code, open the project properties page, go to the Code Analysis tab and check the Suppress results from generated code (managed only) check box.
MSDN link

Could not load file or assembly 'Microsoft.Xrm.Client

I have created a plug-in in CRM. It’s registered successfully. Inside my plug-in I have created a web service with many functions.
After successful calling of plug-in step I am getting error-
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Xrm.Client, Version=5.0.9689.2166, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies`. The system cannot find the file specified.
To solve this issue I have created the New XRM.cs file from crmsvcutil.exe but got the same issue. Searched more about this but no solutions found yet.
NOTE: I am using the Microsoft hosted version of CRM
Here below the reference files which I am using.
microsoft.crm.sdk.proxy
Microsoft.CSharp
microsoft.xrm.client
microsoft.xrm.portal
microsoft.xrm.sdk
System
System System.Core
System.Data
System.Data.Services
System.Data.Services.Client
System.DirectoryServices.AccountManagement
System.Runtime.Serialization
System.ServiceModel
System.Xml
System.Xml.Linq
Is there any way to run my plugin on Hosted version of CRM???
Appreciate if any help :)
I have solved this issue by using this command.
CrmSvcUtil.exe /out:"Xrm.cs"
/url:http://crm/Contoso/XRMServices/2011/Organization.svc
/namespace:Xrm
/servicecontextname:XrmServiceContext
/servicecontextprefix:Xrm
removing code customization options solved my issue.
/codeCustomization:"Microsoft.Xrm.Client.CodeGeneration.CodeCustomization, Microsoft.Xrm.Client.CodeGeneration"
Microsoft.XRM.Client is usually not needed by the plug-in.
It is needed to connect to CRM from an outside application.
Microsoft.XRM.Client has been removed from the SDK since CRM 2016.
Plugins do not automatically resolve dependencies in your project, they have to already be on the server.
Microsoft.XRM.Client can be placed in the GAC if it is needed by the plugin.
Update for Dynamics CRM 2015
The NuGet package Microsoft.CrmSdk.Extensions contains Microsoft.Xrm.Client.
Update for Dynamics CRM 2016 and Dynamics 365
Microsoft.Xrm.Client is no longer part of the SDK.
The NuGet package Microsoft.CrmSdk.CoreAssemblies contains everything needed for plugin development.
The various parts of the Dynamics CRM SDK are in NuGet.
NuGet is a much better solution than adding Dynamics CRM dlls as project references; especially for source control and team development.
Microsoft.Xrm.Client.dll doesn't actually appear to work if running from the GAC. This is because of some dodgy type resolution methods it has that only work if the assembly is loaded locally. I have raised an issue with full details about that here: https://community.dynamics.com/crm/f/117/t/144464.aspx

How to patch .NET dll to the GAC using InstallShield QuickPatch?

I'm trying to patch a .NET DLL file using the Quick Patch project of InstallShield. The DLL needs to be registered for COM Interoperation.
When I patch the file, the dll seems to be replaced correctly in the GAC, but when I try to access it from my application I get an error indicating that the application cannot connect to the DLL.
I think that it is not being registered properly for COM interop, but I'm not sure about it.
Any idea of what should I do to make it work?
Thanks,
You probably have to run regasm(it's in .NET framework directory) with correct params to register for com interop. Also the DLL file is usually built with certain COM visible options selected. Been a long time since I dealt with that nightmare though, so can't remember all the details.
http://msdn.microsoft.com/en-us/library/tzat5yw6(v=vs.80).aspx

Resources