Assembly Reference From App_Code Directory/CS0234

Mar 23, 2010

I have trouble getting a custom ObjectDataSource for an asp:ListView control to work. I have the class for the DataSource in the App_Code directory of the web application (as required by the asp:ListView control).

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Data.Common;
using System.Web;
using System.DirectoryServices;........

As soon as I add using System.DirectoryServices; the page crashes with this message:

Compiler Error Message: CS0234: The type or namespace name 'DirectoryServices' does not exist in the namespace 'System' (are you missing an assembly reference?) Without the usage of System.DirectoryServices the page loads without problems.

The reference is there, it is working in classes outside the App_Code directory.

View 1 Replies


Similar Messages:

Configuration :: Missing "linq" Assembly - Error CS0234

Oct 7, 2010

I'm building a site using VWD 2010 Express. The site seems to run fine in the browser but when debugging I get the following errors: Error 1 c:....Site.master.cs(3): error CS0234: The type or namespace name 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference?) (I get this message 4 times) Error 5 The type or namespace name 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference?) I've gone in to the Web.config and added the following:

<assemblies>
<add
assembly="System.Data.Linq,
Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
add
assembly="System.Core,
Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
add
assembly="System.Xml.Linq,
Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
add
assembly="System.Xml,
Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/><
/assemblies>
Site.master.cs includes a reference to "using System.Linq".

View 4 Replies

Web Forms :: Referring An Assembly In Project / Without Adding Assembly Reference, It Still Accepting And Running Code?

Jul 5, 2010

Before using any class in your website project/page we have to add it's assembly reference to our project. Right?

Now, when I am using SmtpClient class from System.Net assembly after adding the System.Net.Mail namespace in namespace node of application's web.config file but without adding assembly reference to the project, it still accepting and running the code. Why?

I enquired the machine's web.config file located at C:WINDOWSMicrosoft.NETFrameworkv2.0.50727CONFIG but didnt find assembly reference for System.Net there also.

So bit confused how it is working and where the assembly reference has been added and how?

View 1 Replies

Assembly Generation - Reference Assembly Targets Different Processor?

May 2, 2010

I'm getting following warning

Assembly generation -- Referenced assembly 'System.Web.dll' targets a different processor

What does this mean and how do I fix this?

View 1 Replies

Visual Studio - Why Does Website Reference Assembly From GAC, When Adding Local Reference

Jan 7, 2010

When you use ASP.NET web site (instead of web application model) and add reference to an assembly from local folder, Visual Studio, it seems, understands that this local assembly is also in GAC and so does NOT copy this assembly to bin folder (as it does with non-GAC assemblies), but simply adds new record in web.config file.

Why such a behaviour? Is it possible to force copy to bin folder (I need this since .dll is not on target environment)? I can add assembly to bin folder as file and it will work, but in this case bin folder contents will be in source control, which is not good.

View 3 Replies

App_Code - App_Data - Bin Directory Location

Jul 28, 2010

I am confused as to what to do with these. I have .cs files in App_Code. I also have other files in App_Data, and Bin. Could I just create these folders, make them virtual directories and upload my files as normal? Or do I need to do something special with these folders/files? Im really stuck on this. Also, this is a "shared hosting" account.

View 5 Replies

Installation :: How To Encrypt App_Code Directory

Feb 3, 2011

I have a customer that willing to buy a website and willing to pay for the database and for the ASP.NET portal that I developed for more then a year.

So, what I am selling to this customer is the database, the domain name, and the portal binaries.

I wish to allow the customer to change the .ASPX files, and also the ,ACSX files. and also the .CS files.

How do I block the access to the App_Code directory (Which is the busniess logic). I need a very good encryption method, so the customer will not be able crack the code.

View 2 Replies

Organize Code Outside The App_Code Directory Or Into Separate Projects?

Feb 25, 2011

I've been working with MVC for awhile and I'm not sure what works with asp.net.

Is it possible to organize code outside the App_Code directory or into separate projects? How would this be done?

View 2 Replies

Web Forms :: Create Profile Tables In An Existing Mdf In App_code Directory?

May 8, 2010

Create profile tables in an existing mdf in app_code directory

View 5 Replies

C# - Resolving .NET Assembly Reference To A Different Name?

Nov 24, 2010

My project references Library1.dll and Library2.dll. Library2.dll has a dependency on Library1.dll, but it was compiled to reference it by a different name, Library1.Net40.dll. there an nice way tell my application to redirect all references for Library1.Net40.dll to resolve to Library1.dll? Maybe something similar to the way you can redirect versions using a <bindingRedirect>
I've got a solution that handles the AppDomain.AssemblyResolve event, but it's a bit of a hack and am hoping there's a better way to do this.

View 1 Replies

.net - How To Reference Assembly From Web.config

Jan 13, 2011

I need to add reference to 'System.XML.dll' assembly into web.config (in order to try solution for problem, mentioned here: Problem with Extension method: IXmlLineInfo).I've tried to add the following line into "assemblies" section:

