CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > visual_studio.visual_studio_2005 Tags:
Item Type: NewsGroup Date Entered: 6/23/2005 2:30:56 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 6 Views: 26 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
7 Items, 1 Pages 1 |< << Go >> >|
thermalnoise
Asp.Net User
V1.1 to Beta 2 - Namespaces Not Recognized6/23/2005 2:30:56 PM

0/0

We are attempting to test out a website written in VS2003/.Net 1.1 in VS2005 Beta 2/.Net 2.0.  Our main problem at this point is that certain classes are not being recognized when they are referenced in other files not in the same directory as the class file.

Example:

A Framework.cs file under \Applications is inherited by several other webpages. It resides under the namespace Company.WebSite.Applications.

Another class, SearchHistories, is in \Applications\CrackHistory directory. The namespace of SearchHistories class is Company.WebSite.Applications.CrackHistory. SearchHistories inherits Framework.  Under .NET1.1, there was no problem with this. However, in VS2003, a compile error states "The type or namespace name 'Framework' could not be found (are you missing a using directive or an assembly reference?) C:\WEB\Applications\CrackHistory\SearchHistories.aspx.cs".

The immediate solution is to copy the Framework.cs file from the Applications directory and copy it into the Applications\CrackHistory directory. Then the error goes away. What is up with that?


The aim of an argument or discussion should not be victory, but progress. - Joseph Joubert
BradleyB
Asp.Net User
Re: V1.1 to Beta 2 - Namespaces Not Recognized6/23/2005 5:01:19 PM

0/0

In VS03 the entire website was compiled into a single assembly.  In VS05 you get an assembly per page or if in batch mode (default) then you get an assembly per folder.  VS05 and ASP.Net 2.0 support the concept of an App_Code folder for common logic.  You should be able to put your Framework.cs into the App_Code folder where all your pages can inherit from.

Hope this helps, Brad.
thermalnoise
Asp.Net User
Re: V1.1 to Beta 2 - Namespaces Not Recognized6/23/2005 5:35:24 PM

0/0

Thanks Brad. That did indeed help me out immensely. One further question: The conversion from 1.1 to 2.0 removed all the control declarations from the code behind. But now it appears I need to put them back in as the .cs file errors now state things like "The name 'lnkPrintFriendly' does not exist in the current context" and points to where I reference the control for properties and the like. So am I supposed to place those control declarations back within the code behind residing in App_Code now?

Thanks once again. I was getting so frustrated!

The aim of an argument or discussion should not be victory, but progress. - Joseph Joubert
Baiju
Asp.Net User
Re: V1.1 to Beta 2 - Namespaces Not Recognized6/23/2005 9:08:56 PM

0/0

If Framework.cs is a code-behind file (say page file is framework.aspx)
  you can fix it by adding <%@ reference page = ~/framework.aspx %> to SearchHistories.aspx

If framework.cs is stand alone code file (I guess not, if it was it would have moved to app_code directory)
 you can fix this problem by adding CodeFileBaseClass = base class name defined in Framework.cs,
however this may not be supported in beta2 bits.

We have made changes to our web conversion wizard to fix this kind of problems.

Baiju

"This posting is provided "AS IS" with no warranties, and confers no rights"
thermalnoise
Asp.Net User
Re: V1.1 to Beta 2 - Namespaces Not Recognized6/24/2005 12:34:02 PM

0/0

This is a different page with a similar setup. RequestForm a page that loads several user controls. Sometimes the user controls will instantiate the RequestForm object to call a public method. The user controls were complaining that RequestForm did not exist, so moving the RequestForm.aspx.cs file to the App_Code folder resolved that issue. Now it is the RequestForm.aspx.cs file that complains the web control references do not exist in the current context. There are compiler errors of two types.

First, over in the RequestForm.aspx file, which I did not move, this is the directive:
<%
@ Page language="c#" Inherits="MERC.AircatWeb.Applications.TO107.RequestForm" CodeFile="..\..\App_Code\Applications\TO107\RequestForm.aspx.cs" %>

In the RequestForm.aspx.cs file, I have lines like this:

lnkUploadDiscrepancy.Visible = false;

The compiler says "The name 'lnkUploadDiscrepancy' does not exist in the current context."

Second, we also have a 3rd party control on the form, and the compiler gives this error: "'MERC.AircatWeb.Applications.TO107.RequestForm' does not contain a definition for 'RapidSpellWebMultiple1'".  It is declared in a directive in RequestForm.aspx:
<%@ Register TagPrefix="rapidspellweb" Namespace="Com.Keyoti.RapidSpell" Assembly="Keyoti.RapidSpellWeb" %>

