안녕하세요 . 오늘 포스팅은 Visual Studio 2010에서 지구 아이콘 혹은 메뉴에 Project에 Asp.net configuration Tool을 이용하였던 것인데 Visual Studio 2013 에서는 위에 말씀드린 것들이 없어 졌습니다. 그래서 IIS Express를 이용하여 해당 프로젝트가 있는 WEB 프로젝트의 절대 경로 를 설정해주어야 접속이 가능합니다.

1. 우선 명령 프롬프트를 실행합니다.

2. IIS Express가 있는 폴더 지정 위치로 이동합니다.

C:\Program Files (x86)\IIS Express

3. 명령 프롬프트에 IIS Express를 실행하면서 Port 설정을 하는데 이 {PORT}는 여러분이 안쓰시는 (Free) 한 Port를 써주시면 됩니다.

iisexpress.exe /path:C:\Windows\Microsoft.NET\Framework\v4.0.30319\ASP.NETWebAdminFiles /vpath:"/ASP.NETWebAdminFiles" /port:{PORT} /clr:4.0 /ntlm /trace:error


4. 위에서 지정한 포트로 IIS Express가 실행되면서 호스팅 되는 것을 볼 수 있습니다. 그리고 나서 아래의 주소를 쳐주면 됩니다.

 http://localhost:{PORT}/asp.netwebadminfiles/default.aspx?applicationPhysicalPath={Absolutely Route}&applicationUrl=/


{PORT}는 위에서 지정한 포트로 IIS Express가 실행

{Absolutely Route} 절대 경로는 예를 들어 해당 프로젝트의 웹쪽 경로를 주면 됩니다. 특정 파일이 아닌 경로입니다.

"C:\Users\HP\Source\Company\Sample\Sample.Web"


5. 아래와 같은 Asp.net configuration Tool가 나타날 것이다.


6.이제 WebConfig 파일에 연결한 DB가 정상적으로 연결되었는지 확인을 해주면 된다.

여기까지!^^

'.NET 개발 > ASP.NET Web API' 카테고리의 다른 글

@ViewBag is Not Working  (0) 2015.12.07
ASP.NET API 부수적으로 알아야할 기능들.  (0) 2015.12.06
aspnetdb 생성  (0) 2015.07.14
IPrincipal 와 Identity  (0) 2015.07.14
인증 및 권한 부여  (0) 2015.07.14
Posted by Hoya0415
,

Aspnet_regsql.exe 라는 프로그램을 실행하면 아래의 설치 마법사가 나온다.

1. 다음을 눌러준다.

2. Configure SQL Server for application services 를 클릭해준다.


3. DB Server에 연결해준다.


위와같이 해주면 해당 데이터베이스 서버에 ASPNETDB가 생성된다.


아래는 sql 구문이다.

sql 구문을 실행해주면 자동으로 데이터베이스가 생성된다.

aspnetdbModel.edmx.sql


Posted by Hoya0415
,

역활 기반 보안은 .Net Framework 1.0 부터 사용해왔다. Identity 와 Iprincipal 은 역할 기반 보안을 구현하기 위해 .Net Framwork 에서 제공하는 두 가지 추상적인 개념이다.

(그림: IPrincipal 그리고 IIdentity 구현된 클래스)

사용자 정의 시나리오를 위한 GenericIdentity와 GenericPrincipal 클래스.

윈도우 인증 기반의 시나리오를 위한 WindowIdentity와 WindowPrincipal 클래스 

IPrincipal 인터페이스 


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
    // Summary:
    //     Defines the basic functionality of a principal object.
    [ComVisible(true)]
    public interface IPrincipal
    {
        // Summary:
        //     Gets the identity of the current principal.
        //
        // Returns:
        //     The System.Security.Principal.IIdentity object associated with the current
        //     principal.
        IIdentity Identity { get; }
 
        // Summary:
        //     Determines whether the current principal belongs to the specified role.
        //
        // Parameters:
        //   role:
        //     The name of the role for which to check membership.
        //
        // Returns:
        //     true if the current principal is a member of the specified role; otherwise,
        //     false.
        bool IsInRole(string role);
    }
cs

Identity 인터페이스 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 // Summary:
    //     Defines the basic functionality of an identity object.
    [ComVisible(true)]
    public interface IIdentity
    {
        // Summary:
        //     Gets the type of authentication used.
        //
        // Returns:
        //     The type of authentication used to identify the user.
        string AuthenticationType { get; }
        //
        // Summary:
        //     Gets a value that indicates whether the user has been authenticated.
        //
        // Returns:
        //     true if the user was authenticated; otherwise, false.
        bool IsAuthenticated { get; }
        //
        // Summary:
        //     Gets the name of the current user.
        //
        // Returns:
        //     The name of the user on whose behalf the code is running.
        string Name { get; }
    }
cs



Posted by Hoya0415
,