<add assembly="System.Xml, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"/>

View 2 Replies

Reference A .NET Assembly From ColdFusion?

Feb 15, 2010

Is it possible to reference a .NET assembly from ColdFusion? If so, how can I accomplish this? I am not a ColdFusion developer by any means.

View 1 Replies

C# - Load An Assembly Outside My Web App's Bin Directory?

Mar 27, 2010

I want to load my assemblies from a location other than the bin folder. How can I accomplish this?

View 3 Replies

Configuration :: How To Reference An Assembly Manually

Oct 28, 2010

I downloaded the trial version of abcpdf, which is absolutely fantastic!

Anyway, real simple, you just need to reference the .dll and off you go...

So, I got my code working, but when I moved to production server I hit a wall.

It definitely has to do with the .dll because when I comment out the pdf sub routine, the code executes and completes all other tasks. When I uncomment, It's not working.

The trouble is, on my server I don't have the full version of VS, so I am unable to add a reference, which I presume takes care of the web.config settings? I manually dropped the .dll into the bin folder and I added the assembly line into web.config, but, as I don't have the above, I am not sure if the token key is correct.

To test this, I uploaded the working .dll file to my server, which I assumed the key is associated with, but still the same.

how to either get the correct key and/or how to reference an assembly manually? Is there something I have missed?

View 2 Replies

Adding Assembly Reference To Web Project?

Jul 7, 2010

Before using any class in your website project/page we have to add it's assembly reference to our project. Right?

Now, when I am using SmtpClient class from System.Net assembly after adding the System.Net.Mail namespace in namespace node of application's web.config file but without adding assembly reference to the project it still accepting and running the code. Why?

I enquired the machine's web.config file located at C:WINDOWSMicrosoft.NETFrameworkv2.0.50727CONFIG but didnt find any assembly reference for System.Net.

how it is working and where the assembly reference has been added and how?

View 4 Replies

C# - ExecuteScalar Missing Assembly Reference?

Dec 5, 2010

I posted a question about how to save the result of an SQL command to a variable and was told that the execute scalar method should be used, however I can't use it, I'm using the System.Data.SQLClient reference but still not finding it

View 3 Replies

MVC :: Views Not Finding Assembly Reference In .NET 4.0 That Work In 3.5?

Apr 14, 2010

If I have a reference in my project to System.Data.Linq in an MVC application compiled against 3.5 I can use Linq to SQL generated entity objects in my views and access the foreign key entity sets. If I try and do the same thing in 4.0 I get the error messageCompiler Error Message: CS0012: The type 'System.Data.Linq.EntitySet`1<T0>' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

View 1 Replies

Assemblies - Bin Directory Vs. Adding Assembly In Web.conf

Jan 13, 2010

I am relatively new to ASP.NET programming (but not programming in general), and I have been looking through a project that has been handed off to me. Within this project, there is a bin directory which contains a slew of various DLL files. Then, in the web.conf file, inside the assemblies structure (within the XML), there is a slew of other assemblies being added. I've done a search on both SO and through Google in general, and I am still struggling over what the difference is between the two. Is one way "better" than the other?

View 2 Replies

The Type Or Namespace Name 'IUnityContainer'...are You Missing An Assembly Or Reference

Jan 21, 2011

I recently moved my class based on IUnityResolver from the mvc3 project (where I tested it), to a class library (which references all five Unity dll's. I'm getting the following error, why? Are there other dependencies for which I am unaware?The type or namespace name 'IUnityContainer'...are you missing an assembly or reference?

View 3 Replies

AJAX :: Reference Required To Assembly 'System.Web.Extensions?

Apr 23, 2010

I have an ASP.NET project and I want to use some AjaxToolKit Extenders on my pages.

The site is created in VS2010, set to Framework 4.0.

This is what I did:

1) Add reference "AjaxToolKit.dll" to my project.

2) Add to the toolbar the same file for the controls

3) Add "ToolkitScriptManager" to the page source.

This adds the declaration to the source as well.

Right after this I get the following error:

Reference required to assembly 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' containing the base class 'System.Web.UI.ScriptManager'. Add one to your project.

View 3 Replies

Visual Studio :: Cannot Add Assembly Reference And Using .dll File From 2008 And 2010

Oct 19, 2010

tell me the way to solved my problem to looking for a long time.

My System Info:

OS: Windows 7 - Ultimate - 64bit

VS: Visual Studio 2008 - Professional (and problem with my VS2010 installed)

Problem:

I have a small project and build it to library .dll file with some function util.

From an other website (with diffirence solution). I added reference the .dll before to website.

In website, I declaration to using the function in library (dll file before). But I found error:

Error 1 Type 'LibraryName' is not defined.

And in VS2010 the problem is same.

But, run website on an other computer, it work normally.

View 2 Replies

Databases :: How To Change Assembly Reference To Oracle.DataAccess In Prod

Mar 8, 2011

In development I installed "ODAC Entity Framework and LINQ Beta (11.2.0.2.30)" so that we could have a 32 bit version of Oracle.DataAccess for ODP.Net. In Visual Studio 2010 (on Windows Server 2008 R2) I made a reference to:

