How do I resolve a CS0103 compilation error when using the Video object in the ASP.NET Web Helpers Library? - webmatrix

I am starting to learn web development using Microsoft WebMatrix 3. I'm using the book Introducing Microsoft WebMatrix, which targets an earlier version, but a lot of things are the same. I'm getting compilation errors when I attempt to use the Microsoft ASP.NET Web Helpers Library, though, and I don't know why or how to troubleshoot the issue. Specifically, I am getting compiler error CS0103 when attempting to use the Video object or the LinkShare object. I've been searching the Internet for days, and I can't find anyone that has had the same issue and resolved it.
Steps to Reproduce the Error
Run WebMatrix 3.
On the Quick Start page, click New, then Template Gallery.
Select Empty Site, and click Next. A new site named "Empty Site" is created.
Open the Default.cshtml page for editing.
Based on the tutorial Displaying Video in an ASP.NET Web Pages (Razor) Site, add the following to the body of the page:
#Video.MediaPlayer(path: "myvideo.wmv",
width: "400",
height: "600",
autoStart: true,
playCount: 2,
uiMode: "full",
stretchToFit: true,
enableContextMenu: true,
mute: false,
volume: 75)
Run the site. An error page appears in the browser with the following statement:
"Compiler Error Message: CS0103: The name 'Video' does not exist in the current context"
Fair enough. I'll use NuGet to obtain the Microsoft Web Helper Library.
Back in the WebMatrix window, click NuGet.
Select the WebMatrix Package Source.
The following error message appears:
The schema version of 'Microsoft.AspNet.WebPages' is incompatible with version 2.5.40416.9020 of NuGet. Please upgrade NuGet to the latest version from http://go.microsoft.com/fwlink/?LinkId=213942.
Click OK to ignore the error and continue. I tried going to that website and following the instructions, but I already have the latest version of NuGet for WebMatrix.
Type Web Helpers in the search box and press Enter.
Select "ASP.NET Web Helpers Library" and click Install. Confirm the installation and accept the EULA.
The same error regarding the schema version of 'Microsoft.AspNet.WebPages' appears. Click OK to ignore the error.
Click Close to exit the NuGet Gallery, and click OK to close any remaining error windows.
Run the site. The same error message as before appears.
This demonstrates the error with the Video object, and I am also receiving the same error when I attempt to use the LinkShare object.
Environment Information
OS: Windows 8.1 Pro with Media Center Version 6.3 (Build 9600)
Browser: Internet Explorer 11.0.9600.16476; Update Versions: 11.0.2 (KB2898785)
WebMatrix Version 3.0 Version Information:
WebMatrix: 7.1.1932.0
IIS Express: 8.0.8418.0
.NET Framework: 4.0.30319.34003 built by: FX45W81RTMGDR
Web Deploy: 7.1.1762.0
Web Platform Installer: 7.1.40719.0
ASP.NET Web Pages: 2.0.20715.0
Project Information
The following packages are shown under Empty Site → App_Data → packages:
Microsoft.AspNet.Razor.2.0.20715.0
Microsoft.AspNet.WebPages.2.0.20710.0
Microsoft.AspNet.WebPages.Data.2.0.20710.0
Microsoft.AspNet.WebPages.WebData.2.0.20710.0
Microsoft.Web.Infrastructure.1.0.0.0
microsoft-web-helpers.2.1.20710.2 ← added by NuGet
The following DLLs are shown under Empty Site → bin:
Microsoft.Web.Helpers.dll ← added by NuGet
Microsoft.Web.Infrastructure.dll
System.Web.Helpers.dll
System.Web.Razor.dll
System.Web.WebPages.Deployment.dll
System.Web.WebPages.dll
System.Web.WebPages.Razor.dll
WebMatrix.Data.dll
WebMatrix.WebData.dll
Summary
I'm getting the CS0103 compiler error when attempting to use the Video object or the LinkShare object from the ASP.NET Web Helpers library. It's clear that the compiler is not locating definitions for the objects I am trying to use, but I do not know why, and as a WebMatrix beginner, I don't know how to figure out why. In Visual Studio, this error would indicate that I am probably missing a reference in the project, but everything seems to be present in the project in WebMatrix, and nothing seems to be missing from the command line shown on the error page.

Related

Many bugs and errors in 2SXC installation

