I have a web application project, in visual studio 2017. We are using codefile, instead of code behind, on the server, so this project can be sheared with organisations who do not have visual studio.
Within the visual studio project, I have created a class, so I can reuse code on every page (to do with controlling who can access certain pages).
Therefore, on each web page, page_load event, I have the following code:-
generalFunctions objSecurity = new onlineCaseReporting.generalFunctions();
if (!objSecurity.userAllowedToAccessPage(pageFileName))
{
This works perfectly, within visual studio on my development machine but on the server, I get the following error:-
Compiler Error Message: CS0246: The type or namespace name 'generalFunctions' could not be found (are you missing a using directive or an assembly reference?)
I am assuming this is because I am using CodeFile and not supplying any DLLs. Is there a way to use classes when using CodeFile?
Thanks
Related
Whenever I take the latest code from TFS and tries to build existing solution, It fails all the project building and says that : The type or namespace name 'XYZ' does not exist in the sampace 'a.b.c' (are you missing an assembly reference?)
This is happening with all the references and only in my system. On the other systems all these code works fine.
Can it be a Visual Studio issue or some setting which might have got changed?
My project is an ASP.Net website that connects to an SQL database.
It compiles fine locally in Visual Studio, but once it is hosted (myWindowsHosting.com) it throws this error:
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0246: The type or namespace name 'IDefaultView' could not be found (are you missing a using directive or an assembly reference?)
Source Error:
Line 9: namespace HFDB2
Line 10: {
Line 11: public partial class Default : System.Web.UI.Page, IDefaultView
Line 12: {
Line 13: public event EventHandler btnNextClicked;
In this example I am trying to implement an Interface to the Default webform. But a similar error occurs for any class I try to reference.
Why cant my project find any classes once it is hosted?
Does it have anything to do with my folder structure?
My classes are not in an App_Code folder because apparently you dont need one for websites. I tried putting them in an App_Code folder anyway, but it gave a different error.
Note that I uploaded everything you see inside my project folder to the host.
I was deploying my application incorrectly. As Ben Robinson's comment says:
Never deploy source code. The easiest way of creating your collection of files to deploy is to use the Publish option in visual studio.
I have downloaded QuickBooks SDK 13.0 and am trying to build a very simple C# application that connects to QuickBooks via QBSessionManager.
I am using Visual Studio Express 2013. I have the following lines of code in the Load function of my very simple Form.
QBSessionManager sessionManager = new QBSessionManager();
sessionManager.OpenConnection("", "Application");
When I try to compile, I get
The type or namespace name 'QBSessionManager' could not be found (are you missing a using directive or an assembly reference?)"
I see lots of sample code that starts with instantiating QBSessionManager, but nothing that identifes the namespace or reference I need to specify.
Am I missing something really obvious?
Add the file QBFC13Lib.dll to your project requirements.
The file can be found in the c:Program Files(x86)\Common Files\intuit\QuickBooks directory of a standard install of quickbooks.
I want to list all the subscriptions made in the reporting server. For this I created a sample console application and added the reference of Microsoft.ReportViewer.WebForms.dll located in the
%Program Files(x86)%\Microsoft Visual Studio
11.0\ReportViewer\Microsoft.ReportViewer.WebForms.dll
But, when I am trying to create object of ReportingService2010 using the following
ReportingService2010.ReportingService2010 r = new
ReportingService2010.ReportingService2010();
It won't allow me to create the object, and throws a compile time error
error CS0246: The type or namespace name 'ReportingService2010'
could not be found (are you missing a using directive or an assembly
reference?)
Which ddl's I am missing here please help me.
Microsoft has a ReportViewer package that needs to be deployed (link below). Adding reference to the project from your development box may not be sufficient.
http://msdn.microsoft.com/en-us/library/ms251723.aspx
I believe the ReportingService2010 is not part of the reference Microsoft.ReportViewer.WebForms.
You need to add a web refrence to your project.
Here is a great tutorial from Microsoft, it shows you how to add a web reference to the SQL Server Reporting Web Service:
http://technet.microsoft.com/en-us/library/ms169926.aspx
If you follow these steps you should be able to use ReportingService2010 like this:
ReportingService2010 rs = new ReportingService2010();
I am using DynamicPDF creator, Visual Studio 2010, and IIS 7.
On my local machine, the line "using ceTe.DynamicPDF;" and subsequent lines work fine, but
when I try to load the page on my server, I get the following error:
"Compiler Error Message: CS0246: The type or namespace name 'ceTe' could not be found (are you missing a using directive or an assembly reference?)"
I have added the .dll file as a reference, and intellisense even works.
I am wondering if it is a problem with assemblies. Any ideas about what I should do to get this working on my server?
May be you lost some of dlls, you can check dll which contains ceTe. ... by dependency walker.