반응형

stackoverflow.com/questions/43687058/how-do-i-include-nuget-packages-in-my-solution-for-net-core-projects

 

How do I include NuGet packages in my solution for .Net Core projects?

With classic .Net projects, if I added a reference to a NuGet package, it would get downloaded to a packages folder and I could check that into source control along with the rest of my code. This

stackoverflow.com

sln 파일이 있는 곳에 NuGet.Config 파일을 만들어 다음 내용을 입력 후, 저장하고, 솔루션을 다시 오픈 하면 된다.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <config>
    <add key="globalPackagesFolder" value=".\packages" />
  </config>
</configuration>

반응형
반응형

    

    using RestSharp;
    using RestSharp.Authenticators;

    namespace User.Model
    {
        
        public class RestCalling
        {
            public string uri { get; set; }
            public string username { get; set; }
            public string password { get; set; }
            public string endPoint { get; set; } //"users/" + userId + "/identities.json"
            public string methodType { get; set; } //PUT, GET, POST, DELETE.

            //GET & Put & Post & Delete
            public string RestClientComm()
            {
                var _client = new RestClient(uri);
                IRestResponse result = null;
                _client.Authenticator = new HttpBasicAuthenticator(username: username, password: password);
                var request = new RestRequest(resource: endPoint, DataFormat.Json);


                switch (methodType)
                {
                    case "PUT": 
                        request.AddParameter("application/json", "\"identity\": {\"value\": \"" + "email@emailAddress" + "\"}}", ParameterType.RequestBody);
                        result = _client.Put(request);
                        break;

                    case "DELETE": 
                        result = _client.Delete(request);
                        break;

                    case "POST": 
                        request.AddParameter("application/json", "{\"identity\": {\"type\": \"email\", \"value\": \"" + "email@emailAddress"+ "\"}", ParameterType.RequestBody);
                        result = _client.Post(request);
                        break;

                    default: //GET
                        result = _client.Get(request);
                        break;

                }

                return result.Content;

            }
        }
    }

반응형
반응형


[참조]; https://msdn.microsoft.com/en-us/library/ms178473.aspx?f=255&MSPPError=-2147217396


ASP.NET 의 라이프 사이클 관련 MSDN 설명입니다. 위 내용에 들어가 있는 ASP.NET 의 Life Cycle 그림입니다. 





반응형
반응형


Windows10 환경에서 visualStudio 2010 에 SpringFramework 닷넷 버전 1.3.2 의 Schema 설치를 위한 수정된 NAnt 스크립트 공유합니다.

바뀐 부분

SOFTWARE\Microsoft\VisualStudio\10.0_Config\InstallDir"

spring-database-1.3.xsd


<?xml version="1.0" ?>
<project name="Spring.NET-Schema" default="deploy-schema">

<target name="locations"
   descriptions="Shows directories where .xsd files will be copied">

  
  <property name="vsXXXX.version" value="VS.NET 2010"/>
<property name="vsXXXX.xml.schemas.install.dir" value="SOFTWARE\Microsoft\VisualStudio\10.0_Config\InstallDir"/>
<property name="vsXXXX.relative.dir" value="..\..\Xml\Schemas"/>
<!-- retrieve location of VS.NET 2010 schema store -->
<readregistry property="vs2010.xml.schemas" key="${vsXXXX.xml.schemas.install.dir}" hive="CurrentUser"
failonerror="false"/>
<echo message="VS.NET 2010 xsd install directory = ${vs2010.xml.schemas}${vsXXXX.relative.dir}"/> 

<property name="vsXXXX.version" value="VS.NET 2008"/>
<property name="vsXXXX.xml.schemas.install.dir" value="SOFTWARE\Microsoft\VisualStudio\9.0\InstallDir"/>
<property name="vsXXXX.relative.dir" value="..\..\Xml\Schemas"/>
<!-- retrieve location of VS.NET 2008 schema store -->
<readregistry property="vs2008.xml.schemas" key="${vsXXXX.xml.schemas.install.dir}" hive="LocalMachine"
failonerror="false"/>
<echo message="VS.NET 2008 xsd install directory = ${vs2008.xml.schemas}${vsXXXX.relative.dir}"/>

