For normal (say Windows Forms) C# applications, to execute commands after a successful build I would use the Build Events->Post-build event command line in Project Properties.
I have a Web Site project which I "Publish", using the "Publish..." command in the context menu in the solution explorer.
Is there a way to run commands after the successful publish and if so how is it done? (eg a Post-Publish event command line field)
Visual Studio 2008, ASP .Net Web site project, C#.
Update: Since Publish Web does not apply to folder-based web site projects, this answer assumes you are asking about a Web Application project.
You can't do this from inside the VS IDE. However, you can edit your project file in Notepad or your favorite XML editor and add a new target at the end of the file called AfterPublish.
You might want to read a bit more on MSBuild if you are not sure what you can do in this target.
You can find more details on extending the build process in VS at MSDN - HowTo: Extend the Visual Studio Build Process.
Related
I have a very simple Windows Forms application (not the one with the .NET Framework) and I want to make an installer for it. The problem is that whenever I'm trying to run the installed application, it displays an error saying that it requires .NET Core to run, even if it's already installed. I tried including everything from the project output folder, including .exe and .dll files, but that doesn't seem to work. Here's how installer project files look like.
Please check out my nanny-level teaching!
Environment:
1.Add Enxtention:
2.Install Microsoft Visual Studio Installer Project:
3.Closs the ide to start installing:
4.Create a setup project:
5.Modify the information as needed:
6.Right click Setup (Application Folder) > add > file > (all the file):
7.Then create a shortcut, cut it to User Desktop and, after creating a shortcut, put it in User Program:
8.Build:
8.Install and run:
I come from JS world and have to run an old ASP project to see its structure.
But I can't understand what kind of framework have been used to create this.
Have tried to build it with dotnet but it's not recognized.
Here is the projects screenshot can some body recognize it and tell me how to run it locally ?
I would try opening this would Visual Studio. That does look like a typcial asp.net web forms proejct.
If you ahve a ".sln" file in the root folder, then you should be able to open this project with Visual Stuido. (just download 2019, or latest 2022).
You will almost for certain want to open this project with VS.
If there is no .sln file in the root folder, then choose from VS to open as web site.
So, there are two ways to open/use/develop these older asp.net applications. the existence of a .sln file tends to tip you off as to which method you need (and want) to open up this applcation with. But, yes, you need VS .net "IDE" and the built in designers to work on this.
So, from your screen shot, go up one folder - look for a .sln file. That's the project file you want to try and open with Visual Studio.
As noted, if no .sln, or no .prj file exists, then use the open as web site option in VS.
Looks like a WebForms project, not sure about the state of WebForms support for VSCode but Visual Studio Community should be able to run this. Try loading this project with Visual Studio ensuring you have ASP Web development work load installed.
I need create react app that create in visual studio and working with simple "F5" key. I don't need create react project C# in visual studio because this project type (Microsoft react project) have not my standards.
my reason for don't use Microsoft react project sample is :
the negative point of Microsoft react project for me is that project type have server side programming in client side and from the other hand Microsoft force me to use type script and give me much useless dependencies i never use in my project.
i working on a fat client (rich client) application and just call some API from client.
i need create a good infrastructure .
I have found a way that may helps:
create an empty folder outside of VS.
create the stuff needed for a single react.js pack (index.html, etc.)
add it as an existing website
So no .net unnecessary extras will be there.
Best option will be create a react project outside Visual Studio. For that open up powershell or terminal and follow these steps-
Make sure npm & node.js is installed.
Create a React.js project- npx create-react-app my-app
You can either import this project into Visual Studio or install Visual Studio Code and open project there.
Visual studio code won't give you an option for running app using F5 key but you can open terminal (shortcut- ctrl + `) and type npm start
I'm having some trouble with namespacing for a web application project - front-end files are being compiled into separate assemblies under the ASPX.directory1_director2_directoryn_filename namespace format and I want everything in one dll.
I found this question and setting the -o flag would appear to be exactly the solution I'm looking for. However I build my code in VS2010 using the standard Build menu option and I can't find anywhere I can set it. Can anyone point me in the right direction?
I suppose you meant aspnet_compiler. Here is a tutorial. It's related to Visual Web Developer 2008. But the basic idea is the same - use the External Tools dialog to create you desired action.
If you're using a Web Site Project, the ASP.NET compiler options can be used from the Publish dialog. For a Web Application Project, you can use Web Deployment Projects to enable pre-compilation (technically, WDP should work for WebSites as well).
I am working on .NET Solution that has multiple projects inside. One of the projects is ASP.NET Web Application that I am currently working on. Very seldom I have to build the whole project. Mostly I just want to build my web application and test it in the browser.
What would be the fastest way to do this?
I am sort of tired of navigating my Solution Explorer, finding my web project, right click then build.
I would like to be able to issue command (in command window or command prompt) and to assigne shortcut to this command. Can this be done?
Thanks.
Right click on the solution and configure Batch Build... or as #Nico suggests, use msbuild directly.
See Batch Build Dialog Box
You can use the command msbuild /m <your project> which build your thread with more worker threads to finish your build. It will also run it with multiple process, which should improve execution speed as well.
See Also: MSBuild Command Line Reference (MSDN)