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?
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
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>
<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?
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
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>
<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?
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"%>
[...]
)
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"%>
[...]
)
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.