Error executing version of Net Framework

S

Steven Cheng[MSFT]

You're welcome Hermawih,

Feel free to post here whenever there is anything we can help.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

Guest

Hi Steven,

I have a problem with my custom field.
Because grid view does not support long text. I created a class to show
long text for my grid view. It works locally. But when I published it as
dll, I received error message like this below:

Unknown server tag 'custom:LongTextField'.
<Columns>

Line 415: <custom:LongTextField

I created this declaration on my web form.
<%@ Register TagPrefix="custom" Namespace="TextControls"%>

Here is grid view declaration:
<asp:GridView ID="grvData" runat="server"
AllowPaging="True"
AutoGenerateColumns="False"
EmptyDataText ="No matching data."
Width="525px"
PagerSettings-Mode ="NumericFirstLast"
PageSize="10"
PagerSettings-Position ="Bottom"
PagerStyle-HorizontalAlign="Left"
OnPageIndexChanging="grvData_PageIndexChanging" >

<Columns>
<custom:LongTextField
DataField="Data"
Width="520px" Height="220px" HeaderText="Data" />
</Columns>
<RowStyle Wrap="True" />
<SelectedRowStyle Wrap="True" />
<PagerSettings Mode="NumericFirstLast" />
<PagerStyle HorizontalAlign="Left" />
</asp:GridView>

After many attempts, I finally tried to create App_code folder on my server
and put the class ( as vb file) on that folder, surprisingly the problem was
gone. My question is why publishing that class as App_Code.dll did not work
but publishing the class as vb file in folder App_code works ? I would like
to put that class as dll and not as vb file. Thanks.
 
S

Steven Cheng[MSFT]

Hello Hermawih,

Thanks for your followup.

For your custom GridView column problem, I've just performed some test in
my local environment. It seems my custom GridView (put in App_Code
directory) can be correctly used in aspx page(no matter I precompile the
site or not). My test class and the regsiter directive is very simple as
below:

========class=========
namespace GridViewColumns
{
public class SimpleGridViewField : DataControlField
{
public SimpleGridViewField()
{
}

public override void InitializeCell(DataControlFieldCell cell,
DataControlCellType cellType, DataControlRowState rowState, int rowIndex)
{
Label lbl = new Label();
lbl.ID = "lblInput";
lbl.Text = "Input: ";

TextBox txt = new TextBox();
txt.ID = "txtInput";

cell.Controls.Add(lbl);
cell.Controls.Add(txt);
}

protected override DataControlField CreateField()
{
return new SimpleGridViewField();
}
}
}
========================================

===============
<%@ Register Namespace="GridViewColumns" TagPrefix="cust" %>
===============

So I think there may have some difference between my test and your
application. Are you using the "Publish Web Site" to precompile the web
application or use "Web Deployment project" ? I've tried both cases and
the custom gridview column seems work well.

Please feel free to let me know if there is anything I missed.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

Guest

Hello Steven,

Thanks Steven.

Here were the things that I did.

1. Locally on my dekstop using VS Profesional 2005, I put the class on folder
App_Code: LongTextField.vb.
(This class is the class I adopted from a book "ASP NET 2.0" by Stephen
walther from page 554. As much as I want to upload it into this discussion
forum, I think I have no right since the code is not entirely mine. And
also, I think this problem is not related to coding problem.)

2. I built the web project and published the project on local folder.
I copied from local bin directory on that folder into bin folder on my
website ( on my provider) I received that error message when I tried to call
that web form.

3. After several failed attempts, I finally come up with the idea of
creating App_Code on my web site.
A. I deleted the App_Code.dll on bin folder.
B. I put the class longtextfield.vb on App_code folder.

I called that web form again and the problem was solved.

I have no idea what is wrong? Why the application throw me error message
when using App_code.dll but works fine when using the vb file.

But here are the facts:

