Visual Studio 2013 / Webmatrix 3 - Can not run website and The name 'WebSecurity' does not exist in the current context - visual-studio-2013

I've got a Website I originally wrote in Webmatrix 1 based on the Starter Site demo, but I have always used Visual Studio to edit it as you can debug from there.
The website works fine still, but I recently got a new laptop and it has the latest versions of Webmatrix and VS, and now I can not run the website locally, I get "Page can not be displayed" and also I am getting errors "The name 'WebSecurity' does not exist in the current context". If I specify the full name "WebMatrix.WebData.WebSecurity" then it compiles fine but will still not display the page.
I created a new Starter Site using Webmatrix 3 and it works fine (Websecurity works and website can be run and debugged locally). I have checked in _AppStart and web.config and I can not see anything obvious.
Does anyone have any idea how I can get my old website working in the new tools? Specifying the names fully is not the end of the world but I could really do with being able to run it so I can debug.
Thanks a lot,
Dave.

I have no real clue, but your original web site was developed under an ASP.Net Webpages version that probably is not installed on your new computer. As to the fix, if you haven't done it already, create a new site with web matrix (or visual studio...you can make asp.net web pages site with VS now I believe) and copy your code in and tweak where it bombs. I think the differences in ASP.Net web page versions are very minimal but there might be some gotchas. Good luck.

Related

Create Visual Studio 2019 project from existing Azure Web App

I have a v7 Umbraco instance as a Web App on Azure but the machine the dev copy was on has been decommissioned and I need now to recreate the dev site in Visual Studio 2019, ideally cloning it from the live site in some way. I have created an empty project and, using the cloud explorer, downloaded the files from the app, but I am unclear whether I just copy them directly into the solution folder or into their own subfolder of the solution folder or whether simply copying them in will do the trick anyway as there's still the database to consider as well. I'm afraid I haven't used Visual Studio since creating this site three or so years ago and I seem to have forgotten most of what I did then anyway, so any help wpuld be greatly appreciated. The only advice I coud find via google was for older versions of VS and so not much help.
Recreating the original project from the live site is probably not going to be possible. It depends how and what you deployed to the live site.
It sounds like what you have is a working live site, but have lost access to the original source code. You should be able to copy the site and get it working elsewhere, but you're probably going to struggle to recreate the original development environment and amend the compiled elements of the website without access to the source code.
The Umbraco.com website has some great documentation on getting started and setting up Umbraco. Umbraco TV is great for getting up to speed quickly too. This should help explain the project structure. I suggest you create a blank Umbraco install to familiarise yourself with how Umbraco works(I wrote a post explaining how to do this with MS VS2015 here).
A typical deployment, using MS WebDeploy or FTP from Visual Studio, wouldn't deploy the project files or source-code for the compiled (.cs) elements of the website, these are usually kept as development files and checked in to source control.The live site probably only has the compiled versions of these file in the bin folder. The good news is the Razor template and view files(.cshtml) should be on the server.
However, if everything was uploaded (it happens) then you may have a chance, in which case you can download the files, potentially open the project and try to run the project locally on the development machine. There's no reason why you can't install an older version of MS Visual Studio alongside 2019 if there's an issue with that version. Although, I suspect this isn't an option since you felt the need to create a new empty project. If this is the case you might be able to add any project files to the the new empty project and attempt to recreate the project that way.
Regarding the database. You're going to need a copy or backup installed on a Microsoft SQL Server (unless you used MS SQL CE which is file based). You should be able to download a .bak file from the server if you're using Plesk or connect remotely using MS Management Studio if not, it depends on the host (Azure will allow access via MS Management Studio). Umbraco will need the connection string configured in it's web.config, the one you downloaded may be trying to connect to the live server so be careful.
Long shot ideas:
If you're really desperate you might be able to reverse engineer some of your compiled .dll using a tool like ILASM.exe but it's not going to be easy;
Perhaps you could reference the .dll in a the new project and it will all work auto-magically?! but I doubt this will work as there will be two application starting points and you'll probably get a runtime exception.

Azure Web Site not updating via Visual Studio Web Deploy

