Migrating ASP.NET Web Application to Mac Rider - c#

I have a project on VS 2019 Windows machine that is fairly small but containing Web Forms. I have taken the whole project folder zipped it and loaded it in directly to JetBrains rider on the Mac. Here is what it looks like currently.
1 Errors on solution
2 What the error says on every web form page
It appears that the System.Web.UI is not accepted on the Mac.
I have looked all over and the forums are telling me to download a package that proceeds it. This does not exist either. How do you replace the System.Web.UI?

WebForms are out of date and cross-platform of the web form is not impossible, but you will need to take into consideration everything that is used on the master page. It is not only a problem with MAC but any other IDE other than Visual Studio. You are better off migrating to the MVC style, it may take time but it appears to be the industry standard. WebForms are supported in Rider, however, you must manually create all the pages that belong with it like the master, and ensuring the routing is the same. Also, it seems to be severely difficult to connect an MVC application with WebForms. You would have to create the same exact style with _layout.cshtml and Site.master page. Seems like an outdated process that works if you want to just make forms.

Related

asp.net solution with two projects; Why is Request.Form broken and how can I make it work?

I have a VStudio Solution I started in VS 2013.
At that time I included one project, a WebForms project .net 4.5
It worked fine.
Since then I've opened the solution in VStudio 2015.
The current project still works fine.
but I've added a second WebForm project & again .net 4.5.
one big difference is this new projects, although I select WebForm still sets up an MVC site.
In the previous site I can call a page and I get what I expect of Request.forms.
In the new site, even though I've tried to remove everything MVC, Request.Form is always empty.
Why is Request.Form broken and how can I make it work?
You said you removed everything MVC, which IMO means removing dll references but still an MVC project works on Routes and not actual files, creating a WebForms Website instead might be the solution
Request.Form is simply broken.
Request.Param[] replaces it it I guess.
Thank you Microsoft.
I've gone through so many iterations of test of VS 2015.
The answer is simple. Microsoft has yet again f'ing broken something. .Net 4.52 WebForm site or project simple does not work. You can not using Request.Form in the receiving web page. It will forever be empty. The sending page is certainly doing its job.
VS2015 to create a .Net 4 project / site works as expected.

How to setup ASP Classic and ASP.NET WebForm in the same visual studio solution - for rewriting ASP Classic pages in ASP.NET WebForm

I'll be working on in a project where we'll be re-writing ASP classic pages to ASP.NET WebForm. I've never worked with VB, VBScript, ASP Classic. The good thing is there are plenty of documentation on VB6, VB.NET, ASP Classic, and even on how to migrate ASP to ASP.NET WebForm.
Although in all the tutorial it's said that the best strategy to re-write an existing ASP classic application in ASP.NET WebForm is to integrate them in one solution then move chunk of code at a time, I can't find one tutorial where it's shown how to set up a Visual Studio solution with both ASP and ASP.NET WebForm code.
so how do I setup a Visual Studio solution with both types of application? At least point me to such tutorial.
Thanks for helping
The simple answer to your question is that in Solution Explorer you right click on the project root, select Add -> Existing Item, and then add your .asp files to the project. You may already have some files which have nothing to do with .net in your project, such as stylesheets and image files, treat .asp files in the same way. Beyond that there's no additional setup required
Classic ASP code isn't compiled, it's intepreted at runtime, so you won't be able to debug them the way you would with C#/VB.net files within VS, the standard way to debug Classic ASP is via error messages when you try run the page. When you have a mixture of Classic and .net I find it helps to see them as two separate websites which live in the same root folder.
Also, in case you haven't discovered this already, the dev server which comes with VS doesn't support Classic ASP, so you need to set your project up to use a local version of IIS (or IIS Express) as your dev server

Build/Publish Single Page of Visual Studio 2013 ASP.NET Web Site

I'm working on a ASP.net web project that was migrated from Visual Studio 2010 to Visual Studio 2013.
In VS 2010 when working on a page and it's respective code-behind you could right click the page in the solution explorer and click "Build/Publish" page and it would compile the aspx and cs into their respective aspx and dll files.
In VS 2013 things moved around a bit. You must now Build/Publish the entire web site. There is however an option if you right click the page you want to publish. However, all it does is stick the aspx and the code-behind in your "web_deploy" folder and that doesn't exactly work when you go to push it to your production environment...so my question is:
How can I publish a single page from my web project using visual studio 2013 without having to publish the entire site?
Publishing a single page is not recommended. As far as I remember ... VS never supported this ...
The risk of incompatible assemblies is very high. Updating the HTML only portion of a single page could work ... but again ... not recommended ... and is bad practice
The reason why publishing a single page is not recommended (nor supported) is because the code in each page is compiled into a separate page assembly. References to objects outside of that page are updated during the build process. Taking the built assembly for that page and inserting it into a web application does not guarantee that the linkages are consistent. At best it is considered "undefined behavior". It may work, but doing such in a production environment is poor practice.

CompilationLock error in web forms page directive

My company has a web forms project that we converted to an MVC 3 project over a month ago. Everything works great except for this annoying error that the parser gives on web forms page directives. I'm not sure when this started. I only just started noticing it a week ago, but it could have been there since we transitioned the project.
We followed this tutorial when modifying our web forms project to support MVC 3. The project compiles just fine. Beyond this annoying underline (shown below) there is no problem. Web forms and MVC have played nice together so far. However, intellisense within .ASPX markup does not work while the parser is displaying this error.
Image
The type initializer for 'System.Web.Compilation.CompilationLock' threw an exception.
Does anyone have any experience with this issue? I have scanned the web.config as well as unloaded the project and scanned the .csproj xml. I can't see anything wrong but I also don't really know what I'm looking for. Google doesn't turn up anything useful for this error in my situation.
I'm still not sure what was causing this. But a complete re-install of .NET and Visual Studio fixed the issue.
I ran into a similar issue with my ASP.NET Web Site not building and producing the same useless error.
For me, the solution was fixing the capitalization of the sessionState mode in my Web.config:
<sessionState mode="Off"/>
(It may be 9 years too late, but I wanted this answer to be documented literally anywhere on the internet.)
Take a look at Hanselmans's write up and compare your references and web.config:
Integrating ASP.NET MVC 3 into existing upgraded ASP.NET 4 Web Forms applications

Do controls need to be defined in a web app or will .NET do it for you

I always thought that when you dropped a control onto an .aspx page that a declaration of that control ended up being generated for you (either in a designer file, or within your code behind). All of the apps I have worked on have worked this way.
A coworker of mine was installing resharper and it was showing that all her code behind pages would not build. Turned out that resharper could not find a definition for any control that she has dropped onto her markup. She has no designer files, and no declarations in markup. Do they get automatically built when putting together the partial classes? Is there an option at that page/project level to instruct .NET to do this for you? Is this a difference between web app and web site?
This is a a .NET 3.5 site, C#, and it is running in a production environment.
Thanks in advance
You are correct in the difference is that she's running a Web Site project as opposed to a Web Application project. In a website there are no designer files. So to answer each of your questions...
Do they get automatically built when putting together the partial classes?
Yes, when the .aspx gets compiled the controls are created as if they were there...this happens in the background in VS so you get intellisense.
Is there an option at that page/project level to instruct .NET to do this for you?
Kinda, use a Web Application project for this :)
Is this a difference between web app and web site?
Yes, one of the main differences :) Web Application projects have a Page.aspx.designer.cs that house the control declarations.

Categories

Resources