<property name="vsXXXX.version" value="VS.NET 2005"/>
<property name="vsXXXX.xml.schemas.install.dir" value="SOFTWARE\Microsoft\VisualStudio\8.0\InstallDir"/>
<property name="vsXXXX.relative.dir" value="..\..\Xml\Schemas"/>
<!-- retrieve location of VS.NET 2005 schema store -->
<readregistry property="vs2005.xml.schemas" key="${vsXXXX.xml.schemas.install.dir}" hive="LocalMachine"
failonerror="false"/>
<echo message="VS.NET 2005 xsd install directory = ${vs2005.xml.schemas}${vsXXXX.relative.dir}"/>

<property name="vsXXXX.version" value="VS.NET 2003"/>
<property name="vsXXXX.xml.schemas.install.dir" value="SOFTWARE\Microsoft\VisualStudio\7.1\InstallDir"/>
<property name="vsXXXX.relative.dir" value="..\Packages\schemas\xml"/>
<!-- retrieve location of VS.NET 2003 schema store -->
<readregistry property="vs2003.xml.schemas" key="${vsXXXX.xml.schemas.install.dir}" hive="LocalMachine"
failonerror="false"/>
<echo message="VS.NET 2003 xsd install directory = ${vs2003.xml.schemas}${vsXXXX.relative.dir}"/>
</target>


<target name="deploy-schema"
description="Deploys the Schema to VS.Net schemas dirs. Copies VS 7.0, 7.1, 8.0, 9.0">

<!-- deploy spring schema to the VS.NET 2010 schema store -->
<property name="vsXXXX.version" value="VS.NET 2010"/>
<property name="vsXXXX.xml.schemas.install.dir" value="SOFTWARE\Microsoft\VisualStudio\10.0_Config\InstallDir"/>
<property name="vsXXXX.relative.dir" value="..\..\Xml\Schemas"/>
<!-- retrieve location of VS.NET 2010 schema store -->
<readregistry property="vs2010.xml.schemas" key="${vsXXXX.xml.schemas.install.dir}" hive="CurrentUser"
failonerror="false"/>
<property name="vsXXXX.xml.schemas.notinstalled" value="true"/>
<if test="${property::exists('vs2010.xml.schemas')}">
<property name="vsXXXX.xml.schemas" value="${vs2010.xml.schemas}"/>
<call target="_deploy-schema"/>
</if>
<if test="${vsXXXX.xml.schemas.notinstalled}">
<echo message=""/>
<echo message="Failed installing schema files for VS.NET 2010."/>
<echo message=""/>
</if>    
    
<!-- deploy spring schema to the VS.NET 2008 schema store -->
<property name="vsXXXX.version" value="VS.NET 2008"/>
<property name="vsXXXX.xml.schemas.install.dir" value="SOFTWARE\Microsoft\VisualStudio\9.0\InstallDir"/>
<property name="vsXXXX.relative.dir" value="..\..\Xml\Schemas"/>
<!-- retrieve location of VS.NET 2005 schema store -->
<readregistry property="vs2008.xml.schemas" key="${vsXXXX.xml.schemas.install.dir}" hive="LocalMachine"
failonerror="false"/>
<property name="vsXXXX.xml.schemas.notinstalled" value="true"/>
<if test="${property::exists('vs2008.xml.schemas')}">
<property name="vsXXXX.xml.schemas" value="${vs2008.xml.schemas}"/>
<call target="_deploy-schema"/>
</if>
<if test="${vsXXXX.xml.schemas.notinstalled}">
<echo message=""/>
<echo message="Failed installing schema files for VS.NET 2008."/>
<echo message=""/>
</if>