This may be a basic question, but I've searched for a little while and couldn't find anything specific to this.
I bought a domain and created the web app in Azure for hosting, and set up the DNS so that it's linked to the Azure Web App. Using Visual Studio 15, I opened the website via the FTP connection settings found in Azure, and was able to create files, edit the html, css, etc. Going forward, I wanted to use Web Deploy with Visual Studio to push new builds of the code up to the web site. I downloaded the publish profile from Azure, and imported it into a new visual studio project. I also copied all the previous files over(it wasn't alot). I got the correct Web Deploy settings and successfully published the solution to the Web App in Azure. However, it never updates the code with my new changes. When I look at the site in Firebug it still has the same files/code that it had when I edited it via FTP.
Any idea what I'm doing wrong?
I followed your steps and everything published perfectly for me. Did you try to simply refresh the file list to make sure Visual Studio is seeing all your files? Are they included in your project?
Also, when you go to publish, on the 4th step labeled preview, try to hit "start preview" and see if it detects any changes.
Also, could you tell me a bit more about your project? Is it a website project folder, mvc solution, etc?
You could try to clean the website to make sure your new files are getting deployed.
Clean Windows Azure Website

Visual Studio keeps requesting missing web components

When I open a particular mvc 3 website project in VS 2010 I get the following message:
The Web Project "X" requires missing web components to run with Visual Studio. Would you like to download and install them using the Web Platform Installer now?
ASP.NET Web pages with Razor syntax.
When I click yes
The web platform installer shows with the message that "0" items need to be installed.
My other mvc 3 projects do not show this behavior
Not a major inconvenience, but still...
thoughts any one?
I got the same error after reinstalling my computer.
I came to this conclusion, VS needs IISExpress to load my additional project. The addition projects has a webservice and it can run locally. Even if my endpoints points to a local address it still needs the IISExpress (standard IIS 7.5 does not respond the endpoint request) to open from VS (im running VS2010).
So after installing IISExpress i could reload my project in VS.
C.,
That shouldn't happen, and it would be interesting to figure out why. In the meantime, you should be able to turn this off by unchecking the "Package Restore" checkbox in Visual Studio's Options dialog. (Select "Package Manager" in the tree view to find it.)
If it's happening only for specific projects, you can solve this more surgically by removing the packages.config file for the affected project. In fact, if you want to do root cause analysis, you should look into why that file exists and how it got there.
HTH,
Clay

How to publish my MVC 3 web application onto IIS7

if possible I need total from the beginning utter beginner advice on how to get my ASP.Net MVC 3 Razor Visual Studio 10 web application live onto my IIS 7 webserver please?
I've never tried to publish this before, and wondering what I'm missing?
I've clicked "Publish" on Visual Studio Express 10, created a "published" version of the website. I've uploaded it to my webserver, however can't make it load on the net?
Appreciate some guidance please? (not sure how / what default documents work etc...?)
By far the easiest approach is to use Web Application Deployment.
This blog by Scott Gu gives a great intro
http://weblogs.asp.net/scottgu/archive/2010/07/29/vs-2010-web-deployment.aspx
The article talks about web.config transformations (ability to have a .Release and a .Debug version of your web.config). Later, that capability was generalized through an add-on package to work for any XML-structured file in your deployment (for example, I use it with NLog configuration files).
http://www.hanselman.com/blog/SlowCheetahWebconfigTransformationSyntaxNowGeneralizedForAnyXMLConfigurationFile.aspx

Visual Studio 2010 Debugging issue

I have a problem with debugging my Silverlight 4 (hosted in ASP.NET MVC2) in Visual Studio 2010. It was working fine until I tried remote debugging. After a lot of hassle I managed to configure remote debugging but it worked only occasionally. So I created a new app and copied my classes one by one, but now I see I cannot debug not only remotely but also "locally" in development server. Breakpoints in Silverlight code says "The breakpoint will not currently be hit. No symbols have been loaded for this document." Strangely enough, if I run my app it will show my previous code results. (It may be relevant, before this problem I noticed that my app doesn't update immediately when I publish to remote web server. So I did the following for all projects in the solution:
//In AssemblyInfo.cs in Properties folder
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("1.0.*")]
I'm adviced that it will automatically generate version numbers so, when I publish to remote server it will immediately take into effect, which seems working well.)
However, if I change development server's port number, in the properties page of my ASP.NET MVC app, then I'm able to debug locally (about remote debugging I just gave up). But, it didn't last long; after some updates in my code the problem suddenly reoccurs. I guess development server deploys my app somewhere in a folder per port number, but where? May be, if I delete that folder, will the problem be solved? Can somebody advice me what to do?
There seems to be bug in Visual Studio 2010; see:
silverlight 4, dynamically loading xap modules

Resources