Many bugs and errors in 2SXC installation
Can someone please give me some help?
This is supposed to be trivially easy.
I have spent 7 hours on this and got nowhere.
In deploying the module on new DNN install :
DNN PLATFORM
v. 09.02.01 (533)
Install 2SXC into the DNN - Successful
Deploy Content Module on to empty page: Successful
Click circular icon. Popup appears requiring Auto Configure button to be clicked.
Auto-Configure Content for 2sxc 11
Dialog Text:-
Auto-Configure Content for 2sxc 11? (Yes, I do)
install recommended content package? (Yes, I do)
Popup: Do you want to install these packages? (Yes, I do)
- Default content for 2SXC11
It takes about 10 seconds per package. Don't re-load the page while it is installing.
I click OK
1 second later
Popup: An Error occurred.
An Error Occurred
Spinner rotates ad infinitum
Try the help page: It says:-
"Run Auto-Configure and confirm the "are you sure" question, then wait a few seconds. Once you see the confirmation, everything worked". (Oh, No. It certainly did not!)
Installing default content templates
An error occurred.
Looked up the Wiki
Tried to upload the Content Templates .zip file into a Content Module Admin/App. An Error Occurred on the upload. Instruction says: See below for error. (There was nothing below).
Any advice welcome!
What you describe should be really easy - I agree.
My guess is that something has gone wrong in a way that's hard to spot. Maybe an installation once got interrupted or something like that. It should be easy, so I really suggest one of the following options:
Quickly replay the same scenario with a blank DNN to experience how it should work, and to ensure that your PC isn't doing something funny (for example, the file is downloaded by the DNN server, and if your PCs firewall would prevent the IIS from getting files, this would fail).
If that worked, probably just uninstall 2sxc completely and also uninstall the DB (that doesn't happen automatically, because you may just uninstall and want to keep the data) - use https://azing.org/2sxc/l/Kf5yDYQq/uninstall-2sxc - then try again
Ask a friend to play this through once with you
We just installed 2sxc on our development site, I’m super hopeful about it working - especially its ability to generate a json / json api. But! Today I used the Evoq page settings to delete “Content” instances on a test page - after that the “Add Module” to add a new “Content” instance fails - 2sxc’s javascript fails. Mysterious why just removing then trying to add “Content” instances would break 2sxc.

HttpRequest.TransportInformation not available in UWP app

I need to validate SSL certificate of a website in my UWP app, and I am following the method described at this URL: https://learn.microsoft.com/en-us/windows/uwp/security/intro-to-secure-windows-app-development, but there is no TransportInformation property available under RequestMessage class in my IDE, and the intellisense complains about it too. I'm using VS2017, .NetCore 5.3.3, target Version 15063 min version 10586. Please help!
Make sure you're using Windows.Web.Http.HttpRequestMessage and not System.Net.Http.HttpRequestMessage. TransportInformation is a member of the Windows.Web version only.
You can use Visual Studio's object browser to help find which class a property is in. Browse "My Solution", search for TransportInformation, and the Object Browser will point you to Windows.Web.Http.HttpRequestMessage.

App designer not working for existing titanium apps - XML parse error

I tried to use app designer with an existing app to see if it could render the views properly. However, when I open an existing view in app designer mode it shows the error
XML Parsing Error
Line : 1
Premature end of file.
I've tried this with a brand new project and it seems to work fine without error. I am also using the latest SDK with my old project (5.4.0).
Another thing I wanted to try was using the "Movies" demo app with the app designer and it didn't have an error but it did show a blank page and only when you turned on "Show Anchors" from the toolbar did it show some outlines of controls but they were not in the correct places.
Hopefully someone has some ideas but it seems to me this only works with brand new projects for some reason.
I've looked in the studio log files too and there's no entry for app designer when I use it and see this error message.
Thanks in advance for any help!

Error: The Web Server 'http://dnndev/Website/DesktopModules/DNNSample/' could not be found

i followed the video tutorial there at http://www.youtube.com/watch?v=yKW97CqVb1Y.
but when i create the project am getting an error
"The Web application project DNNSample is configured to IIS.The Web Server "http//dnndev/Website/DesktopModules/DNNSample/" could not be found."
i have tried restart IIS etc by googling. but none helped.(Satck)
Am using VS10. IIS is 7.5. C# template i have downloaded.
Any help.. am stuck.
Thanks in advance.
i have same problem, i solved that At the host name “dnndev” to the bindings of IIS 7.5. you can Open Internet Information Services (IIS) manager and right click on your website and then click to Edit Bindings... then you add to new binding which has name is "dnndev".

ASP.NET MVC 3: Microsoft JScript runtime error: Object doesn't support property or method 'addEventListener'

Error context:
Visual Studio 2010 Service Pack 1
ASP.NET MVC 3 Application
IE9 with Script Debugging enabled for Internet Explorer
Error conditions:
Execution stops int a JavaScript file called "script block [dynamic]" at the following line
doc.addEventListener("DOMNodeInserted", onDOMNodeInserted, false);
that line of code is nested inside the following if block
if (ver >= 9.0)
{
doc.addEventListener("DOMNodeInserted", onDOMNodeInserted, false);
doc.addEventListener("DOMNodeInsertedIntoDocument", onDOMNodeInsertedIntoDocument, false);
}
This is a very persistent error that started happening after I re-imaged my hard drive and reinstalled VS 2010 SP1 and ASP.NET MVC 3. I did it twice to make sure I did it right.
I am going to take a guess and suggest that this bug is the side affect of an un-handled exception in ASP.NET MVC 3 or a bug in IE9. The error seems to ocurr when a (GET?) action method cannot be found that is specified in the ActionLink HTML helper method such as
#Html.ActionLink("Link Text", "Action")
I believe that IE9 does support addEventListener so the error itself is incorrect. Unless I can get more info this error is beyond my ability to fix its cause. I can prevent it by making sure that my action method is there and that it works. That is a workaround not a fix. Fixing the error would prevent it from being erroneously reported because IE9 does in fact support addEventListener.
An answer has been found to this question. The problem was caused by the Divix browser plugin
Solution: Object doesn't support property or method 'addEventListener'
Thank you to a poster on the asp.net forums for helping to solve this problem. The Divix browser plugin has recently been updated. The update may have fixed this issue. However, it remains disabled on my system. Disabling the Divx plug-in definitely fixed this issue for myself and others. I have reported this bug to Divx support.
I've been getting this error today while working on a VS 2010 project, I was using IE9 for my browser. Turns out it's an erroneous message, I should have been getting a page not found error. I tried disabling Divx as mentioned above, but that didn't help. I then tried using Chrome and it reported my error correctly and I was able to solve my problem.
If you get this error, try a different browser which may point you in the right direction.
I turned off Compatibility Mode (was running on local intranet) and the problem went away.

Resources