我在STS中导入了maven项目,当我运行更新更新项目时,我收到:

"Updating Maven Project". Unsupported IClasspathEntry kind=4

有什么解决办法吗?

在Java中,将布尔值转换为int值的最常用方法是什么?

在Java中,将布尔值转换为int值的最常用方法是什么?

我使用下面的行来转换浮点数为int,但它不是像我想要的那样准确:

 float a=8.61f;
 int b;

 b=(int)a;

结果是:8(它应该是9)

当a = -7.65f时,结果是:-7(它应该是-8)

最好的方法是什么?

当我清理并构建具有多个项目的解决方案时,输出窗口将报告构建成功。然而,当我查看错误列表窗口时,它向我显示了这样的警告:

发现同一依赖程序集的不同版本之间存在无法解决的冲突。当日志详细信息设置为detailed时,这些引用冲突将在生成日志中列出。C:\Program Files (x86)\MSBuild\12.0\bin\ Microsoft.Common.CurrentVersion.targets

当我双击此消息时,它将打开C:\Program Files (x86)\MSBuild\12.0\bin\ Microsoft.Common.CurrentVersion。目标文件,但我不明白任何东西在它。

我正在使用Visual Studio Express 2013的Web。

我如何找出什么是错误的,与哪个DLL,然后我如何使警告消失?

. net 3.5解决方案在使用msbuild编译时出现此警告。

有时NDepend可能会有所帮助,但在这种情况下,它没有提供任何进一步的细节。像Bob一样,我最终不得不在ILDASM中打开每个程序集,直到找到引用依赖程序集的旧版本。

我确实尝试使用VS 2010 Beta 2的MSBUILD(连接文章指出这在CLR的下一个版本中得到了修复),但也没有提供更多的细节(可能是在Beta 2后修复的)。

有没有更好的(更自动化的)方法?

有时java让我困惑。 我有大量的int初始化要做。

真正的区别是什么?

Integer.toString(我) 新的整数(我).toString ()

我正在尝试在TeamCity上运行我的测试,它目前安装在我的机器上。

系统。InvalidOperationException: 实体框架提供程序类型 “System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework。SqlServer,版本=6.0.0.0,区域性=中性, System.Data.SqlClient的PublicKeyToken=b77a5c561934e089 ADO。NET提供程序无法加载。确保提供程序集 对正在运行的应用程序可用。 详见http://go.microsoft.com/fwlink/?LinkId=260882 信息. .

我在codeplex上升级到EF6的任何项目中都没有引用System.Data.Entity。

我不确定为什么会得到这个异常。 当我从VS运行测试时,我没有得到任何这样的异常。

我尝试设置CopyLocal为假,然后再次为真..但这似乎也不管用。

更新

我的app.config有以下内容。这会导致一些我无法理解的行为吗?

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
  </configSections>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
  </entityFramework>
</configuration>

我在teamcity中得到了以下stacktrace。

[MSTest] IntegrationTests.CrudTest+QuestionTest.Create
[03:59:11][IntegrationTests.CrudTest+QuestionTest.Create] Initialization method IntegrationTests.CrudTest+QuestionTest.Initialize threw exception. System.InvalidOperationException: System.InvalidOperationException: The Entity Framework provider type 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' for the 'System.Data.SqlClient' ADO.NET provider could not be loaded. Make sure the provider assembly is available to the running application. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information..
[03:59:11]
[IntegrationTests.CrudTest+QuestionTest.Create]     at System.Data.Entity.Config.ProviderServicesFactory.GetInstance(String providerTypeName, String providerInvariantName)
   at System.Data.Entity.Config.ProviderServicesFactory.GetInstanceByConvention(String providerInvariantName)
   at System.Data.Entity.Config.DefaultProviderServicesResolver.GetService(Type type, Object key)
   at System.Data.Entity.Config.CachingDependencyResolver.<>c__DisplayClass1.<GetService>b__0(Tuple`2 k)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
   at System.Data.Entity.Config.CachingDependencyResolver.GetService(Type type, Object key)
   at System.Data.Entity.Config.ResolverChain.<>c__DisplayClass3.<GetService>b__0(IDbDependencyResolver r)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
   at System.Data.Entity.Config.ResolverChain.GetService(Type type, Object key)
   at System.Data.Entity.Config.RootDependencyResolver.GetService(Type type, Object key)
   at System.Data.Entity.Config.ResolverChain.<>c__DisplayClass3.<GetService>b__0(IDbDependencyResolver r)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
   at System.Data.Entity.Config.ResolverChain.GetService(Type type, Object key)
   at System.Data.Entity.Config.CompositeResolver`2.GetService(Type type, Object key)
   at System.Data.Entity.Config.IDbDependencyResolverExtensions.GetService[T](IDbDependencyResolver resolver, Object key)
   at System.Data.Entity.Config.InternalConfiguration.GetService[TService](Object key)
   at System.Data.Entity.Config.DbConfiguration.GetService[TService](Object key)
   at System.Data.Entity.Utilities.DbProviderFactoryExtensions.GetProviderServices(DbProviderFactory factory)
   at System.Data.Entity.Infrastructure.DefaultManifestTokenService.GetProviderManifestToken(DbConnection connection)
   at System.Data.Entity.Utilities.DbConnectionExtensions.GetProviderInfo(DbConnection connection, DbProviderManifest& providerManifest)
   at System.Data.Entity.DbModelBuilder.Build(DbConnection providerConnection)
   at System.Data.Entity.Internal.LazyInternalContext.CreateModel(LazyInternalContext internalContext)
   at System.Data.Entity.Internal.RetryLazy`2.GetValue(TInput input)
   at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
   at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
   at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
   at System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()
   at System.Data.Entity.Internal.Linq.InternalSet`1.ActOnSet(Action action, EntityState newState, Object entity, String methodName)
   at System.Data.Entity.Internal.Linq.InternalSet`1.Add(Object entity)
   at System.Data.Entity.DbSet`1.Add(TEntity entity)
   at EFRepository.Infrastructure.EFRepository`1.Add(T item) in c:\TeamCity\buildAgent\work\da2ea4e72c0e77f0\Repository\Infrastructure\EFRepository.cs:line 22
   at IntegrationTests.CrudTest.Initialize() in c:\TeamCity\buildAgent\work\da2ea4e72c0e77f0\IntegrationTests\CrudTest.cs:line 34

试图在构建服务器上构建我的项目给我以下错误:

Microsoft (R) Build Engine Version 4.0.30319.1
error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\TeamData\Microsoft.Data.Schema.SqlTasks.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

几个月前,我通过在Build Server上安装Visual Studio 2010解决了这个问题。但是现在我从头开始安装一个新的服务器,我想知道是否有更好的解决方案来解决这个问题。

给定一个数字:

int number = 1234;

这将是将它转换为字符串的“最佳”方式:

String stringNumber = "1234";

我尝试搜索(谷歌)寻找答案,但似乎“值得信赖”的并不多。