C:Oracleodp.netin4Oracle.DataAccess.dll.This adds: <add assembly="Oracle.DataAccess, Version=4.112.2.30, Culture=neutral, PublicKeyToken=89B483F429C47342" /> to the assembly in the web.config.

We set the AppPool to Enable 32 bit applications and everything works great. For anyone who doesn't know the story here, we do this because Visual Studio 2010 runs in 32 bit so you need the 32 bit ODAC/ODP.net components to get a development environment running. I then publish the files and move to a 64 bit machine.

I downloaded the "ODAC112021Xcopy_x64.zip" Then ran: install.bat odp.net4 c:oracle odac and I can see the Oracle.DataAccess.dll file at: C:Oracleodp.netin4Oracle.DataAccess.dll. Then added c:oracle;c:oraclein;c:oraclein4 to the System Path.

At this point I would think I just replace the version and PulbicKeyToken in: <add assembly="Oracle.DataAccess, Version=4.112.2.30, Culture=neutral, PublicKeyToken=89B483F429C47342" />
on production to the versioin installed on prod. So first thing I do is just remove that line on production to see what error I will get. And I still get the same error:

System.IO.FileLoadException: Could not load file or assembly 'Oracle.DataAccess, Version=4.112.2.30, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Actually this is if I move the new dll into the applicaitons bin directory. If I remove the dll from the directory I get: Could not load file or assembly 'Oracle.DataAccess, Version=4.112.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The system cannot find the file specified.

So I put the line back in.

I right click on on the new Oracle.DataAccess.dll and click properties. In the details tab I see verion is 4.112.2.0. That makes sense. The 64 bit XCopy version is an earlier build then the 32 bit Beta that comes with Entity Framework and LINQ(Version=4.112.2.30).

So on production I change the Version attribute to: 4.112.2.0. But now I get the same error: System.IO.FileLoadException: Could not load file or assembly 'Oracle.DataAccess, Version=4.112.2.30, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
(This is with the new dll back in the web app's bin directory as is the rest of the thread).

It's still looking for the same version of the assembly. Why is it doing that? The web.config has a connection string with the ODP.Net provider type (Oracle.DataAccess.Client). Which would take from the assembly reference. It should not care what the version number is. Could there be something in code somewhere that is specifically looking for the old dev box version? Just what is the way to make it use the new assembly?

I would think the system would just know where to find the new dll. Just as in development the add reference dialog knew that the dll was in c:oracle... rather then c:program files(x86)... like out-of-the-box Microsoft assemblies.

View 2 Replies

C# - Microsoft Chart Controls Assembly Reference: How To Move It To Web.config

Aug 31, 2010

Currently, when I want to use Microsoft Chart Controls on a website, I need to add the following onto every aspx page where I want to use it:

<%@ Register Assembly="System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %>

Is there any way to move this to the web.config file, so that I don't have to put it on every page ?

View 2 Replies

Website Project To Reference A Signed Assembly In Visual Studio?

Mar 30, 2011

I'm aware of the following two different types of web projects in Visual Studio 2008:Website projectWeb application projectA web application project can reference a signed assembly as long as the web application's assembly is also signed with the same key. However, this doesn't work with the website project because there is no place to sign an assembly. I think this is because the assembly is compiled dynamically on the server?

Anyway, is it possible to get the website project working with this signed assembly? Or will I have to convert this website project into a web application project?Edit:The following situation has required me to ask for clarification in this matter:I have a class library that is being referenced by several other projects in my solution in Visual Studio. One of the projects is a windows application that will be deployed to specific external users. In order to make sure that the application is using the correct assembly and to also prevent others from using the assembly (I am aware of the limitations with respect to its effectiveness), all assemblies have been signed and all the classes in the library are declared as Friend (internal).

The website project doesn't seem to have a way for me to sign its assembly and I get the following message when attempting to use anything from the library: "CLASS is not assessable in this context because it is 'Friend'", which is to be expected.The following attributes are inside the AssemblyInfo.vb file in my class library project:

<Assembly: InternalsVisibleTo("OtherProject1, PublicKey=AAA...")>
<Assembly: InternalsVisibleTo("OtherProject2, PublicKey=AAA...")>
...

My Conclusion:Looks like the cleanest way to do this would be to convert the website into a web application but this would require a bit of time to do since our site is pretty fleshed out already and as pointed out in other discussions, can be quite a pain to do. Going forward, I think creating a web application in the first place may have been a better idea and much more flexible for future development.

View 3 Replies

AJAX :: Unable To Reference Extender Assembly Toolkit Control

Nov 22, 2013

I have downloaded ajax toolkit fromĀ URL....

When I am using control it gives error unable to reference extender assembly "AjaxToolkit control" version =4.1.7.1105 , culture = netural , publickey token=28f01b0e84b6d53e

And when running aspx page it gives unable to get property ui of undifeined or null reference..how it can be removed..

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved