Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6745707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:14:13+00:00 2026-05-26T12:14:13+00:00

Background: We’re using a 3rd party tool in our .NET C# solution. This tool

  • 0

Background:

We’re using a 3rd party tool in our .NET C# solution. This tool has it’s own syntax and integrates with Visual Studio. When we use this tool we write its markup within Visual Studio and then when we build the solution the custom tool runs and generates a .cs file based on the markup we have written.

This generated source file contains a version number which is causing problems when we check these in to version control (Endless conflicts). Our understanding is that it’s considered best practice not to check in generated source files.

So we excluded the generated .cs files from SVN and then the next issue we ran in to was that the Visual Studio solution referenced these files, so when TeamCity (Our continuous build/integration software) went to build the solution it would fail straight away as it couldn’t find these files.

We then removed these from the solution as well as excluding them from SVN, this fixed the original issue, we’re no longer checking in generated code and it builds fine in TeamCity (As the files are re-generated with every build).

We now have a new problem – As the generated files are no longer included in the solution, intellisense and code inspection fails as the generated classes cannot be found. The solution builds just fine (As again the code is re-generated during the build).

Question

Is there a way to tell ReSharper to include generated .cs files in its code inspection? These files are external to the solution but they are in the obj directory.

Cheers,

Tyler

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T12:14:13+00:00Added an answer on May 26, 2026 at 12:14 pm

    As mentioned in my comment, one workaround is to keep the generated files in the solution (but not in source control), while adding a pre-build step to create empty .cs files (if the real generated file isn’t present) so that the file is always available during a build.

    In my projects, I use the following MSBuild targets to generate empty files by using the Touch task. You may need to make some modifications – in my case, the target files are actually defined within a project not at the solution level; and the build action for the files is set to “None” which is important to understand how these targets work.

    <?xml version="1.0" encoding="utf-8" ?>
    <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
    
    <!--
    Creates empty 'dummy' files for any files that are specified but do not exist. 
    To be processed, the following must be true:
    
    1. The file is included in an ItemGroup called CanCreateDummy, e.g.
          <ItemGroup>
            <CanCreateDummy Include="SomeFile.cs" />
          </ItemGroup>
       If you want to specify a CanCreateDummy file in the .csproj file, you would
       modify the above slightly as follows to prevent it appearing twice:
          <ItemGroup>
            <CanCreateDummy Include="SomeFile.cs">
              <Visible>false</Visible>
            </CanCreateDummy>
          </ItemGroup>
    
    2. The file is included in the ItemGroup called None. This is normally performed 
       by adding the file to the project in the usual way through Visual Studio, and 
       then setting the file's Build Action property to None.
    -->
    <Target
      Name="CreateDummyFiles"
      AfterTargets="BeforeBuild"
        >
    <!--
    This voodoo creates the intersection of 2 lists - @(CanCreateDummy) and @(None) 
    (this latter item is defined in the project file). We want to create a filtered 
    list of all items that are in both these lists, which is called _ProjectDummyFiles.
    See http://blogs.msdn.com/b/msbuild/archive/2006/05/30/610494.aspx for how the 
    Condition voodoo works.
    -->
    <CreateItem Include="@(CanCreateDummy)" Condition="'%(Identity)' != ''  and '@(None)' != ''" >
      <Output TaskParameter="Include" ItemName="_ProjectDummyFiles"/>
    </CreateItem>
    
    <Message
        Text="Creating dummy settings file @(_ProjectDummyFiles)"
        Condition=" !Exists('%(_ProjectDummyFiles.FullPath)')"
            />
    
    <Touch
        AlwaysCreate="true"
        Files="@(_ProjectDummyFiles)"
        Condition=" !Exists('%(_ProjectDummyFiles.FullPath)')"
            />
    
    </Target>
    </Project>
    

    Hope this helps

    Rich

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background: I'm in the process of creating a web service using ASP.NET 2.0. This
Background I am writing and using a very simple CGI-based (Perl) content management tool
Background: I have a website that has been built with ASP.NET 2.0 and is
Background: I am customizing an existing ASP .NET / C# application. It has it's
BACKGROUND: Co-worker Adam has been using Google refine to process database downloads with much
Background: At my company we are developing a bunch applications that are using the
Background I work for a large organization which has thousands of MS Access applications
Background: My organization uses Microsoft .Net (3.5) with SQL Server 2005 as back end.
Background - I need a framework/approach to managed database updates for a .NET Winforms
Background School Corp. has two databases with a common table, employees. These two databases

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.