I am new to webforms. I am trying to setup a linq to sql connection. I did it the (what I think is) the standard way. I added a linq to sql class. Then I went to my database explorer and dragged a table in and saved. Whenever I try to load the project in the browser I am getting the following error:
The type or namespace name 'Linq' does not exist in the namespace 'System.Data'
I am kind of at a loss here. I googled around. I saw some of the standard solutions like add a reference to System.Data.Linq (which I already had but did again) and to make sure debug="true" in my compilation tag and target framework in my compilation tag was the same as the target framework for the project which I did (both are .NET 4.0). I am still getting the error and I have no clue on how to proceed from here.
The error is thrown on the following line of the Conditions.dbml file:
using System.Data.Linq;
Add a reference to the System.Data.Linq assembly. Right click the References folder in your project, go to Add Reference, then make sure you're on the Assemblies tab and add a checkmark next to System.Data.Linq. (These directions are for VS 2013).
Related
I'm going to try and connect to my EF Data Model for the first time and when I do I pull this error message:
This version of the Entity Data Source wizard is only compatible with Entity Framework 5. If you’re not using Entity Framework 5 you can configure the control by editing the markup on the page. The page editor has IntelliSense support for ASP.NET controls. If you’re using Entity Framework 6 you should also be using the EF6-compatible version of the Entity Data Source control, available as the Microsoft.AspNetEntityDataSource package in NuGet.
Now this threw me a bit because I thought that I had all my updates in place but I went back to NuGet and double checked and did a full refresh of anything I could to make sure that VS knew it was there an verified everything was in place and on 6 as intended. Then I noted in the update tab there was three items there that I could put up (Bootstrap 4.0.0-alpha2, Microsoft.AspNet.Idntity.EntityFramwork v3.0.0-rc1-final, and Microsoft.NetCompliers v1.2.0-rc). This I attempted but that bombs out with the error:
Failed to add reference to 'System.Runtime'. Please make sure that it is in the Global Assembly Cache.
I'm a bit stumped here... no path forward no path backward that I can see.
I am trying to create a simple code sample that access an oracle database, in a Web Api 2 project.
Since OracleClient dll is not available "by default" (if I understand it right, upon creating a new project the targeting framework subset is not the full framework dll set), I added a reference to System.Data.OracleClient.
The references to the dll's types such as OracleConnection, OracleCommand and so are all recognized by VS, just like intelisense shows OracleClient after typing System.Data.
A build however raises an error stating
The type or namespace name 'OracleClient' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)
The runtime version (v4.0.30319) and version (4.0.0.0) are exactly the same as, say, System.Data, automatically loaded when upon creation.
What is wrong ?
Adding a reference to a new dll requires restarting visual studio.
Ok, I am in the process of breaking apart of intranet application (VS 2010 Web Site, ASP.NET Web Forms with VB code behind). During this process i'm trying to convert some of our our app_code files in to WCF rest service in a new project. However, when I copy or "add existing" vb files into the new "services" project. I get tons of errors including...
error BC30002: Type 'XXX' is not defined
warning BC40056: Namespace
or type specified in the Imports 'System.ServiceModel' doesn't
contain any public member or cannot be found. Make sure the
namespace or the type is defined and contains at least one public
member. Make sure the imported element name doesn't use any aliases.
From what i've read it may (or may not) have something to do with Assemblies and references that I just have very little knowledge on. I have added the namespaces from the current web.config to new project's web.config, and the files are identical. So there is something in the background that needs to be added to the new project I just don't know what its.
PLEASE HELP!!
THANKS
JOSH
UPDATE 1
So one of the errors i'm getting = "error BC30002: Type 'MailMessage' is not defined." Which is a namespace that is added to the web.config, which apparently isn't being picked up??? IDEAS?
I've come across a similar issue - not sure what the reasoning behind it is, but I got around it by creating a new .vb class with the same name as the one you want to copy, then copy and paste all the text from the old one to the new one. Save it, then it seems to like it - it didn't like me copying and pasting the actual file, nor did it like me adding existing files.
Hope this helps :/
This issue seems to be tied to the the differences between Web Application Projects versus Web Site Projects. Eventually I had to add different namespaces on the new project level.
Here is more info about WAP vs WSP....
http://msdn.microsoft.com/en-us/library/dd547590(v=vs.110).aspx
I have a C# MVC web application. I have added a code library to the project. I want to create a new class called TagBuilderCollection that inherits TagBuilder. It will give me a hierarchical structure to have a parent-child relationship for HTML tags I create with TagBuilder.
TagBuilder is apart of System.Web.Mvc. But despite the fact I've added System.Web.Mvc as a reference to the library project, and I've added the using statement to the top of the class file, I am still getting the intellisense error
Unknown type 'TagBuilder'
In my MVC project, I'm using TagBuilder in the Extensions folder with no reference issues. I just can't figure out why I can't reference it in my code library???
I had to add System.Web.WebPages as a reference to the library. Now it's working.
Despite the intellisense error, I attempted to build the project. VS kicked back an error saying that the error was (paraphrased) "forwarded to System.Web.WebPages. Try adding that as a reference." So I did. And now it works. I don't know why that mattered, but it did.
I have a local website which I run through Visual Studio 2008's internal development web server (through the run / compile button).
I have an external library which is referenced on a page of that website and resides inside the web site's "bin" folder.
I've recently changed a class' property name inside that library (renaming it, from "ValidFrom" to "VisibleFrom"), recompiled its dll and have overwritten the original dll inside the bin folder.
This class is mapped with FluentNHibernate, I've also changed the mappings and recompiled / redeployed the library.
When I try to run the site and navigate to the page where the library is used, I'm getting a MethodNotFound exception for the method get_ValidFrom, related to FluentNHibernate's configuration call. This should be get_VisibleFrom now!
Now I've reconfigured my NHibernate SessionProvider so that it generates a new Configuration for NHibernate on each call, and does not retrieve it from the Http Session entity like it did before, because I figured there might lie the problem.
I'm still getting the exception however. I've then deleted the Temporary ASP.NET folder's content... but I'm still getting the error.
Where is the generated schema for NHibernate stored, when using FluentNHibernate?
Anyone knows where else this could somehow be cached?
Thanks
FNH does not cache the schema, it is generated on-the-fly when you make a call to Fluently.Configure() and the schema is passed directly into an NHibernate Configuration object which is used to build an ISessionFactory.
Try clearing out all compiled objects/libraries/executables, removing the reference to your library from all projects that use it, add it back in, and then re-compile everything. Also check your all your code for "magic strings" that may be referencing this property or causing it to be referenced by the old name.
If that doesn't work, it might be helpful to see a stack trace to get an idea of what is being called from where.