Subscribe to this thread
Home - General / All posts - Exception thrown: 'System.Exception' in extnet.dll 9.0.169.9
bdg52 post(s)
online
#25-Oct-19 13:05

I've been scripting in the script window and missed features of VS. I downloaded and installed the latest community version. I cloned and stripped down an example of a console app posted By AdamW.

I was able to establish root and application. The exception occurred in the following line.

string tech = app.GetTechnologyForFile(@"d:\temp\test.map", true);

I did do the run time update as well.

other info:

Exception thrown: 'System.Exception' in extnet.dll

An unhandled exception of type 'System.Exception' occurred in extnet.dll

Invalid API operation.

This message appeared on the console.

Unhandled exception. System.Exception: Invalid API operation.

at Wrappers.ThrowNoApiCall()

at ?A0xdab747ad.GetTechnologyForFileCore(String path, Boolean mayOpen)

at Manifold.Application.GetTechnologyForFile(String file, Boolean mayOpen)

at ConsoleApp2.Program.Main(String[] args) in D:\Users\...\ConsoleApp2\Program.cs:line 14

tjhb

8,926 post(s)
#25-Oct-19 17:08

What happens if you try without using a verbatim string?

string tech = app.GetTechnologyForFile("d:\\temp\\test.map", true);

rk
341 post(s)
online
#25-Oct-19 17:09

'Invalid API operation' can mean multiple things.

Have you read this list.

bdg52 post(s)
online
#25-Oct-19 20:10

Thanks rk, [STAThread] was the fix.

tjhb

8,926 post(s)
#25-Oct-19 20:26

I cloned and stripped down an example of a console app posted By AdamW.

Oops.

bdg52 post(s)
online
#25-Oct-19 22:24

Yeah, it was in Adam's sample but I failed.

tjhb

8,926 post(s)
#26-Oct-19 03:56

Failing is brainy.

adamw


8,750 post(s)
#26-Oct-19 13:12

Happy to hear the issue has been taken care of.

We are considering getting rid of the requirement for STAThread. This is going to happen in two steps:

Step 1. Detect when Manifold.Root is being created without STAThread and fail, but report the requirement to use STA clearly.

Step 2. Detect when Manifold.Root is being created without STAThread and initialize, but disable services which depend on STA. This is mostly clipboard.

We'll try to do at least the first step as soon as possible.

Manifold User Community Use Agreement Copyright (C) 2007-2019 Manifold Software Limited. All rights reserved.