<RAPIDSPELLWEB:RAPIDSPELLWEBMULTIPLE id="RapidSpellWebMultiple1" runat="server" IgnoreEmptyTextBoxes="False" ShowButton="True"></RAPIDSPELLWEB:RAPIDSPELLWEBMULTIPLE>

Thanks in advance for the help.


The aim of an argument or discussion should not be victory, but progress. - Joseph Joubert
thermalnoise
Asp.Net User
Re: V1.1 to Beta 2 - Namespaces Not Recognized6/24/2005 1:42:42 PM

0/0

I found another posting that solved my problem. Instead of moving the code behind for RequestForm to the App_Code directory, I just needed to add a <%@ Reference Page="~/Applications/TO107/RequestForm.aspx" %> tag to my ascx files.  Now to continue working through the myriad of compiler errors left.  You figure out 1, and 10 more pop up!
The aim of an argument or discussion should not be victory, but progress. - Joseph Joubert
Baiju
Asp.Net User
Re: V1.1 to Beta 2 - Namespaces Not Recognized6/24/2005 5:46:12 PM

0/0

First of all you donot have to move code-behind files to App_Code directory instead use
<%@ Reference page/control=<page file name>.

during compilation.
Entire app_code directory is built into single assembly. If you move code-behind files to app_code it may not have information about the fileds declared in the aspx/ascx files.
"This posting is provided "AS IS" with no warranties, and confers no rights"
7 Items, 1 Pages 1 |< << Go >> >|


Free Download:


Web:
V1.1 to Beta 2 - Namespaces Not Recognized - ASP.NET Forums Net 1.1 in VS2005 Beta 2/.Net 2.0. Our main problem at this point is that certain classes are not being recognized when they are referenced ...
Microsoft.Data.Odbc namespace not recognized. - ASP.NET Forums Odbc ) it's not recognized. The following are installed on my computer: ... Namespace changed from v1.0 to v1.1 of the .net runtime. ...
Learning the New Jakarta Struts 1.1, Part 1 | O'Reilly Media Struts v1.1 is the latest version of the framework. While in beta 2 at the time ... to plug in your own pattern-matching engine, namespace-aware processing, ...
XML 1.1 and Namespaces 1.1 revealed The nature of the changes brought by XML 1.1 and Namespaces 1.1 do not ... XML namespaces and define your own XML vocabularies in Part 1 and Part 2 of "Plan ...
SourceForge.net: Files NUnit 2.2 Beta 2 - NUnit Version 2.1.92 Feature Requests Implemented (some .... NET v1.1 * 731258 - suite not recognized * 738425 - NUnit-console.exe runs ...
C-Dog's .NET Tip of the Day. ASP.NET 2.0 and Visual Studio 2005 ... After using VS2005 Beta 2 for a while yesterday, I have to say one of the ... You keep getting an error about the namespace not being recognized when you ...
SeaMonkey 1.1 Beta Changelog 319072 Tab drag and drop does not work correctly on OS/2 319078 Handle ...... SVG 342979 Role attribute should be recognized in XHTML 1.x namespace 343036 ...
Mailing list archives NET client on Win2000, Axis 1.2beta2 server inside JBoss/Jetty on Solaris. .... InvalidOperationException: The specified type was not recognized: ...
[#XFIRE-386] CLONE -Multiple parameters are not recognized with ... Component/s: None. Affects Version/s: 1.1-beta-1, 1.0. Fix Version/s: 1.1 ... < namespace>http://xfire.codehaus.org/TestService ...
Cover Pages: Namespaces in XML [March 6, 2008] "Namespaces in IE 8 Beta 1." By Dave Orchard. ...... (2) There can be a default Namespace for element names but not for attribute names. ...




Search This Site:










error?

please help me find a solution

asp 2.0 callback and viewstate/controlstate

treeview html

internet explorer web controls

uploading files in email using c#.net

permission inputs ??

database files

menu items with user controls on one web page

clr profiler, aspnet_wp, and visual web developer web server

loading gif while loading actual image

javadoc / documentation

problems with website copied to a new computer.

embedd a website into another

this may seem like a dumb question ...

question about scrolling

need some help with treeview

sharing controls between sites

why it doesn't go to login page?

page_load doesn't run on content pages.. :(

using the web site administartion tool to give different user access to different parts of the site.

installing a web project

select boxes disappear on refresh

how to use eventargs properly?

query strings

link to page page that is part of my site

using vb to email...

formsidentity display issue

selecting file

minimize webpartzone programatically

 
All Times Are GMT