Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ODBC need runding under x86 #620

Closed
stevenkc opened this issue May 5, 2021 · 1 comment
Closed

ODBC need runding under x86 #620

stevenkc opened this issue May 5, 2021 · 1 comment

Comments

@stevenkc
Copy link

stevenkc commented May 5, 2021

System.Data.Odbc.OdbcException (0x80131937): ERROR [IM014] [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application

How to run dotnet script xxx.csx under the 32bit runtime?

Can I run it like "dotnet script script.csx -r win-x86"?

@filipw
Copy link
Member

filipw commented May 5, 2021

it is not supported in a script mode, but you can compile into an exe.
For example the following script:

Console.WriteLine(System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture);

would return X64 when running as dotnet script main.csx:

C:\code\csx\odbc>dotnet script main.csx
X64

But you could compile it:

C:\code\csx\odbc>dotnet script publish main.csx -r win-x86
Published C:\code\csx\odbc\main.csx (executable) to C:\code\csx\odbc\publish\win-x86

then when invoking the compile main.exe would print x86:

C:\code\csx\odbc>publish\win-x86\main.exe
X86

@filipw filipw closed this as completed May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants