Compiler error when putting class in App_Code folder for common use - class

I have put a class in the App_Code folder, so it should be accessible for all my source files. Intellisense indeed sees the class (in code-behind), but when I run the site from the browser I get a compiler error:
**Compilation 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: BC30002: Type 'ClsTranslation' is not defined.
Source Error:
Line 38: End If
Line 39:
**Line 40: Dim clsTrans As ClsTranslation**
Line 41: clsTrans = New ClsTranslation()
Line 42: lblLevel0.Text = clsTrans.GetResource("", "Modules")
Source File: C:\inetpub\wwwroot\myproject\InfoSiteMap.aspx.vb Line: 40
I am running this site as a web project and therefore the build-option content/compile for my App_Code/class is not available. I also tried to map the file to the pre-compiler using the # Reference directive, but this seems to work for user controls only and not for classes. Also tried to put the class in a namespace, all with same result.
Any suggestions?

Most of the time, when I do this, the build action of the file is to "Content" instead of "Compile". Highlight the class in solution explorer and hit f4 and change this.

Related

Workbox 6: ReferenceError: swDest is not defined

Getting ReferenceError: swDest is not defined when trying to run Workbox 6.
In my sw_build.js file I have that I call with node sw_build.js in my package.json file...
In the console I see this as the output:
It appears as though the files get created?, I just don't understand why I'm getting the odd error.
Your swDest reference is in line 16, and swDest is not defined. That's why the file is created but error occurs. I think you copied the example code without modification on this line.

Check for empty file and quit cakebuild

I am attempting to write a check in my Cake build script to pull in a file from BuildParameters and check if the file contents are empty -- if contents are empty, throw an exception and quit the build.
I am attempting to use FileReadText from the FileHelpers namespace but for some reason I cannot get my build to recognize the file command. I am following the syntax and documentation found here: https://cakebuild.net/api/Cake.FileHelpers/FileHelperAliases/97F5679A
Here is the code I am trying in build.cake:
var fileReadText= FileReadText(Parameters.TestParameters.TestListFP);
var fileText= fileReadText.ThrowIfNullOrEmpty(nameof(fileReadText));
The argument Parameters.TestParameters.TestListFP is set in my Parameters.cake file as such:
TestListFP = context.File("C:\Some\Path\some_file_name.txt");
Using the above code, I see this error:
error CS0103: The name 'FileReadText' does not exist in the current
context
Note that I do not have a ICakeContext in build.cake, just BuildParameters.
I tried to resolve the issue by adding using Cake.FileHelpers; at the top of my build.cake file, but then I see this error:
The type or namespace name 'FileHelpers' does not exist in the namespace 'Cake' (are you missing an assembly reference?)
The script works fine without my FileReadText code, so I know TestListFP is actually a valid file.
I think I am inherently misunderstanding how to use FileHelpers and FileReadText and I could not find any examples of usage in documentation or anywhere else. If anyone has guidance on how to use this method, or a better way to accomplish what I am trying to do, I would appreciate the help.
Have you added the #addin pre-processor directive, as mentioned here:
https://github.com/cake-contrib/Cake.FileHelpers/#cakefilehelpers
You can easily reference Cake.FileHelpers directly in your build script via a cake addin:
#addin "Cake.FileHelpers"

"No rule to make target" error when linking matlab's libraries

My cmake script is as follows:
FIND_PACKAGE(Matlab REQUIRED)
GET_FILENAME_COMPONENT(Matlab_BIN_DIRS ${Matlab_LIBRARIES} PATH)
SET(Matlab_LIBS "${Matlab_BIN_DIRS}/libmat.so ${Matlab_BIN_DIRS}/libmx.so")
INCLUDE_DIRECTORIES(${Matlab_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(myAPP ${Matlab_LIBRARIES} ${Matlab_LIBS})
following error information was printed when I built my projects.
:-1: error: No rule to make target '/usr/local/MATLAB/R2015b/bin/glnxa64/libmat.so /usr/local/MATLAB/R2015b/bin/glnxa64/libmx.so', needed by 'cimgio'. Stop.
But it worked after modifying the last line as
TARGET_LINK_LIBRARIES(myAPP ${Matlab_LIBRARIES} libmat.so libmx.so)
why full paths does not work here?

using SoapClient,ArrayObject, ArrayIterator causes error in zend framework

I'm working on some helpful method in my entity.
private function setApi($api_address,$api_username,$api_password){
$this->api_address = $api_address;
$this->api_username = $api_username;
$this->api_password = $api_password;
$this->api_client = new SoapClient($api_address); // error
}
Warning: require(App/Entity/SoapClient.php): failed to open stream: No such file or directory in /zendboilerplate/library/Doctrine/Common/ClassLoader.php on line 148 Fatal error: require(): Failed opening required 'App/Entity/SoapClient.php' (include_path='/zendboilerplate/application/../library:/zendboilerplate/application/../library/Bisna/Application/Resource:/zendboilerplate/library:.:/usr/share/php:/usr/share/pear') in /zendboilerplate/library/Doctrine/Common/ClassLoader.php on line 148
It seems that zend looks for a class declaration (and it doesn't use included classes in php).
Identical error for each "new Class" declaration.
Using a my own class included in library everything is ok.
(Also tried with #new SoapClient() but no result).
I'm guessing this is namespace related. Try changing the line that is erroring to:
$this->api_client = new \SoapClient($api_address);
that should force it to use the PHP SoapClient instead of the namespace that is presumably declared at the start of the file you're having trouble with.

Arduino HTTPClient not working

I have an Arduino with an Ethernet shield.
I have the httpclient library, and I am trying to run the PachubeClient example.
When I compile, it gives me many errors:
PachubeClient.cpp:25:25: error: Credentials.h: No such file or directory
PachubeClient.cpp: In function 'void setup()':
PachubeClient:47: error: 'ssid' was not declared in this scope
PachubeClient:47: error: 'passphrase' was not declared in this scope
PachubeClient:55: error: a function-definition is not allowed here before '{' token
PachubeClient:95: error: expected `}' at end of input
Why?
I haven't played around with the Arduino development environment at all but that error message means you're either missing the Credentials.h file or the compiler doesn't know where to find it. Verify that the file exists and then check your compiler settings to make sure that you're passing it the path to the header files.