Skip to content

Commit da66740

Browse files
author
juanonsoftware
committed
Adding a class library
1 parent 971c7d3 commit da66740

File tree

7 files changed

+112
-4
lines changed

7 files changed

+112
-4
lines changed

Demo.Lib1/Demo.Lib1.csproj

Lines changed: 48 additions & 0 deletions
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>{9D7D3C23-A570-4C3E-AD9E-50AD4DA8E874}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>Demo.Lib1</RootNamespace>
11+
<AssemblyName>Demo.Lib1</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="Utils.cs" />
45+
<Compile Include="Properties\AssemblyInfo.cs" />
46+
</ItemGroup>
47+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
48+
</Project>
Lines changed: 36 additions & 0 deletions
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+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("Demo.Lib1")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("Demo.Lib1")]
13+
[assembly: AssemblyCopyright("Copyright © 2022")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("9d7d3c23-a570-4c3e-ad9e-50ad4da8e874")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]

Demo.Lib1/Utils.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using System;
2+
3+
namespace Demo.Lib1
4+
{
5+
public class Utils
6+
{
7+
public static string GetDate()
8+
{
9+
return DateTime.Now.ToString();
10+
}
11+
}
12+
}

Rabbit.Mvc5Minimal2/Controllers/HomeController.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Web;
1+
using Demo.Lib1;
52
using System.Web.Mvc;
63

74
namespace Rabbit.Mvc5Minimal2.Controllers
@@ -10,6 +7,8 @@ public class HomeController : Controller
107
{
118
public ActionResult Index()
129
{
10+
ViewBag.DateTimeNow = Utils.GetDate();
11+
1312
return View();
1413
}
1514

Rabbit.Mvc5Minimal2/Rabbit.Mvc5Minimal2.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,12 @@
171171
<Content Include="Scripts\jquery-3.3.1.slim.min.map" />
172172
<Content Include="Scripts\jquery-3.3.1.min.map" />
173173
</ItemGroup>
174+
<ItemGroup>
175+
<ProjectReference Include="..\Demo.Lib1\Demo.Lib1.csproj">
176+
<Project>{9d7d3c23-a570-4c3e-ad9e-50ad4da8e874}</Project>
177+
<Name>Demo.Lib1</Name>
178+
</ProjectReference>
179+
</ItemGroup>
174180
<PropertyGroup>
175181
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
176182
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>

Rabbit.Mvc5Minimal2/Views/Home/Index.cshtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<h1>ASP.NET</h1>
77
<p class="lead">ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS and JavaScript.</p>
88
<p><a href="https://asp.net" class="btn btn-primary btn-lg">Learn more &raquo;</a></p>
9+
<p>Server time is: @ViewBag.DateTimeNow</p>
910
</div>
1011

1112
<div class="row">

mvc5.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ VisualStudioVersion = 15.0.28307.645
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rabbit.Mvc5Minimal2", "Rabbit.Mvc5Minimal2\Rabbit.Mvc5Minimal2.csproj", "{F8215194-4529-45F4-B42F-B4DC6B7802F1}"
77
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Demo.Lib1", "Demo.Lib1\Demo.Lib1.csproj", "{9D7D3C23-A570-4C3E-AD9E-50AD4DA8E874}"
9+
EndProject
810
Global
911
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1012
Debug|Any CPU = Debug|Any CPU
@@ -15,6 +17,10 @@ Global
1517
{F8215194-4529-45F4-B42F-B4DC6B7802F1}.Debug|Any CPU.Build.0 = Debug|Any CPU
1618
{F8215194-4529-45F4-B42F-B4DC6B7802F1}.Release|Any CPU.ActiveCfg = Release|Any CPU
1719
{F8215194-4529-45F4-B42F-B4DC6B7802F1}.Release|Any CPU.Build.0 = Release|Any CPU
20+
{9D7D3C23-A570-4C3E-AD9E-50AD4DA8E874}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{9D7D3C23-A570-4C3E-AD9E-50AD4DA8E874}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{9D7D3C23-A570-4C3E-AD9E-50AD4DA8E874}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{9D7D3C23-A570-4C3E-AD9E-50AD4DA8E874}.Release|Any CPU.Build.0 = Release|Any CPU
1824
EndGlobalSection
1925
GlobalSection(SolutionProperties) = preSolution
2026
HideSolutionNode = FALSE

0 commit comments

Comments
 (0)