Skip to content

Stack<T> Conflict #340

Closed
rjamesnw opened this Issue Feb 19, 2013 · 20 comments

3 participants

@rjamesnw

This is a new ScriptSharp project created via "Add New Project" in VS. The Stack apparently is in conflict between the two assemblies. I need System for Regex.

Error 175 The type 'System.Collections.Generic.Stack' exists in both 'C:\Data\Visual Studio\Projects\MyProject\packages\ScriptSharp.0.7.5.1\tools\mscorlib.dll' and 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\System.dll' C:\Data\Visual Studio\Projects\Common Libraries\Common\Utilities\Utilities.cs 846 6 Common.JS

@theoutlander

The problem is that you're referencing a .NET assembly. You need to remove the reference to System.dll. It could have been automatically added by Resharper (if you're using it) or if you added a reference to it manually or if you tried to add a non-s# class file.

Either way, just remove the reference to system.dll in the project references.

For Regex, you simply need the using System statement which is part of mscorlib (in 0.8) ... don't recall if it's a different library in 0.7.5, but it should be included by default.

@rjamesnw
@theoutlander

Documentation is being worked on. Let me know if you have any suggestions/requests and I can try to work on something. In the meanwhile, I'm happy to help you get started.

You can check out the samples folder here. For high-level details on what each one addresses, look at the sample section in Repository Notes.

Note that this is referencing the CC branch (which is 0.8 RC). You can find something similar on master branch (0.7.5), but 0.8 is way better IMO.

@rjamesnw
@theoutlander

I don't think you can use the dll in another project if it references S# libraries. How is it working for you?

@rjamesnw
@rjamesnw
@rjamesnw
@rjamesnw
@nikhilk
Owner
nikhilk commented Feb 20, 2013

There was a mention of Bootstrap - something has been started here (https://github.com/dealproc/scriptsharp/tree/master/src/Libraries/Bootstrap) ... I believe its not 100% complete, and that since then there might have been a newer version of Bootstrap with some changes/additions. However, it might be interesting to take a look and see if you can steal anything from it, to jumpstart your effort.

On the other error, indeed in the script# mscorlib, System.Text.RegularExpressions doesn't exist. The script RegExp type is represented by System.RegExp correspondingly.

@rjamesnw
@rjamesnw
@rjamesnw
@theoutlander

If you're using the master branch (0.7.X), I think it's the RegularExpression class.

If you're on the latest CC branch, it is the RegExp class.

@rjamesnw
@rjamesnw
@theoutlander

That's 0.7.5+ I think, so you should be looking for RegularExpression (if I remember correctly from looking at the source). Try browsing the API in the IDE to see where it is.

If you want to update to the latest, there are two ways to do it:
1. Enlist in the CC branch
2. Download the current code base as a zip from here

Here are some steps that might get you started (I will try to document them soon)

  • Build:

    • Build the CC project in Release mode.
    • Then, under cc\bin\Zip\Packages should have the latest Nuget packages locally.
    • And, cc\bin\ScriptSharp.vsix will have the studio extensions / templates for 0.8
  • Uninstall Previous Version

    • You will first need to uninstall the old version of S# packages associated with your existing project by right clicking your solution->Manage Nuget packages and removing all installed packages for s# 0.7.5
    • Next, go into VS->Tools->Extensions and Updates, Installed->Templates, Uninstall S# templates (this is what shows up when you create a new project)
  • Install New Version:

    • Then go to your project solution->Manage Nuget Packages->Settings (at the bottom left in VS2012)
    • Add a new package source and point it to the cc\bin\Zip\Packages folder (which has your locally built 0.8 pacakges)
    • Once you click ok, in the Manage Nuget Packages window, go to Online tab and select your local package source that you defined above and install the latest stuff....

Please note that you might need to follow the same process for future updates, but only remove and add specific packages that you're interested in.

Let me know if this helps and I can use this as a starting point for the help doc on this topic.

@theoutlander

Oh man, I should have looked at the wiki first! I suppose I can try to make a nicer page with step-by-step instructions and screenshots.

@rjamesnw
@nikhilk nikhilk closed this Feb 22, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.