Cannot import Quartz.NET library for VB - vb.net

I have downloaded Quartz.NET and put it into the folder of my project. And I have also added Quartz.NET\bin\Release\Quartz\net452\Quartz.dll as reference. The import statements are:
Imports Quartz
Imports Quartz.Impl
(I just followed what I found in online tutorials and examples)
However, compiler error message appears for each import statement when I run the code:
Namespace or type specified in the Imports 'Quartz' 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.
I have tried to remove the reference and add it again. It's fine before running, but error still occurred during compilation. Can anyone find out why does the error happen?

Related

DocumentFormat for OpenXML

I'm trying to create an Excel file to save using OpenXML and I've found some guidelines on Microsoft website, talking about declaration of OpenXML through importing modules. I added at the beginning of the code:
Imports DocumentFormat.OpenXml
Imports DocumentFormat.OpenXml.Spreadsheet
Imports DocumentFormat.OpenXml.Packaging
I'm having back three warnings, each per line: BC40056 Namespace or type specified in the Imports 'DocumentFormat.OpenXml' 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. Besides, I'm also having issues while compiling the code itself, because every time I recall DocumentFormat, I receive back an error about "not declared" variable. Which could be the problem? Thanks in advance all are gonna answer me.

How do I treat missing namespace warning as an error?

Can someone please help me treat the following warning as an error? One of our dev setups (a build machine) treats this issue as an error, others (developers' machines) as a warning. I can't seem to find anything online regarding this.
Namespace or type specified in the Imports
'Your.Nonexistent.Namespace' 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. C:\Yourproject\yourClass.vb
Thanks for any help.
On the Project Properties page Compile tab there is a checkbox labled Treat all warnings as errors. this w

Cannot import `Imports System.Web.Script.Serialization`

When I try to Imports System.Web.Script.Serialization, I get an error in VB 2010 that says:
Warning: Namespace or type specified in the Imports System.Web.Script.Serialization 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.
Not sure why I can't import it.
You might be missing an assembly reference to System.Web.Extensions.dll. Add this reference to your project, then try again.
Generally speaking, when you encounter this issue, go to the .NET API reference page of the type you want to use — for instance, JavaScriptConverter — and look out for the Namespace and Assembly hints (make sure you're looking at the page for the .NET framework version that you are using):
Namespace: tells you what to put in the Imports directive.
Assembly: tells you what assembly you need to reference in your project (e.g. go to Solution Explorer, locate References, and select Add Reference… from the context menu).
Also make sure to check the "Target Framework" in the project properties. If you are targeting a "Client Profile" framework then the assembly System.Web.Extensions.dll will not be available to add as a reference to your project.

MVC2 Extension Methods throwing errors in my views

I have a project written in MVC2 and VB.NET. I use a lot of htmlhelper extension methods, and I have them all in a public module. They work just fine, and I can compile and run my project. I reference the namespace they are in with this:
<%# Import Namespace="MyProject.WebUI.Extensions" %>
So, again, they work great, my project runs and compiles without a hitch.
The problem is that each one of these extension methods is shown as an error:
Error 33 'TabbedMenu' is not a member of 'System.Web.Mvc.HtmlHelper(Of Object)'. C:\Projects\MyProject\MyProject.WebUI\Views\Shared\Site.Master 23 21 MyProject.WebUI
This doesn't prevent the project from compiling and running, it just creates an error, which is annoying. I've tried looking for solutions, but all of the solutions I've found were for projects that don't compile, all with simple solutions like referencing the right namespace or making sure your module is declared public. Any thoughts?
Have you included an import statement in your site.Master to include the extensions class where your extensions are defined. Also I assume your extension class is a public static class with public static methods defined?
Also check this out if you haven't already, it may be related to what you are after.
How do I use an extension method in an ASP.NET MVC View?
You need to import the namespace where you have placed your extension. And since it is a bit annoying that this problem shows up no sooner than in runtime, you can enable view compilation to have the compiler detect the problem. I should warn you that compiling the views is a time consuming operation though.

how to use classes written in IronPython in VB.NET

I have a class (e.g. MksMath) written in IronPython using SharpDevelop 3.2. After compiling it for class library, it produced the following output:
IronPython.dll
IronPython.Modules.dll
Microsoft.Dynamic.dll
Microsoft.Scripting.Core.dll
Microsoft.Scripting.Debugging.dll
Microsoft.Scripting.dll
Microsoft.Scripting.ExtensionAttribute.dll
mksmath.dll
If I try to add reference to all above dll and import "MksMath", I am unable to access it. The vbc is throwing the following error:
Namespace or type specified in the Imports 'MksMath' 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.
I am new to IronPython. Kindly advise how to use this class in my vb.net code?
I post here my answer that I posted to IronPythopn mailing list :-)
You cannot use mksmath.dll directly from VB (see Compiling Python code into an assembly) so you have to host IronPython engine in your VB app and use mksmath.dll from the engine. See Using Compiled Python Classes from .NET/CSharp IP 2.6 for example (in C#).
Here is a link that I think may solve the issue. http://msmvps.com/blogs/theproblemsolver/archive/2008/08/14/calling-ironpython-functions-from-net.aspx