System.Web.Webpages.Razor Version=1.0.0.0

Posted on by

System.Web.Webpages.Razor Version=1.0.0.0' title='System.Web.Webpages.Razor Version=1.0.0.0' />System.Web.Webpages.Razor Version=1.0.0.0System.Web.Webpages.Razor Version=1.0.0.0BIN Deploying ASP. NET MVC 3 with Razor to a Windows Server without MVC installed. If someone says just bin Deploy it they mean deploy the application with the dependencies copied into the applications bin folder, rather than running an MSI that installs the dependencies into the Global Assembly Cache GAC. You may not have administrative control over your Web Server and your host may not want you running installers when new stuff like ASP. NET MVC 3 and Razor comes out. Youll want to bin deploy these new technologies. Heres two ways. The simple way and The Awesome Way. The Manual Way to BIN Deploy ASP. NET MVC 3 with Razor. On your development machine that has ASP. NET MVC 3 installed you have a C Program FilesMicrosoft ASP. NETASP. NET MVC 3 folder and a C Program Files x. Microsoft ASP. NETASP. NET Web Pages folder. In those folders are Assemblies folders. ASP. NET MVC itself references these additional assemblies. System. Web. Mvc well, we ARE this assembly, actually Microsoft. Web. Infrastructure System. Web. Razor System. Scott Hanselman on Programming, The Web, Open Source. NET, The Cloud and More. I am trying to use ViewBag in my application, I have all of the recent dlls, the latest version of MVC 3, but yet I am still getting the Error The name ViewBag. This document describes the release of ASP. NET MVC 4. I have been able to develop a simple asp. Can someone help me doing the same for a asp. Starting from getting the ASP. NET MVC 3. Web. Web. Pages System. Web. Web. Pages. Razor And the default Web. After you deploy your ASP. This document describes the release of ASP. NET MVC 4 Beta for Visual Studio 2010. System.Web.Webpages.Razor Version=1.0.0.0' title='System.Web.Webpages.Razor Version=1.0.0.0' />NET MVC 3 Razor application, youll need to manually copy these five assemblies to the bin folder of your deployed application. NOTE Its possible to just reference these assemblies directly from your application, then click properties on each one and set copy. Localtrue. Then theyd get automatically copied to the bin folder. However, I have a problem with that philosophically. Your app doesnt need a reference to these assemblies. Its assemblies your app depends on. A depends on B that depends on C. Why should A manually set a dependency on C just to get better deployment More on this, well, now. Now, you likely remember that If youre using XCOPY for deployment, youre doing it wrong so youre likely wondering how to make this deployment process less manual and more awesome. The Alpha Geek Show Off Fancy Pants Future Proofed Way to BIN Deploy ASP. NET MVC 3 with Razor. I created a custom Windows 7 Virtual Machine that had only IIS7 and. NET 4 installed, plus Web Deploy, and nothing else in order to test this scenario. This machine has never seen ASP. NET MVC 3 or Razor and were not installing anything on it. Its our pretend shared host. In my ASP. NET MVC Application, Im going to create a folder called bindeployable. Assemblies. Yes, thats a underscore in the front. IIS will not serve from folders whose first character is an underscore. You can thanks Front. Page for that feature. In fact, this guarantees that even if you accidentally copy this folder up dont it wont be served. Apparently I got bad info on this from the IIS team. Im looking into this statement as its incorrect. Create a bindeployable. Assemblies folder. Copy the assemblies we want bin deployed into this bindeployable. Assemblies folder. Select them all, right click and hit properties. Set their Build Action to None. You are expected to check these into source control as well. Heres my Solution so far Here comes the secret awesome sauce. NOTE Youre reading this on some random dudes blog, so lower your expectation of support now. No, lower. Bit lower. There. Yes, thats zero support. If this accidentally formats your harddrive or deletes your source code, kick yourself hard so youll wake up to the previous level of Inception, specifically the one where the skinny kid from Third Rock From The Sun is walking on the ceiling. Be careful. Make backups. Get ready, because we are going into the belly of the beast. This is for VS2. 01. Also, your Program Files folder will vary depending on your x. Windows. Go into C Program Files x. MSBuildMicrosoftVisual. Studiov. 10. 0Web. Applications and make a copy of this folder. Put it somewhere safe. Go  into C Program Files x. MSBuildMicrosoftVisual. Studiov. 10. 0Web and make a copy of this folder. Put it somewhere safe. Download this file and unzip it somewhere Fancy. And. Totally. Unsupported. Record Label Contracts Pdf. MSBuild. Files. For. Bin. Deployable. Assemblies. Inside is C Program Files x. MSBuildMicrosoftVisual. Studiov. 10. 0Web. ApplicationsMicrosoft. Web. Application. C Program Files x. MSBuildMicrosoftVisual. Studiov. 10. 0WebMicrosoft. Web. Publishing. Only. Files. To. Run. The. App. targets Copy these new files OVER your existing ones remember, the ones you backed up Now when you build your Web Application, all the files that are in bindeployable. Assemblies will automatically get copied into your bin folder. This is better than a simple Post Build Step Batch File because it works specifically with publishing. Now, you can right click on your Web Project and Publish. PLUS the bindeployable. Assemblies folder. I could publish directly to my Shared Host, or I can Build Deployment Package and get a ZIP file with all the things my app needs. For me, as I have a VM remember that I put Web Deploy on it and from IIS Manager just Import Application. Some hosters have a control panel for this, but youll likely use Web Deploy or Publish via FTP. This is a nice, clean, self contained way to bin deploy an ASP. NET MVC 3 application with Razor views to a host that doesnt have any of these bits installed. INTERESTING NOTE In a future update to Visual Studio 2. SP1, which Im not allowed to say this feature will be built in. Because with this hack weve only messed with our built in build targets, those files weve modified will be torched replaced with the new Visual Studio updated files, effectively undoing what weve done here. Its a future proofed hack. EnjoyThe name View. Bag does not exist in the current context. I had already tried deleting the bin and obj file and restarting VS and had no luck. Ive also had this issue many times and its a pain to solve each time. Often it is due to the web. This means click on the reference in Visual Studio to see the version in the property tab, and then match it to the version in the web. Another way is if possible upgrade to a later version of the. Visual Studio. I can only assume its changing something in the A quick check of the diff between the csproj file doesnt actually show any major difference. But the differences it did show was Ive added remove to show the old linelt Project Tools. Version4. 0 Default. TargetsBuild xmlnshttp schemas. Project Tools. Version1. Default. TargetsBuild xmlnshttp schemas. Target. Framework. Version v. 4. Target. Framework. Version remove. Target. Framework. Version v. 4. Target. Framework. Version. In the Web. Config file not the one in Viewlt add keywebpages Version value2. Version value3. It also added to the same web. I manually removed it lt system. Microsoft. Code. Dom. Providers. Dot. Net. Compiler. Platform. CSharp. Code. Provider, Microsoft. Code. Dom. Providers. Dot. Net. Compiler. Platform, Version1. Cultureneutral, Public. Key. Token3. 1bf. Level4 compiler. Optionslangversion 6 nowarn 1. Microsoft. Code. Dom. Providers. Dot. Net. Compiler. Platform. VBCode. Provider, Microsoft. Code. Dom. Providers. Dot. Net. Compiler. Platform, Version1. Cultureneutral, Public. Key. Token3. 1bf. Level4 compiler. Optionslangversion 1. MYTYPE quot Web quot option. Infer. lt compilers. Finally, in the Package Manager Console, add update package. Run the website locally and see any compilation errors which was fixed by my second paragraph matching the versions of the references.