Hi and thanks for your replay..
My plug-in was created for Revit 2018 and now I would convert it to use with 2020 version.
...
so I decided to make a last try with a new empty project.
I used the Revit 2020 wizard for create a new project. with the below standard module:
When I start debug, Revit splash screen start and after I receive the Exception error..
so I think that the problem is in some setting and not in code....
I try it with 2021 and revit start correctly...I have to try it on other pc wih Revit 2020
#Region "Imported Namespaces"
Imports System
Imports System.Collections.Generic
Imports Autodesk.Revit.ApplicationServices
Imports Autodesk.Revit.Attributes
Imports Autodesk.Revit.DB
Imports Autodesk.Revit.UI
Imports Autodesk.Revit.UI.Selection
#End Region
<Transaction(TransactionMode.Manual)>
Public Class AdskCommand
Implements IExternalCommand
''' <summary>
''' The one and only method required by the IExternalCommand interface, the main entry point for every external command.
''' </summary>
''' <param name="commandData">Input argument providing access to the Revit application, its documents and their properties.</param>
''' <param name="message">Return argument to display a message to the user in case of error if Result is not Succeeded.</param>
''' <param name="elements">Return argument to highlight elements on the graphics screen if Result is not Succeeded.</param>
''' <returns>Cancelled, Failed or Succeeded Result code.</returns>
Public Function Execute(
ByVal commandData As ExternalCommandData,
ByRef message As String,
ByVal elements As ElementSet) _
As Result Implements IExternalCommand.Execute
Dim uiapp As UIApplication = commandData.Application
Dim uidoc As UIDocument = uiapp.ActiveUIDocument
Dim app As Application = uiapp.Application
Dim doc As Document = uidoc.Document
Dim sel As Selection = uidoc.Selection
'TODO: Add your code here
Using tx As New Transaction(doc)
tx.Start("Revit")
tx.Commit()
End Using
'Must return some code
Return Result.Succeeded
End Function
End Class
#Region "Imported Namespaces"
Imports Autodesk.Revit.ApplicationServices
Imports Autodesk.Revit.Attributes
Imports Autodesk.Revit.DB
Imports Autodesk.Revit.UI
#End Region
Class AdskApplication
Implements IExternalApplication
''' <summary>
''' This method is called when Revit starts up before a
''' document or default template is actually loaded.
''' </summary>
''' <param name="app">An object passed to the external
''' application which contains the controlled application.</param>
''' <returns>Return the status of the external application.
''' A result of Succeeded means that the external application started successfully.
''' Cancelled can be used to signify a problem. If so, Revit informs the user that
''' the external application failed to load and releases the internal reference.
''' </returns>
Public Function OnStartup(
ByVal app As UIControlledApplication) _
As Result Implements IExternalApplication.OnStartup
'TODO: Add your code here
'Must return some code
Return Result.Succeeded
End Function
''' <summary>
''' This method is called when Revit is about to exit.
''' All documents are closed before this method is called.
''' </summary>
''' <param name="app">An object passed to the external
''' application which contains the controlled application.</param>
''' <returns>Return the status of the external application.
''' A result of Succeeded means that the external application successfully shutdown.
''' Cancelled can be used to signify that the user cancelled the external operation
''' at some point. If false is returned then the Revit user should be warned of the
''' failure of the external application to shut down correctly.</returns>
Public Function OnShutdown(
ByVal app As UIControlledApplication) _
As Result Implements IExternalApplication.OnShutdown
'TODO: Add your code here
'Must return some code
Return Result.Succeeded
End Function
End Class