Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 615621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:14:23+00:00 2026-05-13T18:14:23+00:00

I have a file like this compiled into a dll file and placed in

  • 0

I have a file like this compiled into a dll file and placed in the bin folder

1

Imports System
Imports System.Web

Namespace Conexiones       
     Public Class sql_conexiones
       Shared Sub consulta..
           ...

By doing

from Conexiones import *

from the .aspx.py file it works fine.

I have this other file in the APP_SCRIPT in a py file (no namespaces declared)

2

import clr
clr.AddReference('System')
import System
clr.AddReference('System.Data')
from System.Data import * 
clr.AddReference('System.Web')
import System.Web

def consulta ...

By doing

from funciones import * 

from the .aspx.py file it works fine.

Now I want the code from funciones in a dll file. I have funciones.dll in the bin folder and I have

from funciones import * 

in the .aspx.py .

I get "no module named funciones" May be I have to explicity add the dll? I do

clr.AddReference("funciones.dll") 
from funciones import *

and I get "Could not add reference to assembly funciones.dll"

My question is, How do I have to do to be able to use functions in a file with code similar to #2, placed in a dll file in the bin folder in ASP.NET IronPython? The only difference I see between #1 and #2 is #1 has a namespace declared

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T18:14:24+00:00Added an answer on May 13, 2026 at 6:14 pm

    I think you have two options:

    1. Try to use AddReferenceToFile(str) or AddReferenceToFileAndPath(str). See this mail for explanation.

    2. Insert bin\ to sys.path and then try to add the reference.


    Added:

    The idea of compiling IronPython code is as follows:

    You have a file func.py:

    def one():
        return 1
    

    You compile it with pyc.py:

    C:\IronPython-2.6\ipy.exe C:\IronPython-2.6\Tools\Scripts\pyc.py /out:funciones /target:library func.py
    

    You use it in another script:

    import clr
    clr.AddReference('funciones')
    import func
    print func.one()
    

    I hope you see the difference between func and funciones 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.