<!-- deploy spring schema to the VS.NET 2005 schema store -->
<property name="vsXXXX.version" value="VS.NET 2005"/>
<property name="vsXXXX.xml.schemas.install.dir" value="SOFTWARE\Microsoft\VisualStudio\8.0\InstallDir"/>
<property name="vsXXXX.relative.dir" value="..\..\Xml\Schemas"/>
<!-- retrieve location of VS.NET 2005 schema store -->
<readregistry property="vs2005.xml.schemas" key="${vsXXXX.xml.schemas.install.dir}" hive="LocalMachine"
failonerror="false"/>
<property name="vsXXXX.xml.schemas.notinstalled" value="true"/>
<if test="${property::exists('vs2005.xml.schemas')}">
<property name="vsXXXX.xml.schemas" value="${vs2005.xml.schemas}"/>
<call target="_deploy-schema"/>
</if>
<if test="${vsXXXX.xml.schemas.notinstalled}">
<echo message=""/>
<echo message="Failed installing schema files for VS.NET 2005."/>
<echo message=""/>
</if>


<!-- deploy spring schema to the VS.NET 2003 schema store -->
<property name="vsXXXX.version" value="VS.NET 2003"/>
<property name="vsXXXX.xml.schemas.install.dir" value="SOFTWARE\Microsoft\VisualStudio\7.1\InstallDir"/>
<property name="vsXXXX.relative.dir" value="..\Packages\schemas\xml"/>
<!-- retrieve location of VS.NET 2003 schema store -->
<readregistry property="vs2003.xml.schemas" key="${vsXXXX.xml.schemas.install.dir}" hive="LocalMachine"
failonerror="false"/>
<property name="vsXXXX.xml.schemas.notinstalled" value="true"/>
<if test="${property::exists('vs2003.xml.schemas')}">
<property name="vsXXXX.xml.schemas" value="${vs2003.xml.schemas}"/>
<call target="_deploy-schema"/>
</if>
<if test="${vsXXXX.xml.schemas.notinstalled}">
<echo message=""/>
<echo message="Failed installing schema files for VS.NET 2003."/>
<echo message=""/>
</if>


<!-- deploy spring schema to the VS.NET 2002 schema store -->
<property name="vsXXXX.version" value="VS.NET 2002"/>
<property name="vsXXXX.xml.schemas.install.dir" value="SOFTWARE\Microsoft\VisualStudio\7.0\InstallDir"/>
<property name="vsXXXX.relative.dir" value="..\Packages\schemas\xml"/>
<!-- retrieve location of VS.NET 2003 schema store -->
<readregistry property="vs2002.xml.schemas" key="${vsXXXX.xml.schemas.install.dir}" hive="LocalMachine"
failonerror="false"/>
<property name="vsXXXX.xml.schemas.notinstalled" value="true"/>
<if test="${property::exists('vs2002.xml.schemas')}">
<property name="vsXXXX.xml.schemas" value="${vs2002.xml.schemas}"/>
<call target="_deploy-schema"/>
</if>
<if test="${vsXXXX.xml.schemas.notinstalled}">
<echo message=""/>
<echo message="Failed installing schema files for VS.NET 2003."/>
<echo message=""/>
</if>
</target>

<!-- 'private' scoped parameterised version of the 'deploy-schema' target -->


<target name="_deploy-schema" depends="_clean">

<!-- deploy schema to VS.NET XXXX schema store -->
<echo message="-------------------------------------------------------"/>
<echo message="Copying spring-objects-1.3.xsd to ${vsXXXX.version} installation."/>
<echo message="-------------------------------------------------------"/>
<echo message=""/>
<copy file="spring-objects-1.3.xsd" todir="${vsXXXX.xml.schemas}${vsXXXX.relative.dir}"
verbose="true"
overwrite="true"/>

<echo message="-------------------------------------------------------"/>
<echo message="Copying spring-tool-1.1.xsd to ${vsXXXX.version} installation."/>
<echo message="-------------------------------------------------------"/>
<echo message=""/>
<copy file="spring-tool-1.1.xsd" todir="${vsXXXX.xml.schemas}${vsXXXX.relative.dir}"
verbose="true"
   overwrite="true"/>

