jscript runtime error - jscript

I have a visual studio 2010 project. It runs from my notebook fine but from my desktop it won't run. The error is Microsoft JScript runtime error: '$' is undefined. Here is the code
function fadeDiv() {
$(function () {
$('#ctl00_ContentPlaceHolder1_lblStatus').fadeIn('slow').delay(5000).fadeOut('slow');
});};
this machine had visual studio on it, but i had to remove it and reinstall it again because the silverlight SDK had issue. It has been working fine now for a couple of weeks until this code was inserted into our asp.net code using .net 4.0. I've run sfc /scannow and it reported no errors. I've also rebooted. The Jscript file exists amongst other places in c:\windows\system32. This is a windows 7 machine 64 bit. The machine is fully patched. the jscript file that is on my machine in c:\windows\system32 is version 5.8.7601.16982 and 799 KB.anyway.. sure hope someone can help me outthanksshannon

The $ variable is used in a couple libraries - most popularly JQuery. It is not Vanilla Javascript. Try including the JQuery script at the top of your code:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>

Related

Can't seem to be able to open DLL for Excel on Mac running Parallels

My main stationary machine is a Windows box running Win 8.1 64-bit and Office 2013 32-bit. I developed a 32-bit DLL with functions in VS2013 which I include through Excel VBA. Functions work fine on Windows.
Then I have a Macbook Pro running Windows 8.1 64-bit and Office 2010 32-bit under Parallels 8. I do not seem to be able to work with the functions from my DLL under this Mac.
How I tried:
Copied my DLL file to a new folder C:\MyTools under Parallels.
Referenced this folder when loading the DLL in VBA. My VBA code to load a function from the DLL looks like this
Declare Function MyDLLfunction Lib "C:\MyTools\MyDLL.dll" (ByVal s As Double) As Double
I also tried double slashes \\ to no avail
The undesired result when using this function from my worksheet on Parallels is that there's an error code displayed in the cell (#VALUE).
Is it rather Excel 2010 not being compatible with DLLs in general (can't believe that), or is a matter of referencing the path with the DLL correctly on the Mac? I thought C:\MyTools\MyDLL.dll would work as this is how I see the file in the tree of Windows explorer in Parallels. Or is my Parallels 8 too outdated?
This is a shot in the dark, but it could be that your DLL is not compiled as a static library and hence there are certain dependencies which are present on your development computer (because of the Visual Studio installation) which are not there on the test computer/in the parallels environment.
Try running your DLL on Excel on an identical Windows system with no visual studio installed. If it doesn't work, the problem is likely to be as mentioned above.

Error running app on Windows Phone 8.1 emulator - A dependent dll was not found

I have universal project targeting Windows Store 8.1 and Windows Phone 8.1 platform.
The windows one works fine but I having trouble running the WP one on an emulator. I get the error message saying:
Microsoft Visual Studio Unable to activate Windows Store app
'numbers-here!App'. The Kiss.WindowsPhone.exe process started, but the
activation request failed with error 'Msg in polish that the app did
not start'.
If this was Windows I would check System Event Log and see the logs just before the error what DLL the system was trying to load and that helped a lot when I was debugging similar problem with Windows Store project, here I have no clue on how to check what exactly was being loaded.
The worst part is that I created package (appx) and checked the dll's being packed with exe, it seems that it includes dependencies that the app explicility uses yet something is still missing and this might be some 'hidden' dependency of one of the other dlls.
Any ideas how to debug such issues with emulator?
For me it was due to having WIC code in my App and/or calling CoCreateInstance in a windows phone environment ( on PC it works flawlessly though )
I ran into the same problem on Windows 10. Turns out, that there is no Kernel32.dll on Windows 10 phone!
Instead you need to link against OneCore.lib which provides the entire Win32 API subset that is supported in UWP. This "umbrella library" will load the correct dlls at runtime.
See also:
https://msdn.microsoft.com/en-us/library/windows/desktop/mt683763(v=vs.85).aspx

Visual Studio deployment error

"The application could not be launched for debugging. Please make sure the device is unlocked."
I am getting this error when I try to launch the app on my device for debugging.
I have tried the following:
Relaunch Visual Studio,
Reinstall Visual Studio,
Restart my computer,
I have selected both debug and release in the configuration window.
The problem is that its not getting launched even in the emulator. The emulator opens and never loads the app but gives the same error message. And I have tried to just open a new application on VS and tried to run the default application. That also gives the same problem.
Everything was working fine after I opened a few more projects for reference, It suddenly started giving this error message.
Make sure a Windows project is not set as startup(assuming you have both windoes project and phone project in the same solution). For example If your target platfrom is a Windows phone project WP7, then you cannot have a windows project as startup. This is a known reason for the error you mentioned.
Also what is the operating system you are working with? I know the error you mentioned reprorted on some OS's including Windows server 2003 and 2008. Try running your project in winsdows 7.
I suddenly got exactly the same issue today. I was coding like always and then I got this problem.
// P.S.
// Today I updated Windows from 8 to 8.1
// Then I installed VS 2013 preview
// But continued working in VS 2012 (I need R#)
// After ~ 5 hours of work I got this issue
I tried everything, deleted emulators from Hyper-V, deleted all virtual commutators, restarted VS 2012, restarted laptop, deleted Bin and obj folders from project, rebuilded project.
But nothing helped.
Then I tried to open solution in VS 2013 preview, and it works!!
I hope I help you with this answer.
If somebody know how to fix it in VS 2012, please tell us
I have a similar problem but I’m able to debug my app once I click OK on the error prompt following the “Launching TaskHost.exe failed.” message in the status bar. I haven’t been able to solve it but I’ve found a workaround that might also work for you.
Start the “Simulation Dashboard” under “Tools” and instead of starting the debugger the usual way build your project if needed and then try to start the debugger by clicking “Locked” under “Lock Screen” on the dashboard.
This answer worked for me.
Under the following:
Solution(Right-click) > Properties > Configuration Properties > Configuration
Ensure that your main project is set to 'Deploy.'

F# Script SharePoint 2010 API doesn't work

I am trying something really simple in F# to try and test interaction with the SharePoint 2010 API. I think I am running into a general problem with F#. Is there anyway that an F# script can access the SharePoint 2010 API?
I think my problem is due to the F# scripts running 32bit, and the SharePoint API is in 64bit.
An example of the code I'm trying to run is as follows:
#r "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI\Microsoft.sharepoint.dll"
#r "System.ServiceModel.dll"
open System
open Microsoft.SharePoint
let GetListByUrl (listUrl:string) =
use site = new SPSite(listUrl)
use web = site.OpenWeb()
let list =
if not (web = null) then web.GetList(listUrl)
list
In the visual studio editor it says the following error: The Type System.ServiceModel.ChannelFactory`1 is required here and is unavailable. You must add a reference to assembly ...
When the script is ran it gives the message: System.IO.FileNotFoundException: The Web application at... could not be found. Verify that you have typed the URL correctly...
Which is the error message I get if I try to access the SharePoint 2010 API from a 32bit c# console program. If I change the c# console program to Any CPU that message doesn't appear.
However I'm trying to do this in an F# script which I guess is 32bit, so how would I work around that?
Also since this is probably a general problem with F# scripts and 64bit dlls, how would you work around the problem of needing to reference 64bit dlls in F# scripts?
Edit
I used corflags.exe in the visual studio cmd prompt to modify the fsi.exe to 64bit. I followed this guide: http://ig2600.blogspot.com/2010/05/making-fsharp-interpreter-fsi-run-in.html. That seemed to work, though the F# interactive window seemed slower. However when I ran the code above in the now 64bit fsi it said sharepoint does not work with .net 4.0. How would you run the F# interactive window in .net 3.5?
Edit
Because of the answer posted by F.Aquino in which he said I needed to add a reference to System.ServiceModel I have updated the code to add that.
That fixes the visual studio editor complaints that keep appearing with red squiggly lines everywhere. When the script is ran the results are the same, the script cannot access the sharepoint 2010 API which is the problem I am having.
You need to add a reference to System.ServiceModel

Runtime Error! - Microsoft Visual C++ Runtime Library

I've developed an application in VS 2003 (C++). But while running in a fresh windows xp machine, getting error:
Microsoft Visual C++ Runtime Library
Runtime Error!
Program:
This application has requested the Runtime to terminate it in an unusual way....
What will be the reason for getting this error and how can I solve it? Please help.
This is a very generic error so it is not easy to solve from this information but I can give you a few things to try.
First check that the program runs fine on your developer machine - if not run under the debugger and trap the specific error.
If this problem only occurs on the clean machine it probably does not have the correct runtimes installed.
Your application will depend on a number of dlls that ship with visual studio, you will need to install these on the clean machine.
Your can run depends.exe from http://www.dependencywalker.com/ this will tell you what dlls cannot be found.
These dlls will be on your developer machine, you can either package the yourself in an installer or find the correct redistributable from microsoft.
Another thing to check - have you hardcoded any file locations? e.g. your application could try and open a file, resource, registry key - something that does not exist in your clean machine - if the code does not check for failure you would then probably crash at some point after the read failed to happen.

Resources