Skip to content
DataMiner DoJo

More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
Search in posts
Search in pages
Log in
Menu
  • Blog
  • Questions
  • Learning
    • E-learning Courses
    • Open Classroom Training
    • Certification
      • DataMiner Fundamentals
      • DataMiner Configurator
      • DataMiner Automation
      • Scripts & Connectors Developer: HTTP Basics
      • Scripts & Connectors Developer: SNMP Basics
      • Visual Overview – Level 1
      • Verify a certificate
    • Tutorials
    • Video Library
    • Books We Like
    • >> Go to DataMiner Docs
  • Expert Center
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Markets & Industries
      • Media production
      • Government & defense
      • Content distribution
      • Service providers
      • Partners
      • OSS/BSS
    • DataMiner Insights
      • Security
      • Integration Studio
      • System Architecture
      • DataMiner Releases & Updates
      • DataMiner Apps
    • Agile
      • Agile Webspace
      • Everything Agile
        • The Agile Manifesto
        • Best Practices
        • Retro Recipes
      • Methodologies
        • The Scrum Framework
        • Kanban
        • Extreme Programming
      • Roles
        • The Product Owner
        • The Agile Coach
        • The Quality & UX Coach (QX)
    • DataMiner DevOps Professional Program
  • Downloads
  • More
    • Feature Suggestions
    • Climb the leaderboard!
    • Swag Shop
    • Contact
      • General Inquiries
      • DataMiner DevOps Support
      • Commercial Requests
    • Global Feedback Survey
  • PARTNERS
    • All Partners
    • Technology Partners
    • Strategic Partner Program
    • Deal Registration
  • >> Go to dataminer.services

[Protocol Connector Scripts] DLL Import in Visual Studio not working

Solved1.47K views9th April 2024dllimport QAction Visual Studio
0
Ömer Eryaman [DevOps Advocate]476 8th April 2024 0 Comments

I created a new Connector Solution Project.

During implentation I wanted to call the function (GetParameters) and there is a problem with the DLL import for my QAction.

"QAction 206"

object[] oReturnValues = (object[])protocol.GetParameters(
new UInt32[] {
Parameter.tokenstatuscodeoperator_205,
Parameter.tokenresponseoperator_206
});

VS Studio can't resolve it. (even the "Paramater.xxxx" is not defined in this contex)


QAction_Helper Parameter Class.

The DLL import is not imported, so I tried to import it. As you can see, even I try to import it is gonna unchecked after checking the import.

How can I import the DLL?
Thank you in advance.

Ömer Eryaman [DevOps Advocate] Selected answer as best 9th April 2024

5 Answers

  • Active
  • Voted
  • Newest
  • Oldest
1
Tom Waterbley [SLC] [DevOps Catalyst]8.86K Posted 8th April 2024 2 Comments

Hi Ömer,

For the code that you are showing no DLL references are needed. The Parameter class also seems to be generated correctly by DIS, so at first sight everything seems correct. Maybe doublecheck if you have a using statement with "Skyline.DataMiner.Scripting" at the top of your file.

If above doesn't help it would be very helpful to see the exact error message that you get.

Ömer Eryaman [DevOps Advocate] Selected answer as best 9th April 2024
Ömer Eryaman [DevOps Advocate] commented 8th April 2024

Thank you for your fast answer.

this is my QAction:
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;

using Skyline.DataMiner.Scripting;

///
/// DataMiner QAction Class: Create Token.
///
public static class QAction
{
///
/// The QAction entry point.
///
/// Link with SLProtocol process.
public static void Run(SLProtocol protocol)
{
try
{
object[] oReturnValues = (object[])protocol.GetParameters(
new UInt32[]
{
Parameter.tokenstatuscodeoperator_205,
Parameter.tokenresponseoperator_206
});

}
catch (Exception ex)
{
protocol.Log($”QA{protocol.QActionID}|{protocol.GetTriggerParameter()}|Run|Exception thrown:{Environment.NewLine}{ex}”, LogType.Error, LogLevel.NoLogging);
}
}
}

the auto complete is not working and the highlighting

I can’t add the picture in the comment, I will add it in the question: as an answer
I have my code and an example code and the highlighting works well in the example and the auto complete

Ömer Eryaman [DevOps Advocate] commented 8th April 2024

I added a “new answer” with an image.

Additionally, I installed the v4.8

0
Ömer Eryaman [DevOps Advocate]476 Posted 8th April 2024 0 Comments

after click on the fix button, this error message appears:

