Getting MVC4 error in Studio 2010 Pro - asp.net-mvc-4

File C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft Corporation\NuGet Package Manager\1.5.20902.9026\Modules\NuGet\profile.ps1 cannot be loaded because the execution of scripts is disabled on this system.
I would like to piggyback another :
Why does a new MVC4 project not come with a unit test project? It is not letting me check the box for that.
And one more thing : why is it not including the MicrosoftMVCAjax scripts in the scripts folder?
I am finding I can write a working JSONapp with partial views and callbacks if I have this one from an older MVC2 or 3 project.
Thanks!

You should be able to create check the unit test project check box for the Internet and Intranet project templates.
We are de-emphasizing the use of Microsoft AJAX scripts in MVC templates and instead focusing on the jQuery family of scripts. However, you can still use the scripts if you copy them from an existing MVC 2 or 3 project.

Related

What must be done to make net5.0 usable in Visual Studio Community Mac 2019 for VB.NET console projects?

I want to write a cross-platform console application in VB.NET using Visual Studio Community Mac 2019 [VSCM2019]. It has to be able to be run on all platforms that dotnet 5.x currently supports.
When I create a new VB.NET console application in VSCM2019 it defaults to NET Frameworks 4.8 or lower. When I try to change that to net5.x in the project properties, net5.x is not offered in the dropdown list despite the fact that I have installed the latest dotnet 5 sdk.
Is it the case that I must select net5.x when creating the project? If so, where is this done for VB.NET console applications?
Whether or not VB.NET is supported or not, I managed to hack it into submission. I created a net5 C# project, renamed the .csproj file to .vbproj and replaced the .cs file with a .vb file. Instead of opening VS via the .sln file, I opened it via the .vbproj file. It compiled and ran and the project properties reflected the change to VB.NET. I then replaced the .sln by saving the project.

VS 2019 Custom ASP.NET Core project templates

I'm trying to figure out how (or even if) I can create a custom Visual Studio project template that hooks into the existing ASP.NET Core Web Application template available in Visual Studio 2019?
What I want to do is something similar to madskristensens ASP.NET Core Template Pack (GitHub source code). However instead of VS 2017 I want to do this for VS 2019's revamped "New Project Dialog" window. So imagine adding an additional ASP.NET Core web application template in the place highlighted below.
I am able to create new project templates (both for Visual Studio and for dotnet new) but nothing has worked thus far. Has anyone been able to extend VS 2019 in this way, or was this taken away after VS 2017?
After doing some more investigation between both VS 2017 and 2019 (Community) I was able to successfully figure this out! Man oh man do we need some docs on this because this felt like a doozy!
I was able to use the ASP.NET Core Template pack as a building block for putting something together. For those who don't know, the extensions are designed to add templates to Visual Studio using .nupkg file(s) embedded in the extension. The use of the .nupkg files is similar to how dotnet new works with custom templates. I've got a working prototype on GitHub that supports both Visual Studio 2017 and 2019.
Now if you're like me, you may look at either madskristensens or my project and ask "How in the heck does this work!?" Great question! Here are the details I have the time to fill out right now:
Build out a custom template (or templates) and place them into *.nupkg file(s)
In my sample, my SampleTemplates project contains three different project templates. I generate the .nupkg with dotnet pack
A vs-2017.3.host.json file is required in the .template.config/ folder so that the ASP.NET Web Application wizard can display the template.
At least 1 or more other requirements need to be fulfilled to be displayed in the ASP.NET Web Application wizard, but I haven't yet figured those out, as adding the file to a console app template doesn't cause it to appear. I want to try and figure this out, although I'd love help if anyone already knows!
The template.json needs a Framework symbol to define the list of .NET Core framework targets that are supported by the template.
In doing some testing, it didn't look like the Framework symbol didn't substitute into the .csproj, so that is why my example also includes a TargetFrameworkOverride symbol that the Framework symbol replaces.
Place the .nupkg file(s) into the root of a VSIX extension project and make sure to set the "Include in VSIX" flag to True. I emphasize root because originally I had the NuGet package landing in a build\ folder in my extension and my templates weren't being picked up.
I'll try to put together a README in my example project to provide a better outline of all of the details required to accomplish this. Fingers crossed this helps someone out (or at least help me out in the future when I inevitably forget how I accomplished this)!
Update
As of September 2nd, 2020, the Visual Studio team released an experimental feature to include dotnet new templates within Visual Studio. I have done some exceptionally minimal testing with it, and it does appear to work, but it's not perfect. For example, I created a dotnet new template that scaffolds multiple .csproj files and .sln file, and the output didn't quite match my solution.
This is the Visual Studio blog post describing the announcement: https://devblogs.microsoft.com/dotnet/net-cli-templates-in-visual-studio/

Using DLL for web project

I am a little new to VB.NET but I have downloaded and installed VS Express 2012 for web. I created a web application that is fairly simple. One page. mypage.aspx It runs perfect in studio and responses how I would expect.
What I want to do is make it run from the dll. Not from the mypage.aspx.vb. I see the dll for the project in the bin folder.
But when I move mypage.aspx and web.config, and bin with dll to the server it simply says its missing the code behind page. Do I just need to change the reference to the VB file?
If you want to use dll, Go to Build menu in your Visual Studio and click on Publish Web Site
Set Target Location, there your whole project will be get created with dll and without code behind files.
Use this project to deploy on your server.

Visual Studio won't show my installed project templates

I'm trying to install some custom made project templates for asp.net MVC4, however my Visual Studio 2012 Premium won't show the new templates. The templates are installed by a .VISX file like this one: http://www.asp.net/single-page-application/overview/templates/hottowel-template
Visual Studio is showing this file as an "Enabled" and "Installed" Extension, but when I try to create a new ASP.NET MVC4 project it is not showing those templates as an option like shown in this image:
I'm just seeing the regular options and it is not showing me the Hot-Towel template or any other single page application template. Could you please tell me how to fix this if one of you guys knows.
I fixed this by installing ASP.Net Web Tools Update Pack Fall 2012:
http://www.asp.net/vnext
I decided to give the answer to my own question for helping others with the same question.

Making a Stand-Alone EXE File

I'm currently using Visual Studio 2010 to make a Visual Basic project. I'm trying to make a standard .EXE file for distribution but everytime I go to publish, I keep seeing it make a Click Once application.
Is there a way to complete and build a project in VStudio 2010 without making it as a Click-Once application?
Don't Publish it; that is what is making it a clickonce application. Just Build Solution; this will create the exe in the specified output directory (usually debug or release depending on your current Configuration.