.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Imran Ghani
Sohaib Khalid
Post New Web Links

MVC3 Beta requires WebMatrix.Data?

Posted By:      Posted Date: October 07, 2010    Points: 0   Category :ASP.Net

Switching a project from MVC3 Preview 1 to MVC3 Beta 1 and getting the following error when running:

Compiler Error Message: CS0246: The type or namespace name 'WebMatrix' could not be found (are you missing a using directive or an assembly reference?)

This is on the home/index view which is generated from Razor. The generated class is:

Line 1:    #pragma checksum "C:\Dev\Furld\src\Web\Views\Home\Index.cshtml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "7DA68551EE4CE5365FE9A03790329360"
Line 2:    //------------------------------------------------------------------------------
Line 3:    // <auto-generated>
Line 4:    //     This code was generated by a tool.
Line 5:    //     Runtime Version:4.0.30319.1
Line 6:    //
Line 7:    //     Changes to this file may cause incorrect behavior and will be lost if
Line 8:    //     the code is regenerated.
Line 9:    // </auto-generated>
Line 10:   //------------------------------------------------------------------------------
Line 11:   
Line 12: 

View Complete Post

More Related Resource Links

wss2.0 Infopath 2007 'This form requires connections to data sources when it is loaded. At least on


Hi all

I have a user who receives the error 'This form requires connections to data sources when it is loaded. At least one of these connections is not available. As specified by the form designer, this form will not open' when trying to Submit an infopath form located on a WSS2.0 site.

The user has been having this issue since upgrading to Office 2007 and IE7. I have had the user run an Office Diagnostics but this has not resolved the issue.

I am not aware of any other users experiencing this issue.

Any ideas please?

Error adding connection in Server Explorer: "Unable to add data connection. ExecuteScalar requires a

I'm using Visual Studio 2008, and my database is SQL Server 2000. I want to add a connection to the Server Explorer in VS. The Data source is Microsoft SQL Server (SqlClient). After entering in all my information and I click Test Connection, it is successful. But when I click OK, I get the error: Unable to add data connection. ExecuteScalar requires an open and available connection. The connection's current state is closed.What's going on here?

Error while Deploying WebMatrix Beta Application having SQL Database on Remote Server


Hello All,

I have created "DotNetNuke SQL Database Application" from the WebMatrix Gallery.

Now I want to deploy it on the remote server using Web Deploy method.

Without selecting SQL database, application is deployed successfully but when I select SQL database it gives following error:

Publish : Error - Make sure the database connection string for the server is correct and that you have appropriate permission to access the database. (Web Deploy provider is dbFullSql).

Can anyone have the solution of this error?

Thanks in advance....

WebMatrix beta 2 @Analytics.GetGoogleHtml


Yesterday I upgraded from WebMatrix beta 1 to beta 2.

Published my site and it worked.

Except locally on my PC I couldn't get @Analytics to work (on beta 2) I got an error that @Analytics was not defined, while it worked on beta 1.

Can anybody tell me what to do?

MVC3 Beta Razor Views - not partial classes


Why are Razor views not generated as partial classes? Making them partial classes gives us the option to have a code behind where we can do some of the stuff we're forced to do in the template itself in the code behind file.

Yes, I know the standard "go-to" thing is Html helper but I don't want to use Html helpers for these things as they are too specific to the view in question and besides, having a clutter of extension methods is just not the way to go.

I'd like to see Razor views generated as partial classes.

MVC3 beta Razor View Base class/inheritance issues


There seem to be a few issues in the way Razor views are designed and the code generated

1. Descendants of WebViewPage are forced to override Execute() (since it is abstract) but that method is never called. Why?

2. The virtual method ConfigurePage is never called in descendants that override this method.

3. CreatePageFromVirtualPath is no longer virtual. This was the one method that gave us access to the Layout Page (Master Page) instance. Now we no longer have this access. Why was this done?

How can one get access to the instance of a Layout page?

WebMatrix beta 2 - FileUpload helper doesn't work



I have this code working in beta 1:

            <form id="imageForm" method="post" enctype="multipart/form-data" action="#imagesTab">
                <input type="hidden" id="itemId" name="itemId" />
                    initialNumberOfFiles: 1,
                    allowMoreFilesToBeAdded: true,
                    addText: "Add another file",
                    includeFormTag: false)
                <button type="submit" id="submitImageData">Upload</button>

But now I get Compilation Error:

Compiler Error Message: CS0103: The name 'FileUpload' does not exist in the current context

MVC3 Beta Interfering with Classic ASP Form Posts


Unfortunately we have classic ASP that must co-exist with MVC in the same site. I'm doing some testing with MVC3 beta and ran into a strange issue with form posts in classic asp that does not appear in the the preview or in prior versions of MVC. To repro the issue simply create a stock MVC3 beta project and run it under IIS7.5 (Not the development server). Then add a couple of classic asp files; one that posts to another:


<form method="post" action="process.asp">
<input type="text" name="yada">

MVC3 Beta Source Code


I cant seem to find the source code for the MVC3 beta release. The source code on the codeplex site hasent been updated in a few months. Is the MVC source repo somewhere else?



Error Running WebMatrix Tutorial 6: Displaying Data on a Grid


              <hiddenSegments applyToWebDAV="true">
                    <add segment="web.config" />
                    <add segment="bin" />
                    <add segment="App_code" />
                    <add segment="App_GlobalResources" />

