코드 속에 주석을 한글로 기입했는데 갑자기 아래와 같은 오류가 뜬다면 해결 방법을 찾아보던 중에 설정을 이리저리 바꿔보다가 찾았다. 

some bytes have been replaced with Unicode substitution character while loading file

아래 메뉴에서 Auto-detect UTF-8 encoding without signature를 체크하면 오류가 사라진다

Tool(도구) - Option(옵션) - Text Editor(텍스트 편집기)

 

블로그 이미지

레몬도리 LemonDory

개발자의 이야기

뜻 밖에 비주얼스튜디오에서 입력되는 문자를 보게되었다.

무슨 키를 눌렀는지 갑자기 글씨체가 바뀌어서 당황했다.

아래와 같은 이상한 공백으로 영문이 입력되어서 당황하다가 뭘 눌렀나 생각해보다가 Alt와 =를 같이 눌러보니 다시 원상태로 돌아왔다.


단축키가 있었던 모양이다. 

써보지 못한 단축키라 당황했다.


나만 그런건가? ㅎㅎㅎ


같은 거 보신 분은 Alt + = 조합으로 탈출하시길~


블로그 이미지

레몬도리 LemonDory

개발자의 이야기

출처 : https://docs.nuget.org/consume/package-manager-console

Managing Packages Using the Package Manager Console

This topic describes how to find, install, remove, and update NuGet packages using PowerShell commands. You can also work with packages using the Manage NuGet Packages dialog box. For more information, see Manage NuGet Packages Using the Package Manager dialog.

Using PowerShell commands is required if you want to install a package without having a solution open. It's also required in some cases for packages that create commands that you can access only by using PowerShell.

Finding a Package

From the Tools menu, select Library Package Manager and then click Package Manager Console.

Package Manager Console in menu

The Package Manager Console window is displayed.

Package Manager Console

The two drop-down lists set default values that let you omit parameters from the commands you enter in the window:

  • In the Package source list, select the default source (NuGet package feed) that you want your commands to use. Typically you will leave this as its default value of NuGet official package source. For more information about alternative feeds, see Hosting Your Own NuGet Feeds.
  • In the Default project list, select the default project that you want your commands to work with. (The default value will be the first project in the solution, not necessarily the one you have selected in Solution Explorer when you open the window.)

When you enter commands, you can override these defaults. In the Package Manager Consolewindow, enter Get-Package -ListAvailable at the prompt to see a list of all packages that are available in the selected package source. Starting NuGet 3.0 Beta or higher, Get-Package also takes a -PageSize switch, which enables paging support for listing available packages from a package source.

Get-Package -ListAvailable command

For the default package source, that command is going to list thousands of packages. It makes better sense to specify a filter.

For example, to find the logging package ELMAH, enter Get-Package -ListAvailable -Filter elmah (the name of the package) or Get-Package -Filter Logging -ListAvailable (a keyword in the package description). Starting NuGet client 3.0 Beta or higher, these Get-Package commands can be replaced by Find-Package elmah or Find-Package Logging.

Get-Package command with filter

For more options that you can specify with the Get-Package and Find-Package command, enterGet-Help Get-Package and Get-Help Find-Package, or see Package Manager Console Powershell Reference.

Installing a Package

After you have found a package that you want to install, use the Install-Package command with the name of the package. For example, enter the command Install-Package elmah as shown in the following example:

Install-Package command

Refer here for a complete list of PowerShell Reference on Install

NuGet retrieves the package from the specified package source and installs it in the project that is selected in the Default project drop-down list (unless you specify a different project in the command). Files are copied to the solution, references might be added to the project, the projectapp.config or web.config file might be updated, etc.

If the package you are installing is dependent on other packages, NuGet installs them also if they are not already installed.

If the package requires license acceptance, you will not be prompted in a dialog box. Instead, a message states that your use of the library constitutes license acceptance.

License acceptance text in Package Manager Console

In Solution Explorer, you can see references that Visual Studio has added for the installed library or libraries.

Elmah reference in Solution Explorer

If your app.config or web.config file required changes, those have been applied. The following example shows some of the changes for ELMAH.

Web.config changes for elmah

A new folder named packages is created in your solution folder. (If your project does not have a solution folder, the packages folder is created in the project folder.)

packages folder

The packages folder contains a subfolder for each installed package. This subfolder contains the files installed by the package. It also contains the package file itself (the .nupkg file, which is a .zip file that contains all of the files included in the package).

elmah folder in packages folder

You can now use the library in your project. IntelliSense works when you enter code, and library features such as the ELMAH logging information page work when you run the project.

elmah IntelliSense

elmah Error Log page

Extending The Package Manager Console With Packages

Some packages install new commands that you can use in the Package Manager Console window. One example of such a package is MvcScaffolding, which creates commands you can use to generate ASP.NET MVC controllers and views. The following illustration shows that installing MvcScaffolding creates a new command Scaffold, complete with tab expansion.

Installing and using MvcScaffold

Removing a Package

From the Tools menu, select Library Package Manager and then click Package Manager Console. If you do not already know the name of the package you want to remove, enter Get-Package at the prompt without any flags to see a list of all of the packages that are currently installed.

Package Manager Console showing installed packages

