Skip to content

Commit 8ee738c

Browse files
committed
Added project MyLibrary
1 parent c804f96 commit 8ee738c

File tree

6 files changed

+127
-1
lines changed

6 files changed

+127
-1
lines changed

Lessons.sln

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lessons", "Lessons\Lessons.
77
EndProject
88
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyProject", "MyProject\MyProject.csproj", "{FF4CD07A-183E-4F03-8C29-F2A7F2EFDC95}"
99
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyLibrary", "MyLibrary\MyLibrary.csproj", "{3EB8740B-AD4B-4E02-B887-2E86CB05C025}"
11+
EndProject
1012
Global
1113
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1214
Debug|Any CPU = Debug|Any CPU
@@ -21,6 +23,10 @@ Global
2123
{FF4CD07A-183E-4F03-8C29-F2A7F2EFDC95}.Debug|Any CPU.Build.0 = Debug|Any CPU
2224
{FF4CD07A-183E-4F03-8C29-F2A7F2EFDC95}.Release|Any CPU.ActiveCfg = Release|Any CPU
2325
{FF4CD07A-183E-4F03-8C29-F2A7F2EFDC95}.Release|Any CPU.Build.0 = Release|Any CPU
26+
{3EB8740B-AD4B-4E02-B887-2E86CB05C025}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27+
{3EB8740B-AD4B-4E02-B887-2E86CB05C025}.Debug|Any CPU.Build.0 = Debug|Any CPU
28+
{3EB8740B-AD4B-4E02-B887-2E86CB05C025}.Release|Any CPU.ActiveCfg = Release|Any CPU
29+
{3EB8740B-AD4B-4E02-B887-2E86CB05C025}.Release|Any CPU.Build.0 = Release|Any CPU
2430
EndGlobalSection
2531
GlobalSection(SolutionProperties) = preSolution
2632
HideSolutionNode = FALSE

MyLibrary/MyLibrary.csproj

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{3EB8740B-AD4B-4E02-B887-2E86CB05C025}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>MyLibrary</RootNamespace>
11+
<AssemblyName>MyLibrary</AssemblyName>
12+
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<Deterministic>true</Deterministic>
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<DebugSymbols>true</DebugSymbols>
18+
<DebugType>full</DebugType>
19+
<Optimize>false</Optimize>
20+
<OutputPath>bin\Debug\</OutputPath>
21+
<DefineConstants>DEBUG;TRACE</DefineConstants>
22+
<ErrorReport>prompt</ErrorReport>
23+
<WarningLevel>4</WarningLevel>
24+
</PropertyGroup>
25+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26+
<DebugType>pdbonly</DebugType>
27+
<Optimize>true</Optimize>
28+
<OutputPath>bin\Release\</OutputPath>
29+
<DefineConstants>TRACE</DefineConstants>
30+
<ErrorReport>prompt</ErrorReport>
31+
<WarningLevel>4</WarningLevel>
32+
</PropertyGroup>
33+
<ItemGroup>
34+
<Reference Include="System" />
35+
<Reference Include="System.Core" />
36+
<Reference Include="System.Xml.Linq" />
37+
<Reference Include="System.Data.DataSetExtensions" />
38+
<Reference Include="Microsoft.CSharp" />
39+
<Reference Include="System.Data" />
40+
<Reference Include="System.Net.Http" />
41+
<Reference Include="System.Xml" />
42+
</ItemGroup>
43+
<ItemGroup>
44+
<Compile Include="MyMath.cs" />
45+
<Compile Include="Properties\AssemblyInfo.cs" />
46+
</ItemGroup>
47+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
48+
</Project>

MyLibrary/MyMath.cs

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace MyLibrary
8+
{
9+
public static class MyMath
10+
{
11+
public static double Add(double firstValue, double secondValue)
12+
{
13+
return firstValue + secondValue;
14+
}
15+
public static double Subtract(double firstValue, double secondValue)
16+
{
17+
return firstValue - secondValue;
18+
}
19+
public static double Multiply(double firstValue, double secondValue)
20+
{
21+
return firstValue * secondValue;
22+
}
23+
public static double Divide(double firstValue, double secondValue)
24+
{
25+
return secondValue == 0 ? 0 : firstValue / secondValue;
26+
}
27+
}
28+
}

MyLibrary/Properties/AssemblyInfo.cs

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// Общие сведения об этой сборке предоставляются следующим набором
6+
// набора атрибутов. Измените значения этих атрибутов для изменения сведений,
7+
// связанные со сборкой.
8+
[assembly: AssemblyTitle("MyLibrary")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("MyLibrary")]
13+
[assembly: AssemblyCopyright("Copyright © 2021")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми
18+
// для компонентов COM. Если необходимо обратиться к типу в этой сборке через
19+
// COM, задайте атрибуту ComVisible значение TRUE для этого типа.
20+
[assembly: ComVisible(false)]
21+
22+
// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM
23+
[assembly: Guid("3eb8740b-ad4b-4e02-b887-2e86cb05c025")]
24+
25+
// Сведения о версии сборки состоят из указанных ниже четырех значений:
26+
//
27+
// Основной номер версии
28+
// Дополнительный номер версии
29+
// Номер сборки
30+
// Редакция
31+
//
32+
// Можно задать все значения или принять номера сборки и редакции по умолчанию
33+
// используя "*", как показано ниже:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]

MyProject/MyProject.csproj

+6
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,11 @@
4949
<ItemGroup>
5050
<None Include="App.config" />
5151
</ItemGroup>
52+
<ItemGroup>
53+
<ProjectReference Include="..\MyLibrary\MyLibrary.csproj">
54+
<Project>{3eb8740b-ad4b-4e02-b887-2e86cb05c025}</Project>
55+
<Name>MyLibrary</Name>
56+
</ProjectReference>
57+
</ItemGroup>
5258
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
5359
</Project>

MyProject/Program.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Linq;
44
using System.Text;
55
using System.Threading.Tasks;
6+
using MyLibrary;
67

78
namespace MyProject
89
{
@@ -11,7 +12,8 @@ class Program
1112
static void Main(string[] args)
1213
{
1314
Console.WriteLine("Hello World from MyProject!!!");
14-
15+
double result = MyMath.Divide(3, 5);
16+
Console.WriteLine(result);
1517
Console.ReadKey();
1618
}
1719
}

0 commit comments

Comments
 (0)