A. Locally, I am using Windows XP Home edition SP2 with Microsoft Net
Framework 2.0.50727. My computer does not use IIS.
B. My Provider is using Windows server with IIS and with Microsoft Net
Framework 2.0.50727.


Steven, as my understanding, you have tried experimentation on your local
environment. Is it possible to try to upload to internet for testing, doing
the same thing as I did? I am not even sure if that will make a different.

Perhaps I should try to upload locally in different computer with IIS
installed.
This problem could be hard to detect what is the solution or what is the
root of the problem.

Best Regards,
 
G

Guest

Hello Steven,

I just realized that when I copied dll from my local bin folder into bin
folder on my web site, I have never register dll as usually I did with COM
component. Is the issue related with the registration process?

Steven, could you give me links to articles discussing,

A. Publishing component .
B. How to create separate dll for different class? I always get
App_code.dll after I publish my project even there are two vb file on
App_code folder.

I will also try to search this topics but perhaps you could get me there
faster.

Thanks Steven.
 
J

Juan T. Llibre

re:
I just realized that when I copied dll from my local bin folder into bin
folder on my web site, I have never register dll as usually I did with COM
component. Is the issue related with the registration process?

You don't need to register dll's in the bin directory.

..Net Framework assemblies have an embedded manifest
which allows applications that call them to identify them.




Hermawih said:
Hello Steven,

I just realized that when I copied dll from my local bin folder into bin
folder on my web site, I have never register dll as usually I did with COM
component. Is the issue related with the registration process?

Steven, could you give me links to articles discussing,

A. Publishing component .
 
G

Guest

Juan T. Llibre said:
You don't need to register dll's in the bin directory.

..Net Framework assemblies have an embedded manifest
which allows applications that call them to identify them.

Thanks for the information.
 
S

Steven Cheng[MSFT]

Hello Hermawih,

As Juan has mentioned, there is no need to regsiter .NET managed
assembly(as COM do). For ASP.NET application, those private (no
strong-named) assemblies can simply be put in "bin" sub dir while
strong-named assemblies can be put in GAC. And the problem in your
scenario is caused by some classes defined in App_Code class, so I don't
think this is related to your deploy steps.

BTW, there is a 'web deployment project' for ASP.NET 2.0 that can help make
application precompilation and deploy more convenient, you can try this to
see whether the problem still remains.

#Visual Studio 2005 Web Deployment Projects
http://msdn2.microsoft.com/en-us/asp.net/aa336619.aspx

and still as I mentioned previously, if possible, you can try creating a
simplified project(with just a necessary page and the class in App_code
dir) which can repro the problem. You can send it to me (through the email
in my signature by removing "online") so that I can test it locally.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

Guest

Hello Steven,

Thanks for the links. I have not learned that in detail. I will read
slowly latter.
Actually My projects is simple since It has only one form and one class and
one module.

About the problem, I think I will ignore it for the time being since It is
working anyway using the vb file. My focus right now is searching sample for
simple message board ( discussion forum) with ASP NET 2.0 and VB NET.

I have tried some of them but two of them just too advanced ( Community
server and Dotnetnuke). Of cource they are excellent but I want to have a
simple thing for me to learn. I downloaded a simple that I have in mind but
it is in C#. I have a simple thing in VB NET but it did not work. I have
pretty good sample from a book but it is in NET 1.1 and when I converted to
2.0 I can't make it work.

I am still searching for it. If you have any information about the sample
for simple discussion forum sample project with ASP NET and VB NET, please
let me know.

Once again, many thanks for your help.
 
S

Steven Cheng[MSFT]

Hello Hermawih,

I've also searched the web and did find some forum/content mangement system
framework, however, seems most of them are C# based. For C# to VB.NET code
conversion, there are many web page based code converters over web,
however, most of them can only do simple and small fragment based
conversion. So far, one of the best and free .net code conversion tool is
the reflector tool. You can first compiled the certain class and load the
assembly through reflector, then the reflector tool can help you display
diassembled code in different languages.

Hope this helps some.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top