To remove a package, use the Uninstall-Package command with the name of the package. For example, use the Uninstall-Package elmah command as shown in the following example:

uninstall package command

For more options that you can specify with the uninstall-package command, enter get-help uninstall-package or see Package Manager Console Powershell Reference.

The following package elements are removed:

  • References in the project. In Solution Explorer, you no longer see the library in the Referencesfolder or the bin folder. (You might have to build the project to see it removed from the binfolder.)
  • Files in the solution folder. The folder for the package you removed is deleted from thepackages folder. If it is the only package you had installed, the packages folder is also deleted.)
  • Any changes that were made to your app.config or web.config file are undone.

If other packages were installed because they were dependencies of the package that you removed, and if no other packages remain that are dependent on the dependency packages, the dependency packages are also removed.

Refer here for a complete list of PowerShell Reference on Uninstall

Updating a Package

From the Tools menu, select Library Package Manager and then click Package Manager Console. To check if there are newer versions available for any installed packages, enter Get-Package -updates at the prompt.

Get-Package command

To update a package, enter Update-Package with the package ID. For example, enter the commandUpdate-Package jQuery. For more options that you can use with the Update-Packagecommand, enter get-help Update-Package or see here.

update-package command

Refer here for a complete list of PowerShell Reference on Update



블로그 이미지

레몬도리 LemonDory

개발자의 이야기

http://studiostyl.es/

블로그 이미지

레몬도리 LemonDory

개발자의 이야기


프로젝트 파일을 열어 첫번째 PropertyGroup 에 아래를 추가 한다.   <GenerateResourceNeverLockTypeAssemblies>true</GenerateResourceNeverLockTypeAssemblies>

http://blogs.msdn.com/b/dsvc/archive/2010/05/28/the-quot-generateresource-quot-task-failed-unexpectedly-unable-to-load-filetracker-dll.aspx
블로그 이미지

레몬도리 LemonDory

개발자의 이야기

http://www.ensimple.net/enSimple/show.aspx?cnum=635&b_id=study_csharp&page=1

이전의 글에서는 aspnet_regiis 유틸리티를 이용하여 특정 웹 어플리케이션의 web.config를 암/복호화 하는 방법에 대해 소개했다.
http://www.ensimple.net/enSimple/show.aspx?cnum=87&b_id=study_csharp&page=1

그럼 윈도우 어플리케이션의 구성파일 app.config는어떻게 암호화하나 ?
connectionStrings와 같이 DB 연결 문자열 정보를 가진 섹션은 암호화해 두어야 할 것이다. 반드시...
이 경우에 아래와 같은 윈도우가 머신 수준에서 기본 제공하는 암호화 프로바이더, "RsaProtectedConfigurationProvider" 또는 "DataProtectionConfigurationProvider"를 동일하게 사용할 수 있다.
(machine.config에 명시되어 있음)

private void EncryptConfiguration()
        {
            Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
            ConfigurationSection section = config.GetSection("connectionStrings");
            if (section != null)
            {
                if (!section.IsReadOnly())
                {
                    if (section.SectionInformation.IsProtected == false)
                    {
                        section.SectionInformation.ProtectSection("RsaProtectedConfigurationProvider");
                        section.SectionInformation.ForceSave = true;
                        config.Save(ConfigurationSaveMode.Full);
                    }
                }
            }
        }


복호화 하고 싶다면, section.SectionInformation.UnprotectSection(); 메서드를 사용하면 되겠다..

또 다른 방법으로, aspnet_regiis를 이용해서 app.config를 암호화 할 수도 있다.
app.config를 web.config로 이름 변경하여 암호화한 후, 다시 이름을 원래대로 돌려서 사용하는 방법이다.

cd C:\Windows\Microsoft.NET\Framework\v2.0.50727
aspnet_regiis -pef "connectionStrings" "C:\inetpub\wwwroot\WebApp"
aspnet_regiis -pef "appSettings" "C:\inetpub\wwwroot\WebApp"

복호화
aspnet_regiis -pdf "connectionStrings" "C:\inetpub\wwwroot\WebApp"
aspnet_regiis -pdf "appSettings" "C:\inetpub\wwwroot\WebApp"

요건....왠지 이름을 바꾸고 하는 것이 모냥 빠지지 않나?...... -_-
블로그 이미지

레몬도리 LemonDory

개발자의 이야기


플러그인이 설치되었는데 삭제를 하고 비주얼 스튜디오를 여니 플러그인을 찾을 수 없으니
다음부터 로드할 때 볼거냐 안볼거냐 해서 안볼거로 하고 프로젝트를 열고
다음 프로젝트를 열려고 보니 위와 같은 오류를 뿜으며 프로젝트를 못 열게 되었다.

아침부터 ....
그래도 해결 방법은 간단하다
시작 메뉴에 Visual Studio 메뉴에 Visual Studio Tools - Visual Studio 2005 명령 프롬프트 를 실행하고
'devenv /ResetSkipPkgs'를 치면 끝~!
다시 실행하면 이상없이 열릴 것이다.
블로그 이미지

레몬도리 LemonDory

개발자의 이야기


http://msdn.microsoft.com/ko-kr/library/ms994427.aspx#EGAA
블로그 이미지

레몬도리 LemonDory

개발자의 이야기