<echo message="----------------------------------------------------------"/>
<echo message="Copying spring-validation-1.3.xsd to ${vsXXXX.version} installation."/>
<echo message="----------------------------------------------------------"/>
<echo message=""/>
<copy file="spring-validation-1.3.xsd" todir="${vsXXXX.xml.schemas}${vsXXXX.relative.dir}"
verbose="true"
overwrite="true"/>

<echo message="----------------------------------------------------------"/>
<echo message="Copying spring-aop-1.1.xsd to ${vsXXXX.version} installation."/>
<echo message="----------------------------------------------------------"/>
<echo message=""/>
<copy file="spring-aop-1.1.xsd" todir="${vsXXXX.xml.schemas}${vsXXXX.relative.dir}"
verbose="true"
overwrite="true"/>

<echo message="----------------------------------------------------------"/>
<echo message="Copying spring-remoting-1.1.xsd to ${vsXXXX.version} installation."/>
<echo message="----------------------------------------------------------"/>
<echo message=""/>
<copy file="spring-remoting-1.1.xsd" todir="${vsXXXX.xml.schemas}${vsXXXX.relative.dir}"
verbose="true"
overwrite="true"/>

<echo message="----------------------------------------------------------"/>
<echo message="Copying spring-database.xsd to ${vsXXXX.version} installation."/>
<echo message="----------------------------------------------------------"/>
<echo message=""/>
<copy file="spring-database-1.3.xsd" todir="${vsXXXX.xml.schemas}${vsXXXX.relative.dir}"
verbose="true"
overwrite="true"/>

<echo message="----------------------------------------------------------"/>
<echo message="Copying spring-tx-1.1.xsd to ${vsXXXX.version} installation."/>
<echo message="----------------------------------------------------------"/>
<echo message=""/>
<copy file="spring-tx-1.1.xsd" todir="${vsXXXX.xml.schemas}${vsXXXX.relative.dir}"
verbose="true"
overwrite="true"/>

<echo message="----------------------------------------------------------"/>
<echo message="Copying spring-nms-1.3.xsd to ${vsXXXX.version} installation."/>
<echo message="----------------------------------------------------------"/>
<echo message=""/>
<copy file="spring-nms-1.3.xsd" todir="${vsXXXX.xml.schemas}${vsXXXX.relative.dir}"
verbose="true"
overwrite="true"/>

<echo message="----------------------------------------------------------"/>
<echo message="Copying spring-ems-1.3.xsd to ${vsXXXX.version} installation."/>
<echo message="----------------------------------------------------------"/>
<echo message=""/>
<copy file="spring-ems-1.3.xsd" todir="${vsXXXX.xml.schemas}${vsXXXX.relative.dir}"
verbose="true"
overwrite="true"/>

<echo message="----------------------------------------------------------"/>
<echo message="Copying spring-nvelocity-1.3.xsd to ${vsXXXX.version} installation."/>
<echo message="----------------------------------------------------------"/>
<echo message=""/>
<copy file="spring-nvelocity-1.3.xsd" todir="${vsXXXX.xml.schemas}${vsXXXX.relative.dir}"
verbose="true"
overwrite="true"/>

<property name="vsXXXX.xml.schemas.notinstalled" value="false"/>
</target>

  <target name="_clean">
<echo message="-------------------------------------------------"/>
<echo message="Removing previously installed spring schema files"/>
<echo message="from ${vsXXXX.version} installation."/>
<echo message="-------------------------------------------------"/>
<echo message=""/>
    <delete failonerror="false">
      <fileset basedir="${vsXXXX.xml.schemas}${vsXXXX.relative.dir}">
        <include name="spring-*.xsd"/>
      </fileset>
    </delete>
  </target>
</project>


반응형

+ Recent posts