Use Costura.Fody to write their own plug-ins are packaged as a standalone EXE file can run

   We will quote a lot of DLL files in the development of procedures, after the completion of the preparation of the program, if you do not put these references packaged DLL, can not run in other computers, so many students might think, Can we write a good program package into an EXE file, double-click will be able to run the best, of course you can, and then we get to the bar.

    We can use Costura.Fody plug-in is complete, and without writing a single line of code, and super-simple, we work together through a few simple steps to complete the package all the dependencies.

Step 1: Install Costura.Fody

               First, use Visual Studio 2017 to open your solution, in order to find the "Tools" --- "NuGet package management" - "NuGet package management solution" to this step will open NuGet- Solutions page, in the following browsing options the search box enter "Costura.Fody", will automatically search out Costura.Fody plug-in, click of the left mouse button Costura.Fody plug-in location will appear on the right of your project name, select the name of your project, select install , this step Costura.Fody on the success of your project to follow up

 

Step Two: Compile about your solutions

             Direct start clicking your project according to your usual habits, this time, Costura.Fody will complete package, packaged EXE file in your root directory Debug Solution, you can now copy the exe file in to any computer up to try and perfect run

 

 

************************************************** ********************************************

************************************************** ********************************************

Is not super easy, simple step to complete the program files packaged into green, go and try it!

************************************************** ********************************************

************************************************** ********************************************

Pay attention to you, pay attention to you, pay attention to you !!!!!!!!!!!!!!!!!!!!!!

Many students say that again after installing Costura.Fody build the solution, always reported the following error

The reason given: usually when you install F ody, FodyWeavers.xml deployed by NuGet content features. However, in NuGet 3.1, the content features for project use project.json method is deprecated. Is the high version NuGet, does not automatically give you a file created FodyWeavers.xml

The solution: add our own chant files manually FodyWeavers.xml

                       Add this: Move the mouse to your solution above, right-click, select "Add" - "New Project" - "XML file", pay attention to when creating a new XML file name the file "FodyWeavers xml.", Then copy the following code inside the file to FodyWeavers.xml

                     

<?xml version="1.0" encoding="utf-8" ?>
<Weavers>
</Weavers>

 

---------------------
Author: wangjiaoshoudebaba
Source: CSDN
Original: https: //blog.csdn.net/wangjiaoshoudebaba/article/details/80787677

Guess you like

Origin www.cnblogs.com/WeiYongZhi/p/11272938.html