In a simple console app used to test a couple of API's, I am getting a "CS0246 The type or namespace name 'IFS' could not be found." error.
The strange thing is that the errors are on the 'using` clauses
and is about not finding the first part of the name in that clause.
The assembly, with the same name as in the first using clause, is referenced. And it's root name space is set to `IFS.EOI.ETL'
AFAICT with all this the console project is set up as it should be. So what could be causing the compiler to barf at it like this?
The error seems to have been caused by a mismatch in the targeted frameworks. The console project was targeting .Net 4.5.2, while the library was targeting .Net 4.6.1.
After changing the properties of the console project to target .Net 4.6.1 as well, the compiler stopped complaining.
Related
I am working on upgrading WPF application which is built using .Net Framework 4.6 to .Net 6. While upgrading a few assemblies, I encountered this strange issue -
The type forwarder for type 'System.ComponentModel.INotifyPropertyChanging' in assembly 'System' causes a cycle
I have tried searching various forms but unable to find the root cause. Can anyone suggest what should be the issue?
The error was coming since the DLL were not compiling. I commented the code in Views and ensure that there are no errors in .cs files. Once it started compiling, the above error went away.
I'm using framework 2.0 and trying to build project,but i'm getting a lot of errors in the aspx.designer.cs pages,example.
protected global::System.Web.UI.UpdatePanel updMenu;
The error says the name UpdatePanel doesn't exist in the web.ui namespace,i think its because the framework doesn't support this?Or it't other thing that is causing this?
In the references i have the system.web,i exlucluded and included multiple times and errors continues.
You must use .Net Framework 3.5 or upper.
https://msdn.microsoft.com/en-us/library/system.web.ui.updatepanel(v=vs.110).aspx
I needed to make a console application using nettiers class libraries. I created a new Console Application project, added references to all the libraries from NetTiers and created an app.config file with all the necessary configurations. I get intellisense and no errors and everything when I am doing the coding, but when I go to compile the application, I'm getting an error that PPGEDI.Data doesn't exist.
I only have 1 line in the program.cs Main method:
PPGEDI.Entities.VansEntity van
= DataRepository.VansEntityProvider.GetById(16);
I'm getting the following error:
Error 93
The type or namespace name 'Data'
does not exist in the namespace 'PPGEDI'
(are you missing an assembly reference?)
It's frustrating, because I know I've added the assembly reference:
I'm using Visual Studio 2010, with C# and .NET 4.0. Can anyone give me an idea as to what I need to do to get this to work.
As a note, this works if I use the same statement in a method on an ASPX page in the web application generated by nettiers.
#BrokenGlass, you were absolutely correct. I double checked and it was
set to ".NET Framework Client Profile", I changed it to .NET 4 and
it's working now, can you put that as an answer?
You are using the .NET client profile in your console app which is a "minified" version that doesn’t contain all assemblies.
The problem is that when your app adds a reference to a class library that is targeting the full framework, references to the "full" framework assembly will not resolve. This results in the rather non-forthcoming error message that you see. Switching to the the full .NET 4 as target framework will resolve the issue.
For a more in depth overview of the problem and the .NET 4 Client Profile in general also see "What’s new in .NET Framework 4 Client Profile RTM"
I've created a Class Library project called Core. The default namespace is XXX.Tasker.Core.
I've created another Console project which references Core. In my Main() I've got some calls to stuff inside the Core but I'm getting an error:
The type or namespace name 'Core' does
not exist in the namespace
'XXXX.Tasker' (are you missing an
assembly reference?)
The only thing I can think of is that the fact my assembly name is Core might be confusing it.. but that really doesn't make much sense.
Any other suggestions?
The problem turned out to be that Core was compiled as .Net Framework 4 and the Console was .Net Framework 4 Client Profile. Apparently you'll just get really weird errors instead of a proper notification when this occurs.. thanks MS! ;)
I have a class library project that references another class library. The project fails to build and I get the error 'The type or namespace name 'ReportLibrary' does not exist in the namespace 'MSF' (are you missing an assembly reference?)'
The weird part is that I have other projects referencing the same class library that build fine. The only difference is that they are Windows Application projects. If I change the project type to a Windows Application and add a Program.cs with a [STAThread] and it builds.
So WTF? Anybody know what I'm doing wrong?
Edit (More Details): All projects in the solution are set to the same Target Framework: .NET Framework 3.5
EDIT (Unobfuscated the error message per Hans)
Is the class library (with the error) targeting the Client Profile, and the applications (as well as the reference library) targeting the full framework? If so, this could cause the reference to be invalid, and cause that message.