<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Bhavika Sardhara on Medium]]></title>
        <description><![CDATA[Stories by Bhavika Sardhara on Medium]]></description>
        <link>https://medium.com/@bhavikasardhara?source=rss-7a836f81aab1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*9PA_Ae33W2Ty1LKfun462A.png</url>
            <title>Stories by Bhavika Sardhara on Medium</title>
            <link>https://medium.com/@bhavikasardhara?source=rss-7a836f81aab1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 03:39:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bhavikasardhara/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Code Sharing between ASP.NET and ASP.NET Core]]></title>
            <link>https://medium.com/yudiz-solutions/code-sharing-between-asp-net-and-asp-net-core-dbc1d7035966?source=rss-7a836f81aab1------2</link>
            <guid isPermaLink="false">https://medium.com/p/dbc1d7035966</guid>
            <category><![CDATA[aspnet-developer]]></category>
            <category><![CDATA[aspnetcore]]></category>
            <category><![CDATA[aspnet]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[aspdotnet-development]]></category>
            <dc:creator><![CDATA[Bhavika Sardhara]]></dc:creator>
            <pubDate>Mon, 03 Jul 2023 12:54:18 GMT</pubDate>
            <atom:updated>2023-07-03T12:54:18.621Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*AcpYpTUgSu-EkFU-HeT31Q.jpeg" /></figure><h3>Overview</h3><p><strong>Hello Developers,</strong></p><p>As we know that with the release of .NET 6, we have so many benefits of using ASP.NET core. Like a hot reload facility, intelligent code editing can also be run in the cloud at a lower cost.</p><p>But what if someone is still using ASP.NET till now?</p><p>Have you ever wondered how they can share their code from ASP.NET to ASP.NET core?</p><p>The answer is migration. But migration in ASP.NET code to ASP.NET core code is like a big investment of time. So here’s an article that will provide a clear picturization of migrating the data easily from ASP.NET to ASP.NET core.</p><h4><strong>Topics</strong></h4><ol><li><strong>Share Controller</strong></li><li><strong>Share Model</strong></li><li><strong>Share View</strong></li></ol><h3>Share Controller</h3><p>The first file that we can share between the two projects of ASP.NET is the controller file. If we change in one project that must affect the second project. Likewise, I solved the one error in the first one then it will automatically solve in the second project as well. For that one easy way is to share the same files in both projects.</p><p>ASP.NET core uses new SDK-style file projects which means we can easily open any file and make changes to the file again and again.</p><p>For sharing code in the controller we will create one &lt;ItemGroup&gt; tag. Then after we will add the reference to the old project file to the new project file. Here we have one .cs file and it will update with the .csproj file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/0*JmntwLDVa-waKhIb" /></figure><p>Here with the compilation, we will get some errors and to fix those particular errors, we will use both namespaces in one project. Like they contain both project’s namespace for example,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/573/0*wbd4_kqEpnceEIi4" /></figure><p>We will use the same approach everywhere in the project. Another good way is here we can also create a partial class and extract that code in all new methods.</p><h3>Share Model</h3><p>Unlike controllers, a model can too be shared. Moving onto the next topic which looks for the conversion of models. In every different aspect, the user could notice that usually, the works start with the addition of &lt;itemgroup&gt; code in the .csproj. file</p><p>It came into notice that the template which was used belonged to system.web for controllers too.</p><p>One can begin to update the whole process starting with namespace.</p><p>There one can find the same class which is able to hold asp.net and asp.net core projects in the updated namespace. For basic project support you can also use the pre-compiled C# guidelines for adding basic projects and support.</p><p>Going through those guidelines you will find that there is plenty of assistive information that you can utilize.</p><p>Let’s take an instance that can identify how we can modify the attributes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/582/0*ijv8fBDK_uKEyhI5" /></figure><h3>Share View</h3><p>At the end, we could share the view portion of our project.</p><ul><li>And endlessly, we will be following the same structure.</li><li>The alteration started with the .csproj. File.</li><li>After the alteration, the .csproj.file was shared with _layout.cshtml file.</li><li>In the view file, we are able to use the pre-compile c# directive flexibly in both projects.</li></ul><p>We have here a version which provides a master page and which is also used in the child’s action from asp.net and the core component.</p><p>Thus, the result will be that we can obtain the part of the page in all the other pages that can give us the whole list.</p><p><strong>Here we have an example of the same :</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/0*qBc2-SCq9MaGGFEI" /></figure><h3>Wrapping Up</h3><p>The code sharing ability also allows sharing code that includes static content, for example, CSS files, images, and JavaScript content. Step-by-step we can add more flexibility to our web application today to facilitate your move to ASP.NET Core.</p><p><strong>Here sharing some tips for those who are planning to work with ASP.NET core and migrate their project.</strong></p><ul><li>Make sure your NuGet packages are updated to use the netstandard.</li><li>By switching to .net standard class libraries, you can share code between ASP.NET and ASP.NET Core.</li><li>Find your system references to System.web file for creating interfaces that replace your class libraries by integrating them into the web application. You may quickly transition between ASP.NET and ASP.NET Core capabilities by using dependency injection. It will help to inject methods. And also get many more features from asp.net core.</li></ul><h3>Conclusion</h3><p>So, It is logical proof of sharing the codes between ASP.NET and ASP.NET core. It is now in easy terms for you of knowing how the codes are shared amongst ASP.NET and ASP.NET core. The way code was shared earlier in ASP.NET, the same slide path is preferred for sharing the codes in core. After the clear description of code sharing in core, this blog will definitely help you in understanding the easiest way to implement the codes in your projects.</p><p><strong>Visit Website :</strong> <a href="https://www.yudiz.com/">https://www.yudiz.com</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dbc1d7035966" width="1" height="1" alt=""><hr><p><a href="https://medium.com/yudiz-solutions/code-sharing-between-asp-net-and-asp-net-core-dbc1d7035966">Code Sharing between ASP.NET and ASP.NET Core</a> was originally published in <a href="https://medium.com/yudiz-solutions">Yudiz Solutions</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>