Starcounter 2.3.1与Visual Studio扩展3.0.0不兼容,项目创建报错求助
Fixing Starcounter 2.3.1 VS Extension Compatibility Issue in VS2017
Hey there, let's work through this version mismatch problem you're hitting as a Starcounter newbie—nothing's more frustrating than getting blocked right at the Hello World step! Here are a few practical solutions to get you up and running:
1. Uninstall the 3.0.0 Extension & Install a Matching 2.3.1-Compatible Version
Since the auto-installed extension is too new for your Starcounter core version, let's swap it out:
- Open VS2017, go to Tools > Extensions and Updates
- Under the Installed > Visual Studio Marketplace tab, locate the Starcounter extension, click Uninstall, and restart VS when prompted
- Grab the VS extension that matches Starcounter 2.3.1.8367:
- If you still have the original Starcounter 2.3.1 installer, check its directory for a VSIX file (usually named something like
Starcounter.VisualStudio.Extension.2.3.1.x.vsix) - Double-click the VSIX file to install it, then restart VS again. This should align the extension version with your core Starcounter install.
- If you still have the original Starcounter 2.3.1 installer, check its directory for a VSIX file (usually named something like
2. Bypass the Extension Entirely: Manually Create a Hello World Project
If you can't track down the matching extension, building the project from scratch is a reliable workaround:
- Open VS2017 and create a new Class Library (.NET Framework) project (target .NET Framework 4.6.1, which is compatible with Starcounter 2.3.1)
- Open the Package Manager Console and run this command to install the exact Starcounter version you need:
Install-Package Starcounter -Version 2.3.1.8367 - Replace the default class code with this minimal Hello World setup:
using Starcounter; namespace HelloWorld { [Database] public class Greeting { public string Message { get; set; } } public class Program { static void Main() { // Initialize sample data Db.Transact(() => { if (!Db.SQL<Greeting>().Any()) { new Greeting { Message = "Hello Starcounter World!" }; } }); // Start the UI Ui.Run("/HelloWorld"); } } [Route("/HelloWorld")] public class HelloWorldPage : Json { public HelloWorldPage() { this.Data = Db.SQL<Greeting>("SELECT g FROM Greeting g").First(); } } } - Adjust project settings: Go to Project Properties > Application, set Output type to Console Application
- Launch Starcounter 2.3.1 from your Start Menu first, then run your project—you should see the Hello World page when navigating to the correct URL.
3. Hack the Extension's Compatibility Manifest (Advanced)
If you're comfortable tweaking files, you can force the 3.0.0 extension to work with 2.3.1 (note: this is unofficial and might have edge cases):
- Navigate to the VS2017 extension directory, typically:
(Adjust the path if you're using a different VS edition like Professional)C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\Extensions\Starcounter - Find the
extension.vsixmanifestfile, open it with a text editor (run as admin to save changes) - Look for the
<Dependencies>section and modify the Starcounter dependency version range to include 2.3.1:<Dependency Id="Starcounter" DisplayName="Starcounter" Version="[2.3.1, 4.0)" /> - Save the file, restart VS, and try creating the project again.
内容的提问来源于stack exchange,提问作者ShrnPrmshr
相关产品推荐
相关产品推荐