System.InvalidOperationException:
Message="Can't set the value of a read-only property."
Source="Microsoft.VisualStudio.Validation"
StackTrace:
at Microsoft.Verify.FailOperation(String message)
at Microsoft.VisualStudio.ProjectSystem.PropertyPages.PageIntProperty.SetValueAsIntAsync(Nullable`1 value)
at Microsoft.VisualStudio.ProjectSystem.PropertyPages.PageIntProperty.SetValueAsync(Object value)
at Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.Automation.OAProperty.<>c__DisplayClass22_0.<<set_Value>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.Automation.OAProject.<>c__DisplayClass73_0.<<Mutate>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.ProjectNode.<>c__DisplayClass578_0.<<Mutate>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread()
at Microsoft.VisualStudio.ProjectSystem.ProjectMultiThreadedService.ExecuteSynchronously(Func`1 asyncAction)
at ProtocolEditorShared.InfoBar.IncorrectTargetFrameworkInfoBar.FixProjectsTargetFramework()
at ProtocolEditorShared.InfoBar.IncorrectTargetFrameworkInfoBar.OnActionItemClicked(IVsInfoBarUIElement infoBarUIElement, IVsInfoBarActionItem actionItem)
at Microsoft.Internal.VisualStudio.PlatformUI.CookieTable`2.ForEach(CookieTableCallback`2 callback, Boolean skipRemoved)
at Microsoft.VisualStudio.Platform.WindowManagement.InfoBar.InfoBarViewModel.NotifyActionItemClicked(IVsInfoBarActionItem action)
at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
at System.Windows.Documents.Hyperlink.OnClick()
at System.Windows.Documents.Hyperlink.DoUserInitiatedNavigation(Object sender)
at System.Windows.Documents.Hyperlink.OnMouseLeftButtonUp(Object sender, MouseButtonEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.ContentElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

Ömer Eryaman [DevOps Advocate] Answered question 8th April 2024
0
Ömer Eryaman [DevOps Advocate]476 Posted 8th April 2024 2 Comments

I translated it with Google translator cause my VS Studio is in my native language

seems there are some packets missing ?

Ömer Eryaman [DevOps Advocate] Posted new comment 8th April 2024
Tom Waterbley [SLC] [DevOps Catalyst] commented 8th April 2024

Hi Ömer, some of the QAction projects are targeting .NET Framework 4.8 while others are targetting .NET Framework 4.6. A project cannot have a reference to another project that targets a higher .NET version. That’s the reason why your solution doesn’t build. The following link explains how to change the target version of a project: https://learn.microsoft.com/en-us/visualstudio/ide/visual-studio-multi-targeting-overview?view=vs-2022#change-the-target-framework.

Ömer Eryaman [DevOps Advocate] commented 8th April 2024

thank you for this introduction
sadly the “application-menu” is not exist by me

but i found another way to fix, after try to fixing it there is a new error message.
I will upload again an image

0
Ömer Eryaman [DevOps Advocate]476 Posted 8th April 2024 2 Comments

As u can the its not hightlight correctly and the auto completion is not showing any function "GetParameters"

Ömer Eryaman [DevOps Advocate] Posted new comment 8th April 2024
Tom Waterbley [SLC] [DevOps Catalyst] commented 8th April 2024

Hi Ömer, do you see any errors in the Error List of Visual Studio after doing a “Rebuild All”? Have you already tried to restart Visual Studio?

Ömer Eryaman [DevOps Advocate] commented 8th April 2024

I added the picture of the error messages

0
Michiel Oda [SLC] [DevOps Enabler]3.58K Posted 8th April 2024 0 Comments

Hi Ömer

You don't need the 'SLProtocolScripts.dll' for the GetParameter and the Parameter classes.

As you are working in a connector solution, you can create the QAction project by pressing the icon to the left of the QAction tag (Edit QAction option in the menu seen in your gif). This will generate the QAction project with the necessary references and NuGet packages.

Then on the solution, make sure you used the 'Restore NuGet packages' option and see if Visual Studio can build the solution.

Michiel Oda [SLC] [DevOps Enabler] Answered question 8th April 2024
Please login to be able to comment or post an answer.

My DevOps rank

DevOps Members get more insights on their profile page.

My user earnings

0 Dojo credits

Spend your credits in our swag shop.

0 Reputation points

Boost your reputation, climb the leaderboard.

Promo banner DataMiner DevOps Professiona Program
DataMiner Integration Studio (DIS)
Empower Katas

Recent questions

Web Applications exception in Cube due to invalid certificate 0 Answers | 0 Votes
Redundancy Groups and Alarming – Duplicate Alarms 0 Answers | 0 Votes
Correlation Engine: “Test rule” doesn’t result in a hit, despite functional rule 1 Answer | 3 Votes

Question Tags

adl2099 (115) alarm (62) Alarm Console (82) alarms (100) alarm template (83) Automation (223) automation scipt (111) Automation script (167) backup (71) Cassandra (180) Connector (109) Correlation (69) Correlation rule (52) Cube (151) Dashboard (194) Dashboards (188) database (83) DataMiner Cube (57) DIS (81) DMS (71) DOM (140) driver (65) DVE (56) Elastic (83) Elasticsearch (115) elements (80) Failover (104) GQI (159) HTTP (76) IDP (74) LCA (152) low code app (166) low code apps (93) lowcodeapps (75) MySQL (53) protocol (203) QAction (83) security (88) SNMP (86) SRM (337) table (54) trending (87) upgrade (62) Visio (539) Visual Overview (345)
Privacy Policy • Terms & Conditions • Contact

© 2025 Skyline Communications. All rights reserved.

DOJO Q&A widget

Can't find what you need?

? Explore the Q&A DataMiner Docs

[ Placeholder content for popup link ] WordPress Download Manager - Best Download Management Plugin