MVC3 Beta: Do deployment packages work?


Do deployment packages work in MVC3 Beta 1?
Mine seem to be created without any views.

MVC3 Beta @Html.AntiForgeryToken() problem



I am getting strange error when trying to use @Html.AntiForgeryToken() in my views.

The error is:

[ArgumentNullException: Buffer cannot be null.
Parameter name: buffer]
   System.IO.MemoryStream..ctor(Byte[] buffer, Boolean writable) +9638183
   System.IO.MemoryStream..ctor(Byte[] buffer) +6
   System.Web.Mvc.AntiForgeryDataSerializer.Deserialize(String serializedToken) +97

[HttpAntiForgeryException (0x80004005): A required anti-forgery token was not supplied or was invalid.]
   System.Web.Mvc.AntiForgeryDataSerializer.Deserialize(String serializedToken) +397
   System.Web.Mvc.HtmlHelper.GetAntiForgeryTokenAndSetCookie(String salt, String domain, String path) +160
   System.Web.Mvc.HtmlHelper.AntiForgeryToken(String salt, String domain, String path) +16
   System.Web.Mvc.HtmlHelper.AntiForgeryToken() +10

Am I doing something wrong. The request till this exception is raised is GET, not POST. I thought that on GET the token is generated and than is validated on post.

Please advice.<

Announcing NuPack, ASP.NET MVC 3 Beta, and WebMatrix Beta 2

I'm excited to announce the beta release of several projects today. Two of these releases - ASP.NET MVC 3 Beta and WebMatrix Beta 2 - are evolutions of projects we first previewed this summer.  The third - NuPack - is a new project that I'm particularly excited about. NuPack - Open Source Package Manager for .NET NuPack is a free open source package manager that makes it easy for you to find, install, and use .NET libraries in your projects. It works with all .NET project types (including, but not limited to, both ASP.NET Web Forms and ASP.NET MVC). NuPack enables developers who maintain open source projects (for example, projects like Moq, NHibernate, Ninject, StructureMap, NUnit, Windsor, RhinoMocks, Elmah, etc) to package up their libraries...(read more)

PreApplicationStartCode in MVC 3 beta: Making MVC3 not very modular IMO



I am trying to upgrade from MVC 2 to Mvc 3. I am using 3rd party view engine, and 3rd party data access technology, and like to move code in from 'modules' at start up in my own bootstrapper.

But MVC 3 is playing tricks on me. It insists that I bring in System.Web.WebPages, System.Web.WebPages.Razor, WebMatrix.Data, because it uses the new asp.net 4 stuff to bootstrap the app domain with razor build providers, webmatrix database facades (and to be honest code I don't know about, and code I would like to know about at my own free will)

[assemblyPreApplicationStartMethod(typeof(System.Web.Mvc.PreApplicationStartCode), "Start")]

Is this design really optimal? It doesn't seem very modular that MVC 3 carries this much  
weight for users not using razor, webmatrix.data?


Webmatrix.Data.Database.Query() method return type


I'm using the Webmatrix.Data.Database.Query method to return a result set in the following form

var myResult = db.Query("Select * from mytable");

How do you cast myResult to get the count of records returned? I'd like to do something like


Anyone successfully imported suplemental profile data through BCS in Beta 2?


I've created a User Profile service application and successfully imported AD information into it.  I have a SQL 2008 database I'd like to use to supplement the profiles with data.  I created an external content type through VS 2010, successfully deployed it into the environment and tested that it worked by creating an external list to see the data.  I have a field that acts as the identifier for the ECT which matches a custom property I created in the profile store, which is mapped to the sAMAccountName in AD.  This property is being filled with the AD information without any problems.

I set up a connection to the external content type through the Profile service application without issue, selecting the existing property I created that the external content type connection should use to match up with the profile properties.  I then created a couple of profile properties and successfully mapped them to the corresponding fields in the external content type.  (NOTE: one thing I did notice after I mapped the properties - in the list of profile properties, after one is mapped, you usually can see the mapping in the associated column.  I see that for the properties mapped to AD, but don't see it for the properties mapped to the external content type.)  I then ran a full synchronization.

After completing, I pull

Invalid Model Data Base. Requires Version:3 but has Version: 0


Hi everyone…  I interpreted and installation manual wrongly.  So I assume that a needed to remove and re-install my SQL server 2005. The manual clearly mention that it will be a good Idea to back up my files. I follow the manual instructions and backed up all the files … 4 totals.

Re-install the SQL server 2005 and all working just find. After the installation I try to restore by backup files. Its looks like it does It and suddenly I got and error message. 

“unable to login user to database with the EXECUTE permission was denied on the object ‘p_CreateSeccion’, database ‘422-chaff’, schema ‘dbo’.”

Well this I have check the size of the mdf and ldf files and they are the same as my previous files ( notice that I have a complete copy of the folder where the SQL used to be install, So I have all the old files) but if I try to load the data file it show this error message.

“invalid model database. Requires Version: 3 but has Version:0”

I call the office from the guys how made the software I’m using and they will need to research it, they say is a version issue saying that my backup files have a newer version that my SQL server or something like this.

Does someone know how to fix this or upgrade, downgrad

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend