Web User Control Library in VS2010 & .net 4? - visual-studio-2010

Is it possible to somehow load Web User Controls from another project / class library using Visual Atudio 2010 and ASP.NET 4.0?
I only found THIS (all the other are for VS2008 & ASP.NET 2.0 or older), but that doesn't work for me:
I can reference the control and compile when its copied to the class library project, but nothing is rendered to the page.
Is there (an easy way) to achive that so that it can be used in daly business?
The main goal is to have reusable controls which we can use in several web applications we are developing in paralell.

Related

How to associate item templates with Project Type in Visual Studio 2019?

I would like to create a new F# Web ASPNET (not Core) Application using the MSBuild based legacy project format, not the SDK project. In Visual Studio 2019, the only available option for this project type is C#. I've attempted to reverse engineer the project setup by creating a new F# class library and modify the ProjectTypeGuids.
The C# Web Application uses the following project type GUIDs
349c5851-65df-11da-9384-00065b846f21 - ASP.NET MVC 5
fae04ec0-301f-11d3-bf4b-00c04f79efbc - C#
On a basic F# .NET Framework class library, I attempted to add the ASP.NET and F# project type guids to the project.
<ProjectTypeGuids>{349C5851-65DF-11DA-9384-00065B846F21};{F2A71F9B-5D33-465A-A702-920D77279786}</ProjectTypeGuids>
This succeeded in adding the web configuration to the project properties, but now I am unable to add any items to the project at all. It looks like in the past you needed to associate the right language templates with the project guid in the registry editor (see this link)
These entries don't appear to be anywhere that I can see in the registry, for any installed version of VS (which at this point is just 2017 and 2019). How can I enable F# item templates for my F# web application?
While not exactly an answer to the question, I think the pain of trying to do this is likely proof that you SHOULDN'T do this. In the end my approach will be to simply implement the Web Application in C#, while keeping as much code as possible in F# targeting netstandard.

Can i create a cross platform Xamarin Forms application in F#?

As the title says, is this currently an option? As can be seen in the screenshot, I don't see an option for creating a crossplatform project in Visual Studio. Is there a way around this i.e. is the cross-platform option just there for conveniently setting up the project structure? If so, how should I do this?
The references others have posted are good, except that not all those projects are .Net Standard 2.0, so if you use them, you will need to upgrade later. But even without a current template, creating a Xamarin Forms F# solution is not hard:
Create a new .Net Standard C# Xamarin.Forms project. Delete the .Net Standard C# library, leaving the platform-specific parts.
Add a .Net Standard 2.0 F# library, install the Xamarin.Forms package, and connect the platform projects to it.
Define an App class in this library:
type SomeNamespace.App() =
inherit Xamarin.Forms.Application()
do base.MainPage &lt- ...
Refer to this in the (C#) platform projects: LoadApplication(new SomeNamespace.App());

Which Class Lib for ASP.NET Core tag helpers when .Net Core Web App targets Full .Net Framework?

I have created a Asp.Net Core Web Application that targets the full .Net Framework. This was accomplished by using the Visual Studio ASP.NET Core Web Application (.NET Framework) template.
I'd like to create some tag helpers that I use in this Web Application and I'd like to place them in a library dll. Initially I tried adding a new project to my solution of type Class Library (.NET Core) to place them in but I was unable to reference that library from the web project. When I tried to reference it via Visual Studio I received a dialog that said the project reference was not supported because the Class Library has a target framework that is incompatible with the targets in my Website Project.
So as an alternative, I added a regular Class Library project to the solution via the Visual Studio Class Library template. I am able to add a reference from my Web Project to this class library successfully. However, in this Class Library project I can't find a way to reference Microsoft.AspNetCore.Razor.Runtime which is necessary if I'm going to be able to put my tag helpers in the library.
So I'm at a dead end with both approaches. How can I put my ASP.NET Core tag helpers in a class library that I can reference from my ASP.NET Web Project that targets the full .net framework?
When I tried to reference it via Visual Studio I received a dialog that said the project reference was not supported because the Class Library has a target framework that is incompatible with the targets in my Website Project.
This usually means you both libraries target different things, i.e. if your Class library targets netstandard1.6 and your web application targets net452 its not going to work.
Either your web application needs to target netcoreapp1.0 or your class library has to target netstandard1.0. Use the .NET Standard Library matrix here to see which netstandard1.x moniker supports which platform.
So if your web application targets net452, you have to target netstandard1.0, netstandard1.1 or netstandard1.2. netstandard1.3 and higher don't work, because it requires .NET Framework 4.6.
If you use a library which requires netstandard1.3 or higher, you have to target multiple platforms. i.e. net452 and netstandard1.3.
Then net452 will be used in projects which target net452 and netstandard1.3 will be used in netcoreapp1.0 applications or other class libraries which target netstandard.

How do I install MVC3 on a server without using the Web Platform Installer (and without Visual Studio)?

How do I install MVC3 on a server without using the Web Platform Installer (and without Visual Studio)?
I can't seem to locate a standalone installer, and the server won't have VS, and I can't ensure that all the apps will have the binaries included to run it on native .NET4.
Is the only way to install MVC3 support with VS support, even if VS isn't around?
In case it isn't obvious, I'm trying to give the IT group a baseline of packages to install, and the easiest way to do that is to give them the binaries and a few scripts
Referencing the link on http://www.asp.net/mvc/mvc3 we get a link to http://www.microsoft.com/en-us/download/details.aspx?id=1491 | ASP.NET MVC 3 Tools Update
I think that's what you're looking for.
ASP.NET MVC 3 is a framework for developing highly testable and maintainable Web applications by leveraging the Model-View-Controller (MVC) pattern. The framework encourages developers to maintain a clear separation of concerns among the responsibilities of the application – the UI logic using the view, user-input handling using the controller, and the domain logic using the model. ASP.NET MVC applications are easily testable using techniques such as test-driven development (TDD).
The installation package includes templates and tools for Visual Studio 2010 to increase productivity when writing ASP.NET MVC applications. For example, the Add View dialog box takes advantage of customizable code generation (T4) templates to generate a view based on a model object. The default project template allows the developer to automatically hook up a unit-test project that is associated with the ASP.NET MVC application.
You can download it from : https://www.microsoft.com/es-es/download/details.aspx?id=4211
Is the 3.0.0.0 version and you can reference manually the DLL from : C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 3\Assemblies\System.Web.Mvc.dll
Other versions : https://stackoverflow.com/a/5485175/5775048
Install the MVC3 runtime from this link: http://www.microsoft.com/en-us/download/details.aspx?id=4211.
Go to c:\windows\microsoft.net\framework[64]\v4.0.30319 and run aspnet_regiis -i (adjusting for whatever version of .Net is appropriate).
Restart IIS.
This has always worked for me, although at the moment I'm having an issue because the installer installs 3.0.0.0 and my app is looking for 3.0.0.1.

Is it possible to use LinqPad with an ASP.NET Website (Rather than a Web Application)?

I'm very interested in testing out LinqPad with our Entity Framework 4.0 based websites, but when I load up LinqPad it wants me to attach it to an assembly (dll or exe). The ASP.NET applications we are building are using the 'Website' template (App_Code folder, etc.) that is not deployed as a compiled DLL. I realize that if the project type were 'ASP.NET Web Application' I would have access to the DLL, but unfortunately this is out of my control.
Is it in any way possible for me to use LinqPad in my situation?
I suggest moving Entity classes to a separate assembly. This will not just solve your problem, but also is the right thing to do from design standpoint.
Also, you could convert your web site to web application.
[Update]
If you cannot split entities to a separate assembly, and if converting to web application is not feasible, you could try extracting compiled dll from web site.
When your site is built the dll will be located at path like this (depends on your platform):
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\website1

Resources