Menu

#24 The namespace `ByteFX.Data' can not be found

open
nobody
None
5
2005-02-28
2005-02-28
BitEagle
No

I have included a *.cs file into an *.aspx file via

<%@language="c#" src="/portal/Mono/user.cs"
AutoEventWireup="false"
inherits="User.Registration"%>
.

The included user.cs file contains "using
ByteFX.Data;" and when i try to compile the *.aspx
file, I get the following error message:

Error
message: /var/www/portal/portal/Mono/user.cs(9,0) :
error CS0246: The namespace `ByteFX.Data' can not be
found (missing assembly reference?)

When I compile just a *.cs file with monodevelop
using ByteFX.Data it works fine.

I am very desperate because I spend a lot of time
trying to figure out, how it works. ;(

Btw I am using xsp@Debian to compile *.aspx files. My
xsp version is 1.0.0 but also 1.1.4 reports the same
error. My ByteFX.Data version is 0.76.

Any suggestions?

Discussion

  • Reggie Burnett

    Reggie Burnett - 2005-02-28

    Logged In: YES
    user_id=523261

    You need to make sure there is a reference to
    ByteFX.Data.dll for your project. You can do this using
    VS.Net. You can also do this by editing your web config

     
  • BitEagle

    BitEagle - 2005-02-28

    Logged In: YES
    user_id=1075265

    I do not have VS.NET because I am using Mono on GNU/Linux.
    Here is my web.config:

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
    <apps>
    <web-application>
    <name>dev.onNETservice.de</name>
    <vhost>localhost</vhost>
    <vport>80</vport>
    <vpath>/</vpath>
    <path>/var/www/portal</path>
    </web-application>
    </apps>

    &lt;configSections&gt;
    

    <sectionGroup name="portal">
    <section name="property"
    type="System.Configuration.NameValueSectionHandler,System" />
    <section name="property1"
    type="ByteFX.Data.Common,ByteFX.Data" />
    <section name="property2"
    type="ByteFX.Data.MySqlClient,ByteFX.Data" />
    </sectionGroup>
    </configSections>

    <portal>
    <customErrors mode="on"/>
    <compilation debug="true" />

    <authorization>
    <allow users="*" />
    </authorization>
    <authentication mode="forms" />

    <httpModules>
    <add name="AcceptEncodingModule"
    type="Mono.Http.AcceptEncodingModule, Mono.Http" />
    <add name="Portal Personalization"
    type="Personalization.UserStateModule,Personalization" />
    </httpModules>

    <pages validateRequest="false" />

    <property>
    <add key="db"
    value="DataSource=localhost;Database=test;UserID=root;Password=sibuston" />
    <add key="domain" value="onNETservice.de" />
    <add key="encoding" value="utf-8" />
    <add key="author" value="Alexander Orlov" />
    </property>
    </portal>

    <appSettings>
    <add key="MonoServerDefaultIndexFiles"
    value="home.aspx" />
    <add key="DBProviderAssembly" value="ByteFX.Data" />
    <add key="DBConnectionType"
    value="ByteFX.Data.MySqlClient.MySqlConnection" />
    <add key="DBConnectionString"
    value="DataSource=localhost;Database=test;UserID=root;Password=censored" />
    <add key="MonoServerPort" value="80" />
    <add key="MonoServerAddress" value="localhost" />
    </appSettings>

    <globalization requestEncoding="utf-8"
    responseEncoding="utf-8" />
    </configuration>

    What should I change/add here?

     
  • Reggie Burnett

    Reggie Burnett - 2005-02-28

    Logged In: YES
    user_id=523261

    Are you using code behind files? If so, when you compile
    those up, use the /r command line switch

     
  • BitEagle

    BitEagle - 2005-02-28

    Logged In: YES
    user_id=1075265

    I do not have VS.NET because I am using Mono on GNU/Linux.
    Here is my web.config:

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
    <apps>
    <web-application>
    <name>dev.onNETservice.de</name>
    <vhost>localhost</vhost>
    <vport>80</vport>
    <vpath>/</vpath>
    <path>/var/www/portal</path>
    </web-application>
    </apps>

    &lt;configSections&gt;
    

    <sectionGroup name="portal">
    <section name="property"
    type="System.Configuration.NameValueSectionHandler,System" />
    <section name="property1"
    type="ByteFX.Data.Common,ByteFX.Data" />
    <section name="property2"
    type="ByteFX.Data.MySqlClient,ByteFX.Data" />
    </sectionGroup>
    </configSections>

    <portal>
    <customErrors mode="on"/>
    <compilation debug="true" />

    <authorization>
    <allow users="*" />
    </authorization>
    <authentication mode="forms" />

    <httpModules>
    <add name="AcceptEncodingModule"
    type="Mono.Http.AcceptEncodingModule, Mono.Http" />
    <add name="Portal Personalization"
    type="Personalization.UserStateModule,Personalization" />
    </httpModules>

    <pages validateRequest="false" />

    <property>
    <add key="db"
    value="DataSource=localhost;Database=test;UserID=root;Password=sibuston" />
    <add key="domain" value="onNETservice.de" />
    <add key="encoding" value="utf-8" />
    <add key="author" value="Alexander Orlov" />
    </property>
    </portal>

    <appSettings>
    <add key="MonoServerDefaultIndexFiles"
    value="home.aspx" />
    <add key="DBProviderAssembly" value="ByteFX.Data" />
    <add key="DBConnectionType"
    value="ByteFX.Data.MySqlClient.MySqlConnection" />
    <add key="DBConnectionString"
    value="DataSource=localhost;Database=test;UserID=root;Password=censored" />
    <add key="MonoServerPort" value="80" />
    <add key="MonoServerAddress" value="localhost" />
    </appSettings>

    <globalization requestEncoding="utf-8"
    responseEncoding="utf-8" />
    </configuration>

    What should I change/add here?

     
  • BitEagle

    BitEagle - 2005-02-28

    Logged In: YES
    user_id=1075265

    I am using

    <%@language="c#" src="/portal/Mono/user.cs"
    AutoEventWireup="false"
    inherits="User.Registration"%>

    => not codebehind but src;

    But I can also use the codebehind parameter if you think,
    it is better. How can I supply the "/r command line
    switch" when I compile my *.aspx file automatically?
    In the moment if I use the codebehind parameter I get the
    following error message:

    Error message: Cannot find type User.Registration

    (The *.aspx file is:

    <%@language="c#" src="/portal/Mono/user.cs"
    AutoEventWireup="false"
    inherits="User.Registration"%>
    [...]
    )

     
  • BitEagle

    BitEagle - 2005-02-28

    Logged In: YES
    user_id=1075265

    Oops, sorry: not SRC but CODEBEHIND:

    In the moment if I use the codebehind parameter I get the
    following error message:

    Error message: Cannot find type User.Registration

    (The *.aspx file is:

    <%@language="c#" codebehind="/portal/Mono/user.cs"
    AutoEventWireup="false"
    inherits="User.Registration"%>
    [...]
    )

     
  • Nobody/Anonymous

    Logged In: NO

    hi I found that when you want to reference this, you need to
    add a reference to the dll in Visual Studio (using VS2k3e).
    Once you have done that the object model is available.

    If using visual studio, go to references, right click select add
    reference and browse to the dll. That should solve your
    problem.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.